How to comment out code in SQLiteStudio SQL editor? - sqlitestudio

Is there a way to temporary comment out some of code in SQLiteStudio? I have to add -- or /* ... */ each time and remove them manually. It will be greate if we can trigger comment using a button or shortcut like Ctrl-/. How do you tackle this problem when using SQLiteStudio?
(SQLiteStudio 3.0.7 on Windows 7)

Now it is available via these notations:
-- for one line comments
/*
for several line comments
*/
Edit:
Ctrl + / : comments the line which cursor is on it, also this hot key adds several line comment notation to the start and end point of selected area.

Related

Commenting out in a bulk SQL developer

How to single comment out selected text in a bulk? I have 100+ lines of text that have to be commented out, single line each but idk how to do it, you can only comment out in bulk multiple lines that are treated like one entity using /* text */, but I want to transform:
a
b
c
into:
--a
--b
--c
in a single command, anyone knows how to do it?
Highlight the lines and then use:
Ctrl+/
Ctrl+Shift+/ or
from the menu Source > Toggle Line Comments.

How can I configure JSDoc or VSCode to NOT use leading star/asterix in block comments

I find the leading star/asterix very annoying,
the moment I press EnterKey inside a block comment a leading star is inserted.
I would like my block comments to simply look like this
I do not see any specific jsdoc extension in my installed ones, let me know if I need one.
If it a configuration I am missing please let me know which file/settings I need to change.
Thank you.
Unfortunately you can't.
Despite disabling JSDoc autocompletion, VSCode still completes doc comments
completeJSDocs: false does not fully disable autocompletion
However, the leading * is not auto inserted once you have a non * line.
Ex:
/** ENTER HERE WILL INSERT A ASTERISK
a ENTER HERE WILL NOT
*/

In VSCode, how can I turn a multi-line comment into a paragraph with no line breaks?

What's an easy way to convert a multi-line comment (e.g. JSDoc with each line separated by line breaks) into a paragraph without any line breaks that I can copy into an email or another document?
I know I can use search & replace with regular expressions, but is there a more ergonomic way to do it?
You probably knew that you can use multiple cursors to change multiple lines at once, but did you know you can also use them to remove line breaks? Assume you start with this comment:
/**
* Returns a new `Temporal.LocalDateTime` instance representing the first
* valid time during the current calendar day and time zone of `this`.
*
* The local time of the result is almost always `00:00`, but in rare cases it
* could be a later time e.g. if DST starts at midnight in a time zone. For
* example:
* ```
* const ldt = Temporal.LocalDateTime.from('2015-10-18T12:00-02:00[America/Sao_Paulo]');
* ldt.startOfDay; // => 2015-10-18T01:00-02:00[America/Sao_Paulo]
* ```
*/
First part: use multiple cursors to remove the prefix characters on each line.
Click on the upper-left corner of the comment (the /**).
Now hold down Cmd+Shift (Alt+Shift on PC) and click after the */ on the last line of the comment section.
This will create a columnar, multi-line selection that includes the non-text prefix characters on each line. If the selection doesn't include all the prefix characters, you can hold down the Shift key and use the left or right arrow keys to adjust the width of the selection.
Press the Delete key to remove prefix characters on all lines.
Second part: it's time to delete the line breaks and replace them with spaces. I discovered today that you can use multiple cursors for this part too!
After you've deleted the prefix text above, but before you've pressed any other keys, press the backspace key. It will delete the line breaks but leave each cursor in the same place!
Type the spacebar once to insert one space to replace each line break.
Press ESC to clear multiple selections, and delete the extra space at the start of the line. You may have an extra space(s) at the end of the line too that may need trimming.
Copy the resulting one-line text.
Use Cmd+Z (Ctrl+Z on Windows) to undo the last few changes so your code comment will be back to normal.
Now you can paste the copied text into an email!
The same solution works to replace line breaks with spaces in any multi-line text, not only code comments.
I'm sure that many of you already knew how to do this trick, but I found it so easy and so cool that I thought it was worth sharing as a Q&A here so others can learn about this trick too.
Here's what the steps look like in the VSCode IDE:
Before deleting, you should see something like this:
After deleting prefix characters:
After deleting line breaks (note the multiple cursors are still there):
After inserting spaces in place of the deleted line breaks:
I usually select the first line break, then hit/hold command+D repeatedly to add cursors at all line endings I want to edit. Then, just hit space once.

how to add multiline comment with /* */ using shortcut keys in netbeans IDE 8.3

Looking for the shortcut key to add multiline(/* */) comments.
shortcut : "Ctr+/" used to add the comment but its comes with "//"
like this ..
//line1
//line2
//line3
I want the comments like below one , using shortcuts key..
/* line 1
line 2
line 3
*/
I am using Netbeans 8.2. For multiline comments
just type /* OR /** and then press Enter.
Hopefully, this will work.
When you use /** to add a comment for an existing method it will generate a skeleton Javadoc for that method.
but as I know Netbeans 8.3 is not released and never will be. Version 9 will be released instead. You might use version 8.2 or lower.
There is no shortcut for a multi-line comment in NetBeans, presumably because there is no need for one; if you simply type /* and press Enter then NetBeans will automatically insert a blank line, followed by */ on the next line, and then position the cursor on the blank line:
/*
{cursor is set here}
*/
(Somewhat related, and slightly more impressive, you can also type /** and press Enter on the line before a method and NetBeans will generate a skeleton Javadoc for that method.)

How can I do group commenting without commenting each line in MATLAB?

How can I comment a group of lines without commenting each line?
I.e., like in C:
/*
printf("hello");
printf("there");
*/
In MATLAB, the only way I know to do this is to comment each line:
%disp('hello')
%disp('there')
I have a 100 lines to comment out, and I would prefer to group comment it like in C.
Can I comment a block of lines in an MATLAB file using /* ... */ as I can in C?:
%{
...
Block of COMMENTS HERE
...
...
%}
%CODE GOES HERE
plot(1:10)
MATLAB v7+:
%{
...code to be commented
%}
Use the editor:
Select all the lines, and then choose toggle comment or something in the menu. It's there.
Or just select the group of lines you want to comment, and then use keystroke Ctrl + / (forward slash)'.
And voila, it will comment each line in the selected block with % as one would do individually.
To undo, I tried, but I don't know what key stroke can work.
Select all lines and then do:
For commenting:
From the Text menu → Comment
For uncommenting:
From the Text menu → Uncomment
You can use keyboard shortcuts:
To comment multiple lines: Ctrl + R
To uncomment multiple lines: Ctrl + T
It works perfect in MATLAB 2016.