Say I have code like this
some_line_of_code
some_line_of_code
/* some comment about code */
some_line_of_code
some_line_of_code
and i would like to comment out a whole block like this
/*
some_line_of_code
some_line_of_code
/* some comment about code */
some_line_of_code
some_line_of_code
*/
As you can see even SO code parser will not consider last 2 lines of code comments. Is it possible to comment out blocks of code that contain comments?
edit : To clarify, I need this to be able to comment out large sections of code to check if a function I changed can compile in a package that otherwise can't be compiled until all changes have been done.
The most common way to comment out a block of code in Python is using the # character. Any line of code starting with # in Python is treated as a comment and gets ignored by the compiler.
The single line comment is //. Everything from the // to the end of the line is a comment. To mark an entire region as a comment, use /* to start the comment and */ to end the comment. * This is a block comment.
To comment out multiple lines in Python, you can prepend each line with a hash ( # ). With this approach, you're technically making multiple single-line comments.
In SQL Developer, I highlight all lines of PL/SQL that I want commented and use Ctrl + /.
Obviously, you would like a way to comment and uncomment multiple lines quickly. This will put --
in front of each line you have highlighted. Do the same command to uncomment.
you can assign a function key through Tools > Preferences > Key Configuration (Edit / Selection / Comment Lines).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With