- Notifications
You must be signed in to change notification settings - Fork34
💾 The source of VS Code's C++ syntax highlighting
License
jeff-hykin/better-cpp-syntax
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Easy pair programming with any IDE. Duckly enables you to talk, share your code in real-time, server and terminal with people using different IDEs. |
---|
This will get you the bleeding-edge syntax highlighting for C++. Which means your theme will be able to color your code better. This used to be a fix, but then VS Code starting using it as the official source for C and C++ highlighting.
NOTE: The default VS Code theme does not color much. Switch to the Dark+ theme (installed by default) or use a theme like one of the following to benefit from the changes:
- XD Theme
- Noctis
- Kary Pro Colors
- Material Theme
- One Monokai Theme
- Winteriscoming
- Popping and Locking
- Syntax Highlight Theme
- Default Theme Enhanced
Just install the VS Code extension and the changes will automatically be applied to all relevant files.
Link:https://marketplace.visualstudio.com/items?itemName=jeff-hykin.better-cpp-syntax
- Watch the the "Major Changes" threadhere to know when I change licenses, the codebase structure, or just major highlighting changes.
- I support non-VS Code usecases. E.g. yes, you are welcome to open issueslike this one that don't affect VS Code.
It fixes:
- The issue of single quotes inside #error and #warning being highlighted when then shouldn't be
- The issue of initialization functions only highlighting the first parenthesis
- The bug that treats the 'and' and 'or' operator as functions (instead of operators) when they are followed by ()'s
- Old C99 function highlighting that broke the standard function highlighting
- The failure of highlighting for the semicolon after namespaces
- The missing operator overloading symbols
- The failure to tag operator overloading functions as functions
- The failure to tag implicit operator overrides
- The marking of some %'s as invalid inside of stringsatom/language-c#289
- The highlighting of namespaces with ::'satom/language-c#260
- The issue of the C++ syntax depending on (and getting screwed up by) the C syntax
- multiple inheritanceatom/language-c#245
- And many many more issues (#318, #309, #270, #246, etc)
It adds:
- Parameter highlighting
- Highlighting of embedded assembly code (if you have an assembly syntax installed)
- Function-pointer highlighting
- Lambda highlighting
- C++14 literal support (
100'000ms
) - Template definition syntax highlighting (including C++ 2020 syntax)
- Better object identification
- Improved scope resolution
::
syntax - Highlighting of templated function calls
aFunction<int>(arguments)
- Additional specificity for many existing tags
- Many other features
- You'll probably like this as well:My "Better Syntax" Megapack
If you'd like to help improve the syntax, take a look atmain/main.rb
. And make sure to take a look atdocumentation/CONTRIBUTING.md
to get a better idea of how the code works.
Planned future fixes/features:
- Add tagging for type-casting statements
- Add tagging for custom types words
- Better support for dereferenced/pointer tagging
- Full C++ 2020 support (module imports, arrow return types, etc.)
- Improving template types
Let me know! Post an issue onhttps://github.com/jeff-hykin/better-cpp-syntaxI love regular expressions, and PR's are always welcome.
The original JSON was taken fromhttps://github.com/atom/language-c
@matter123 wrote every massive pull request, from simple bugfixes up to the entire textmate testing suite
@j-cortial has fixed many lingering bugs
The #error fix was taken from fnadeau's pull request here:atom/language-c#251
Thank you @matter123, @j-cortial, and @fnadeau!
The rest of the ruby is authored by @jeff-hykin
About
💾 The source of VS Code's C++ syntax highlighting
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors14
Uh oh!
There was an error while loading.Please reload this page.