Skip to content

Commit

Permalink
fix: Tweak to run selected line codelens (#93)
Browse files Browse the repository at this point in the history
resolves #83
  • Loading branch information
bmingles authored Aug 9, 2024
1 parent 57b3597 commit a2b9c8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Binary file modified releases/vscode-deephaven-latest.vsix
Binary file not shown.
14 changes: 10 additions & 4 deletions src/services/RunCommandCodeLensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ export class RunCommandCodeLensProvider
}),
];

// Show the run selected lines code lens if there is a selection and there
// is more than one line in the document.
if (vscode.window.activeTextEditor && document.lineCount > 1) {
const editor = vscode.window.activeTextEditor;

// Show the run selected lines code lens if there is more than 1 line in the
// doc and there is a non-whitespace selection.
if (
editor &&
document.lineCount > 1 &&
/\S/.test(editor.document.getText(editor.selection))
) {
codeLenses.push(
new vscode.CodeLens(vscode.window.activeTextEditor.selection, {
new vscode.CodeLens(editor.selection, {
title: '$(run) Run Deephaven Selected Lines',
command: 'vscode-deephaven.runSelection',
arguments: [document.uri],
Expand Down

0 comments on commit a2b9c8d

Please sign in to comment.