jeff-hykin / better-cpp-syntax

💾 The source of VS Code's C++ syntax highlighting
GNU General Public License v3.0
155 stars 30 forks source link

Incorrect color in multi comments with \sa #519

Closed xiaoma20082008 closed 4 years ago

xiaoma20082008 commented 4 years ago

Checklist

The code with a problem is:

class Test {
private:
int a; /**
\sa
*/
int b; /*
\sa
*/
}

It looks like:

image

It should look like:

no spacial keywords in comments

From microsoft/vscode-cpptools/issues/6108 and microsoft/vscode-cpptools/issues/6108

matter123 commented 4 years ago

This is as intended as \sa is a doxygen command.

@jeff-hykin Doxygen support seems at least a little contriversial with several issues about it.

The following issues complain about doxygen support

While the following issues are in favor of keeping/expanding doxygen support

Would it be worthwhile to publish a version that does not have extended support for any type of documentation comments?

jeff-hykin commented 4 years ago

Would it be worthwhile to publish a version that does not have extended support for any type of documentation comments? @matter123

Yeah I think it would be worthwhile to publish multiple versions of the C++ syntax. There have been some issues with ASM integration too. It'd be really nice if we could supply both a grammar and then injections that could be toggled but I think that isn't allowed by default and would be a lot of work as a workaround.

I think we could just start off with C++ -- extended (ASM, Doxygen, SQL, Regex) and C++ -- pure

msftrncs commented 3 years ago

Items such as this should be handled through an extension that utilizes injections. Then the user can select the appropriate extension flavor they wish. The base grammar only needs to provide the correct scopes to drive the extension injections.