Skip to content

Commit 979cce9

Browse files
committed
refactor: collapse double ternary in queryUtils.ts
1 parent a635c7f commit 979cce9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ const pickApiForQuery = async (
3737
export class GetQueryAndApiInputs implements ParametersGatherer<QueryAndApiInputs> {
3838
public async gather(): Promise<CancelResponse | ContinueResponse<QueryAndApiInputs>> {
3939
const editor = vscode.window.activeTextEditor;
40-
const query = !editor
41-
? await vscode.window.showInputBox(INPUT_BOX_OPTIONS)
42-
: editor.selection.isEmpty
40+
const query =
41+
!editor || editor.selection.isEmpty
4342
? await vscode.window.showInputBox(INPUT_BOX_OPTIONS)
4443
: editor.document.getText(editor.selection);
4544
if (!query) {

0 commit comments

Comments
 (0)