Ref - no extension required, verified in 1.62.3. However, this is a use case for using # over //. Again, in context with the OP question, No, there is no reason to use // over # for nested indentation in this context in the current VSCode because both work exactly the same. I've tested this with both # and // (which BTW, // nests on indentation too. everything through to here is collapsedĪll of that said, " Is there any reason, aside from personal preference, to use // rather than # for comments?" I agree with comments in this thread and in the other thread: // is more commonly recognized and used, which is usually a good reason to use that comment style over #.įinal note, be careful about nesting based on indentation, as code formatting can remove your manual indentation and thus ruin your scheme of nested blocks based on comments. In fact this is exactly how you DISable a #region block: // #regionĪs to commenting out a region in VSCode: /** You can now collapse this block I cite the following specific usage which one might be tempted to try, but these do not work. On Fold of the outer block: > #region this is a major block You can also use one of our Comment Picker tools to get all names and entries. > #region nested region based on indentation Dont forget contact the winner and share the results via social media. On Fold of the inner block: #region this is a major block # another nested region based on indentation #region nested region based on indentation To the question, No, even for this use case : If you are commenting out a region, you can use # or // or /** */, the technique you use for this is personal preference.Įxamples for block definition in VSCode : #region this is a major block If you're using Visual Studio Code and using regions to block your code, then you must use # rather than // to define the region. One 2021 Answer, which is certainly not the only answer as we see in this thread: * Description: Description of the plugin.OP Question: " Is there any reason, aside from personal preference, to use // rather than # for comments?" Here’s another example which allows file-level PHPDoc DocBlock as well as WordPress plugin file headers: /** * Description: Handle the basics with this plugin. ![]() To do a single line comment type '//' or '' and all text to the right will be ignored by PHP. The single line comment tells the interpreter to ignore everything that occurs on that line to the right of the comment. The first type we will discuss is the single line comment. For more info read related dev note.Ī valid PHP file with a header comment might look like this: /* While there is only one type of comment in HTML, PHP has two types.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |