Update extensions/ql-vscode/src/run-queries-shared.ts

Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
This commit is contained in:
Dave Bartolomeo
2023-04-14 12:57:45 -04:00
committed by GitHub
parent 30b9d7eb7f
commit 95dda2b3dd

View File

@@ -455,7 +455,7 @@ export async function getQuickEvalContext(
const quickEvalPosition = await getSelectedPosition(editor, range); const quickEvalPosition = await getSelectedPosition(editor, range);
let quickEvalText: string; let quickEvalText: string;
if (!editor.selection?.isEmpty) { if (!editor.selection?.isEmpty) {
quickEvalText = editor.document.getText(editor.selection); quickEvalText = editor.document.getText(editor.selection).trim();
} else { } else {
// capture the entire line if the user didn't select anything // capture the entire line if the user didn't select anything
const line = editor.document.lineAt(editor.selection.active.line); const line = editor.document.lineAt(editor.selection.active.line);