Least C++ SyntaxBecause of the complexity of the C++ language, it is hard for a syntax highlighter to function correctly and accurately with regex matching. In most cases, however, a language server would be hooked up to parse the source code and recolor the majority of tokens with sementic highlighting, discarding whatever a syntax highlighter offers. As the language server has more knowledge of the intrinsic structure of the source code, it could color the source code far more accurately. On this basis, this extension intends to provide only a basic set of syntax highlighting that complements a sementic highlighing provider, achieving:
FeaturesProvides basic syntax highlighting for:
What this extension CAN do:To be used as a lightweight complement of a language-server-based semantic highligher like clangd-vscode. What this extension CANNOT do:Provides what the best that a syntax highlighter could offer and replace other state-of-the-art C++ syntax highlighters. Some bizarre but valid constructs such as keywords splitted by a backslash in two lines are not being colored correctly. Some ill-formed programs may be colored incorrectly as well. ShowcaseThe following examples show how this extension(right) is more robust compared to Better C++ Syntax(left), while retaining most highlightings with the help of clangd: Captured in Better C++ Syntax v1.15.13 and Minimal C++ Syntax v0.0.3. Behaviors of both extensions may change in future versions. RequirementsPlease use this extension to complement a semantic highlighter such as clangd. Standalone uses should provide a poor highlighting experience. Extension SettingsNone Known Issues
CreditsSyntax rules in this extension are heavily influenced by better-cpp-syntax. Also, thanks for the community maintaining the awesome cppreference! |