Add quick code commenting

I see all the way back to 2018 Users asking for an easily accessed COMMENTS action like most text editors that can handle various formats – sql, html, php, javascript –

While in Code view a quick Comment out a multi-line block or a single line of code.

It would be extremely useful while testing and troubleshooting a page or action to quickly comment out lines – run the page or action – see how things change or don’t change in the browser & then pop back in to the code editor and uncomment.

Doing this manually all the time seems un-Wappler-like.

Assuming you mean in App Connect, there is already a shortcut for this: Ctrl+/.

There are one or two unfulfilled feature requests regarding comments/commenting, but I don’t think this one is needed (unless I’ve misunderstood your point).

What do you mean “in App Connect”?

When I write “While in Code view” is this unclear?

It's pretty clear, but I was puzzled by your question - about an important feature which is already available, and has been for a long time (perhaps from the beginning). I therefore thought perhaps you were referring to adding comments in Server Action/API files (which is also possible, but limited).

In Wappler’s CODE VIEW tab I can do this by highlighting code and COMMENT OUT with the appropriate Comment tags for the type of file opened?

As Tom already explained you can comment out a section in your page code by using CTRL + /

3 Likes

Also, it doesn’t have to be exact selection.
If you are on any line, using the shortcut will comment that line without needed to select the line.
If your selection spans multiple lines, all lines it covers will get commented. You don’t have to specifically select the start or end of lines.

1 Like

These key combinations are not working on my Mac
It’s a German characters keyboard
I can open the Command Palette with the keys
Command + Shift + P
and when the Command Palette is opened I must
then select “Add line comment” to get the Comments on a line or a selected block of code

If I want these lines uncommented I have to open the Command Palette again and then select
“Toggle Line Comment” to remove the Code comments.

Well ... for Mac it's cmd + / and yes it is working, i just tested this for you again.

I am very happy for you, Teodor.
May your offspring live long and be happy.
May every stroke of your keys bring you supreme joy and many Euros & Dollars.

cmd + / only silences the birds and causes wolves to howl out my door
Selecting code lines in Wappler 4.6.3 on my Mac1 Desktop with German keybord and applying cmd + / leaves my machine unimpressed, yawning and bored with my pointless repetitions

Ctrl/Cmd + / is a pretty standard shortcut for commenting code in text editors (eg VSCode, Brackets etc.). Is there a standard shortcut if you're using a German keyboard? If so, perhaps this is what you're looking for.

try CMD+# or CMD+SHIFT+7

Thank you all but NONE of these work.

Where something happens other things might pop up but nothing that Comments on my selected text lines.

When I open the Command Palette in Wappler it will show the keystrokes that were most recently used if I had previously selected “Add line comment”
and so I see cmd + / but actually using those keys directly doesn’t work –

Maybe some program installed on this Macd reset this particular keystroke combination & kept it reserved for itself.

This probably explains it. Thank you, @patrick

I’ve looked in Mac System Preferences and I can specify Wappler to assign some key combinations but it requires that the command must be described exactly – in Words. Maybe when I restart something will change but … I kinda doubt it.

Thanks for all the suggestions.
At least I’ve learned that with a combination of keystrokes to open the Command palette and then select the action to Comment a line or block I might as well type it manually.