Skip to content

Commit

Permalink
Fix for running pre-selected statement that was for a specific type
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam committed Jul 21, 2023
1 parent 2d85aa3 commit da0d941
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/views/results/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,18 @@ export function parseStatement(editor: vscode.TextEditor): StatementInfo {
if (group) {
content = text.substring(group.range.start, group.range.end);
editor.selection = new vscode.Selection(editor.document.positionAt(group.range.start), editor.document.positionAt(group.range.end));
}
}

[`cl`, `json`, `csv`, `sql`].forEach(mode => {
if (content.trim().toLowerCase().startsWith(mode + `:`)) {
content = content.substring(mode.length + 1).trim();
if (content) {
[`cl`, `json`, `csv`, `sql`].forEach(mode => {
if (content.trim().toLowerCase().startsWith(mode + `:`)) {
content = content.substring(mode.length + 1).trim();

//@ts-ignore We know the type.
type = mode;
}
});
}
//@ts-ignore We know the type.
type = mode;
}
});
}

return {
Expand Down

0 comments on commit da0d941

Please sign in to comment.