-
Notifications
You must be signed in to change notification settings - Fork 13
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
Generalizing the custom block comment syntax #>
#45
Comments
I believe it is good to introduce new characters and have some nuance to what kind of comment is being left. I view this as something similar to markdown and the using hash symbols for H1, H2, H3, etc... For me, I would take |
Thanks, I appreciate your thoughts on this. The reason it's difficult for me to decide is because I'm being pulled in two directions:
Perhaps the most reasonable thing to do here is to simply keep the default grammar as-is, and use the aforementioned separate, extended opt-in grammar for further additions to the block comments syntax. Perhaps a "mcfunction-imp" grammar that goes all-out. People would be able to easily set this as their default grammar for mcfunction files with an editor like VSCode if they so desire. (I believe it's a single-line in user |
I think the opt-in options makes the most sense. I feel it is best to represent the core language with accurate fidelity. I feel there is also a large group of folks who would prefer to be led towards stronger optimization. This is, of course, entirely based on the effort you'd like to put in. |
This will be addressed in version 0.18.0 of the extension. For now, I've added a few extra characters to the block comment syntax: I don't think this is the ideal solution, but I think it's better than keeping everyone locked into using I'll probably consider removing the block comment highlighting (including the |
Sry for the late feedback, but I shortly wanna share my opinion: I generally support the idea of block comments and doc comments. Like JSDoc was never in the language specification but is now included in the official highlighter. (To be fair, JSDoc had it a bit easier because of its inspiration from JavaDoc...) I also find the idea of having a separated language grammar for the doc comments that can register as a module in this one a good one. Maybe we can also expand on this idea in different directions. |
@ShadowCreator250 This issue and the changes recently pushed in version 0.18.0 don't include any doc comment highlighting apart from what was already present. The only change was expanding the pool of possible characters that activate the existing block comment highlighting. Any further support for doc comment highlighting is not planned for language-mcfunction. IMP-Doc is a separate project that attempts to define a proper doc comment format. At some point IMP-Doc might ship its own grammar extension that injects itself into the grammar provided by language-mcfunction. I don't want to force this into the default grammar because the vast majority of users aren't concerned with doc comments and because it would stunt the growth of IMP-Doc. See Arcensoth/imp-spec#1 (comment) for more context. |
The custom block comment syntax introduced by language-mcfunction was inspired by my own usage; the same usage that eventually lead to the documentation format IMP-Doc.
Those involved with IMP-Doc have discussed additional comment prefixes (specifically for IMP-Doc) to denote different types of directives, because the existing block comment syntax
#>
is limited but has resulted in a variety of use-cases.Now, as far as I'm concerned, IMP-Doc is its own independent project and has no influence over language-mcfunction's default (GitHub) grammar. However, the issue raised by IMP-Doc begs the question: could language-mcfunction benefit from a similar change?
I think it's important to keep the base language-mcfunction grammar separate from and uninfluenced by IMP-Doc, because the way GitHub highlights comments should not be influenced by (what is effectively) an arbitrary third-party documentation format.
However, it could be argued that language-mcfunction's block comment syntax
#>
was based on an equally arbitrary decision. Perhaps it should have never been added and should be removed in a future update, to eliminate any possible confusion. This is a fair argument.That being said, I think it's also fair to argue that block comment syntax
#>
should be kept simply because of how useful it's proven itself in practice. Moreover; perhaps it's also fair to argue that this syntax should be generalized, to reduce the impact of the initial (arbitrary) decision to choose>
as the trigger character.In short: I'd like to generalize the custom block comment syntax
#>
by extending the set of trigger characters. This would widen the pool of possible options for users as well as third-party formats/tools. For example: instead of just using>
to initiate a block comment, make it so that any special character out of, say,~!@$%^*
, or even\W
(any non-word character), does the same thing.Any thoughts/comments/concerns are appreciated.
The text was updated successfully, but these errors were encountered: