-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiline comments #117
Comments
You can comment out a block (with // comments) in VS Code using Ctrl-K-C, similar block commenting is available in other editors. There's probably a good reason for not having /* and */ , I just cant remember what it is :) |
The reasons for not having block comments are having to decide:
Both those issues are important when using block comments to comment out code, but can also occur in artificial one-line examples:
Right now, the closest Millfork has to block comments is the preprocessor; usually, you can wrap a piece of text in
This nests and doesn't break because of strings, however due to being a preprocessor feature, it does not allow for certain tricky techniques a native comment feature would. I would love some feedback:
|
Like you say, the #if 0 ... #endif can be used instead of /* / when debugging, personally feel / */ is unnecessary. Regarding standard documentation comment syntax, I already use /// in my code where I think I might want to use doxygen in the future. |
I tried Ctrl-K-C but I think because I have the millfork cx16 installed it doesn't work anymore. Maybe something needs to define what the comment char for 'millfork' is for it? #if 0 is probably fine for code blocking. The benefit I see for /* is a lot of things will see it and know that it is a comment and colour it as such, while preprocessor #if defs don't get coloured or understood by normal text editors or even complex ones like xcode. /* xxx /* xxx / is this commented out or not? / It also allows for context. For example compare the visual structure of these two
|
I apologize for the delay in responding. As part of my LSP work in #81 I implemented multiline comments in an attempt to conform to the JSDoc style of creating docstrings. As @KarolS correctly mentions, my implementation suffers from the comment termination and string handling issue, though I'm not sure how problematic these actually are. In my opinion, the value brought along with multiline comments (though really just any kind of automated doccomments) outweighs the compile errors that may occur due to difficult to parse scenarios. I don't think that it is possible to successfully build with one of the above scenarios. In any case, as long as errors are thrown, I think that should be sufficient for now. As we start adding more featureful LSP support (such as highlighting compile errors in editor), the improved iteration time should make any such errors largely a non-issue. |
Please add something that lets you comment out a block either
/* */
or
.coment
.endc
style. Adding // to each thing, to work out what is actually causing the compile error or code error is tedious. Also adding long form comments to be read by a documentation engine gets harder when you can't do free formatting on each line.
The text was updated successfully, but these errors were encountered: