mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
* -"Run current" command runs the entire selection instead of only first statement in the selection * -brought some logic back from the old code to correct the behavior * -Added unit tests for runCurrent command * -Fixed a comment * - Added checks for run input parameters * -Added some extra checks * -Fixed some spacing issue * Changed to using verify instead of a counter variable
This commit is contained in:
@@ -242,8 +242,8 @@ export class RunQueryAction extends QueryTaskbarAction {
|
||||
if (this.isConnected(editor)) {
|
||||
// if the selection isn't empty then execute the selection
|
||||
// otherwise, either run the statement or the script depending on parameter
|
||||
let selection = editor.getSelection();
|
||||
if (runCurrentStatement && selection) {
|
||||
let selection = editor.getSelection(false);
|
||||
if (runCurrentStatement && selection && this.isCursorPosition(selection)) {
|
||||
editor.input.runQueryStatement(selection);
|
||||
} else {
|
||||
// get the selection again this time with trimming
|
||||
@@ -252,6 +252,11 @@ export class RunQueryAction extends QueryTaskbarAction {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected isCursorPosition(selection: IRange) {
|
||||
return selection.startLineNumber === selection.endLineNumber
|
||||
&& selection.startColumn === selection.endColumn;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user