Skip to content
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

Syntax Highlighting and Templated Classes #2590

Closed
KeithBallard opened this issue Oct 2, 2018 · 3 comments
Closed

Syntax Highlighting and Templated Classes #2590

KeithBallard opened this issue Oct 2, 2018 · 3 comments

Comments

@KeithBallard
Copy link

KeithBallard commented Oct 2, 2018

Type: LanguageService

The syntax highlighter does not seem to pick up on types declared by the typename keyword. For example, the code:

template<typename Node>
class Face;

template<typename Node>
class Edge;

template<typename Node>
class Cell
{
public:
typedef Face<Node> FaceType;
typedef Edge<Node> EdgeType;
};

produces this highlighting:
image

The syntax highlighter should be highlighting Node within the templates as a type. If there is a setting I am missing, please advise, but I think this might be a bug within the Language Service.

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.27.2
  • C/C++ Extension Version: 0.19.0
@bobbrow
Copy link
Member

bobbrow commented Oct 2, 2018

This is a problem with the TextMate language grammar which it looks like the Atom folks will no longer be updating. This will have to be addressed with either #230, or microsoft/vscode#50140.

@bobbrow
Copy link
Member

bobbrow commented Nov 2, 2018

Closing this since there are other issues covering it already.

@bobbrow bobbrow closed this as completed Nov 2, 2018
@EvgeniyPeshkov
Copy link

I've developed and published syntax highlighting extension based on Tree-Sitter. It provides universal syntax coloring engine for almost any programming language (currently, C and C++ are supported OOTB).
Constructing entire syntax tree, Tree-sitter efficiently overcomes all limitations of built-in TextMate grammars. Being context-aware, it's able to parse complex language structures providing complete coverage of source code.
I've been using it by myself for a month, so I suppose it's ready for public use.

You can install it from VSCode Marketplace.
Or download .vsix package from GitHub page and install it manually.
Please note, that extension published in VS Code Marketplace will only work in Windows-x64.
For other operating systems, please download pre-compiled .vsix package.
This will be fixed in the near future with one of the next updates.
Alternatively, you can build extension from sources.

@KeithBallard , I've tried sample code you've posted. Coloring, provided by Syntax Highlighter, is right:
templates

@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants