简体   繁体   中英

Dynamic Syntax Highlighting in VSCode

I'm writing an extension for Visual Studio Code which features syntax highlighting for a scripting language. I was able to color many important elements via a TextMate grammar file. There are many lines where I would not know if a captured string refers to a user defined class (for a static call, for instance), or an instance of a class/variable until I perform analysis in code.

Is there a way I can dynamically highlight syntax via code in Visual Studio Code or any alternatives for achieving this?

What you are asking for is semantic coloring. It is not supported as of VS Code 1.35. You could try to emulate it using decorators , but the decorators can easily get out of sync with the rest of the highlighting during editing

This VS Code issue tracks adding semantic coloring to VS Code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM