Skip to content

Commit 84b7c10

Browse files
committed
fix: query plan doesn't allow you to type a query in an input box
1 parent 4301e45 commit 84b7c10

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

packages/salesforcedx-vscode-soql/src/commands/queryUtils.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ export class GetDocumentQueryAndApiInputs implements ParametersGatherer<QueryAnd
6363
export class GetQueryInputsForPlan implements ParametersGatherer<QueryInputs> {
6464
public async gather(): Promise<CancelResponse | ContinueResponse<QueryInputs>> {
6565
const editor = vscode.window.activeTextEditor;
66-
const query = !editor
67-
? await vscode.window.showInputBox(INPUT_BOX_OPTIONS)
68-
: editor.selection.isEmpty
69-
? await vscode.window.showInputBox(INPUT_BOX_OPTIONS)
70-
: editor.document.getText(editor.selection);
71-
return query ? { type: 'CONTINUE', data: { query: normalizeQuery(query) } } : { type: 'CANCEL' };
66+
if (!editor || editor.selection.isEmpty) {
67+
return { type: 'CANCEL' };
68+
}
69+
const query = normalizeQuery(editor.document.getText(editor.selection));
70+
return query ? { type: 'CONTINUE', data: { query } } : { type: 'CANCEL' };
7271
}
7372
}
7473

0 commit comments

Comments
 (0)