microsoft / vscode-mssql

Visual Studio Code SQL Server extension.
Other
1.53k stars 457 forks source link

Behavior of the 'Execute Current Statement' command #946

Open ransagy opened 7 years ago

ransagy commented 7 years ago

Since the 'Execute Current Statement' command was newly added (It's awesome, thanks!) I've started using it pretty heavily and it's behavior seems a bit odd (to me only, probably).

According to how the command works right now, I need two keyboard shortcuts to either run the current statement (depends on cursor position, using the new command), what i selected (depends on selection range, using the old command) and executing everything in the editor/file (depends on selection range, or rather, non-selection, using the old command).

What i'd expect to happen is the other way around - The 'Execute Current Statement' would react to both cursor location and selection range (as selection sets/relates to cursor location, somewhat), executing the statement at cursor location if nothing is selected or executing the selected range.

The 'Execute Query' command would execute, well, everything in the current editor/file.

Not sure how much sense that makes for other SQL users, or with the current naming scheme for the two commands.

kevcunnane commented 7 years ago

We'll track this as a backlog suggestion for now and see what others think about this. Definitely room to improve usability here, so let's see whether others like this or are happy as-is

101100 commented 6 years ago

As a brand new user, I'd like to give you my experience. I went looking for "Execute Selected". I only saw "Execute Query" and "Execute Current Statement", so I assumed the feature was not available. The specific nature of "Execute Current Statement" made me assume that "Execute Query" would only run the entire file. My suggestion would be to add two commands and rename "Execute Query":

kburtram commented 1 month ago

@croblesm do you have any thoughts on what makes sense here? I think the core of the confusion (IIUC) is that "Run Current Statement" is actually the "Run Selected Text unless nothing is selected, in which case Run Current Statement" command.