Shortcut key to execute current line only without selection

Leo Lee shared this idea 3 years ago
Completed

Currently, pressing F6 or Ctrl + Enter will execute the selected line(s), or the whole scripts if no selection, but no shortcut key can execute current line only without selection.


The requirement is based on that, we usually want to execute current line immediately after finished typing the statement, without select the whole line first as this is unnecessary and waste time.


Similar feature has provided by Oracle SQL Developer.

Comments (15)

photo
1

Hi Leo,


This feature will be included in next release.

photo
1

This is implemented in 3.1.1

photo
1

Hi, what's the shortcut of it? I can't find the tool tips about this in the version 3.1.1.

photo
1

The shortcut is F4, you could find it in the command palette(Cmd(Ctrl)+Shift+P).

photo
1

Hi, thanks for implementing my requirement! If you allowed, I would advise further enhancement as below (it is just the same feature provided by Oracle SQL Developer and I think it is very help to improve efficiency):


Currently, the "Run/Execute Current Line" command really only execute current line statement, this is only work for script as below:

  1. db.test.find({field: 'abc'});


But not useful for:

  1. db.test.find({
  2. field: 'abc'
  3. });


For above second code snippet, according to SQL Developer, no matter the cursor located at line 1, line 2 or line 3, the execute current line command can correctly execute the whole statement. This feature just requires developer put the ";" at the end of every SQL, so that the command knows where is the beginning and where is end.

photo
1

We're looking for a solution.

photo
1

it's done in version 3.1.2

photo
1

Good job!


Just one minor bug and please see if can be enhanced.


Take below code for example, if the cursor at line #2 or line #6, the F4 (execute current line) function doesn't run as expected and just return "use strict".

  1. db.test.find({
  2. //field: 'abc'
  3. })
  4. db.test.find({
  5. })

photo
1

It's done in version 3.1.3

photo
1

Great and thanks!

photo
1

Is it possible to change the 'Run' short-cut to F5?

photo
1

You can not configure shortcut keys in the current version.

photo
1

In the release 3.1.5.


Changed: Bind shortcut F5 to “Run/Execute Current Statement”, replacing F4.


New: CTRL+F5 to execute the current statement into a new tab sheet.

New: CTRL+F6 to execute the entire/selected script into a new tab sheet.

photo
1

Thanks!


Is it able to also change the Ctrl+Enter to execute current statement?

photo
1

We do not intend to change CTRL+ENTER.