-
Notifications
You must be signed in to change notification settings - Fork 3
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
Trailing tags idea #25
Comments
Looks good.
// # some title
// the question? Multiple sentences may have matching errors.
// * bold comment
// TODO: this is the block comment in line mode
// no.2 line
// no.3 line |
Could you point me to the following code please? I thought the matching is a simple combination of trimming and slicing.
Indeed with this feature it's convenient to match only a single line ending
so essentially first line is colored one way and the rest is the other
I didn't quite understand the example, what I meant is to check if comment's content ends with a tag rather than starting. It shouldn't trigger if it appears inside of the string. Basically the logic is if there's no starting tag, check for ending. Also the option may be more generalized |
This code is for single line mode of line comment, if you want to use trailing mode, should add another RegExp match loop before this better-comments-next/src/handler/langs/common.ts Lines 141 to 167 in 6b18ac3
means something like below, some tags in the begining, others at the end. // # some title
// don't use it!
// * bold comment
// ~ custom tag decoration You could use in this way. // # some title
// ! don't use it! (Here is the reason why, this sentence will also be highlighted)
// * bold comment
// ~ custom tag decoration
It will cause the reg more complicate or conflict with the vscode decoration. For example as blow: // ! don't use it! (Here is the reason why, this sentence will also be highlighted) The first At the end, I think it's not worth to do this, bacause:
|
Ah, what I meant is that config can be simpler so it will match both
In case of prefix presence it'd take the charge no matter the ending, so there can't be any conflicts. Basically if it looks like simple comment (without prefix) check for ending. And trailing can't be somewhere in the middle, only at the end as I noted in the initial example. Another example:
That's why I consider it easy to implement. Haven't looked at the code yet though. I'll do it later. |
For any new feature required, it is necessary to consider its necessity, the benefits it brings, You just said how will you use it. But I'm thinking about how will the people use. If there more people needs it, I will think about it. |
I think it'd be nice to have trailing option for tags, so comments could be more syntactically correct.
e.g.
and in config:
The text was updated successfully, but these errors were encountered: