arangodb / arangodb

🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
https://www.arangodb.com
Other
13.57k stars 836 forks source link

Web UI: Add shortcut to (un)comment in query editor #7984

Open Simran-B opened 5 years ago

Simran-B commented 5 years ago

ilx via community slack:

a minor request (if possible): it would be nice if web query editor could (un)comment lines via shortcut (cmd+/ or something similar)

baslr commented 5 years ago

@Simran-B shift + cmd + c toggles comments

from the keyboard shortcuts help Toggle comments Ctrl/Cmd + Shift + C

https://github.com/arangodb/arangodb/blob/8dbab2dc97a05d58f880444198319b58351ae8be/Documentation/Books/Manual/Programs/WebInterface/AqlEditor.md#aql-editor-shortcuts

Simran-B commented 5 years ago

@baslr Thanks, works in Chrome. It's slightly buggy though: If you select a line of code as well as an already outcommented line and hit the shortcut keys, then both lines get // prepended, which means the already outcommented line will then have four slashes.

@hkernbach Can you fix that?

baslr commented 5 years ago

@Simran-B how do you decide if you uncomment or comment? if all selected lines have // at the beginning -> remove // otherwise add //

Simran-B commented 5 years ago

Well, I guess the first line could be used as kicker? If it's commented, then uncomment all selected lines and vice versa, but never add another // if a line is already commented? On the other hand, one might want to uncomment one level and get the code back with lines still commented, although I would personally not do this but rather place a /* somewhere and put the unused lines beneath.

saiarch0 commented 7 months ago

@baslr , Toggle command is not working in Arc Browser