All Projects → EvgeniyPeshkov → Syntax Highlighter

EvgeniyPeshkov / Syntax Highlighter

Licence: mit
Syntax Highlighter extension for Visual Studio Code (VSCode). Based on Tree-sitter.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
go
31211 projects - #10 most used programming language
ruby
36898 projects - #4 most used programming language
typescript
32286 projects
rust
11053 projects
golang
3204 projects
lua
6591 projects
cpp
1120 projects
cxx
24 projects
shellscript
22 projects

Projects that are alternatives of or similar to Syntax Highlighter

Processing Vscode
A Visual Studio Code extension for the programming language Processing
Stars: ✭ 141 (+60.23%)
Mutual labels:  vscode, vscode-extension, syntax-highlighting
Nord Visual Studio Code
An arctic, north-bluish clean and elegant Visual Studio Code theme.
Stars: ✭ 749 (+751.14%)
Mutual labels:  vscode, syntax-highlighting, syntax
vscode-angular-html
Angular syntax highlighting for HTML templates
Stars: ✭ 35 (-60.23%)
Mutual labels:  syntax-highlighting, vscode, vscode-extension
Vscode Smarty
Smarty syntax highlight extension for Visual Studio Code
Stars: ✭ 10 (-88.64%)
Mutual labels:  vscode, vscode-extension, syntax-highlighting
Vscode Terraform
A Visual Studio Code extension for Hashicorp Terraform
Stars: ✭ 672 (+663.64%)
Mutual labels:  vscode, vscode-extension, syntax-highlighting
Vue Theme Vscode
+200.000 installs ⬇️ Theme for Visual Studio Code inspired by Vue.js, with support for more popular languages, trying to maintain a perfect harmony of colors.
Stars: ✭ 54 (-38.64%)
Mutual labels:  vscode, vscode-extension, syntax-highlighting
Php Namespace Resolver
PHP Namespace Resolver - VSCode Extension
Stars: ✭ 83 (-5.68%)
Mutual labels:  vscode, vscode-extension
Vscode Git Semantic Commit
💬 A Visual Studio Code extension which enables to commit simply by the semantic message conventions
Stars: ✭ 65 (-26.14%)
Mutual labels:  vscode, vscode-extension
Vim
⭐ Vim for Visual Studio Code
Stars: ✭ 9,782 (+11015.91%)
Mutual labels:  vscode, vscode-extension
Vscode Standard
VS Code extension for JavaScript Standard Style (`standard`) with automatic fixing
Stars: ✭ 78 (-11.36%)
Mutual labels:  vscode, vscode-extension
Vscode Org Mode
Emacs Org Mode for Visual Studio Code
Stars: ✭ 1,096 (+1145.45%)
Mutual labels:  vscode, vscode-extension
Vscode Map Preview
VSCode map preview extension
Stars: ✭ 70 (-20.45%)
Mutual labels:  vscode, vscode-extension
Cform Vscode
CloudFormation extension for Visual Studio Code
Stars: ✭ 73 (-17.05%)
Mutual labels:  vscode, vscode-extension
Vscode Csscomb
🔌 VS Code plugin for CSScomb — CSS coding style formatter.
Stars: ✭ 63 (-28.41%)
Mutual labels:  vscode, vscode-extension
Vscode Sftp
Super fast sftp/ftp extension for VS Code
Stars: ✭ 1,121 (+1173.86%)
Mutual labels:  vscode, vscode-extension
Vscode Rsync
rsync extension for visual studio code
Stars: ✭ 68 (-22.73%)
Mutual labels:  vscode, vscode-extension
Vscode Svgviewer
SVG Viewer for Visual Studio Code
Stars: ✭ 60 (-31.82%)
Mutual labels:  vscode, vscode-extension
Azure Iot Developer Kit
A curated list of awesome Azure IoT Developer Kit projects and resources.
Stars: ✭ 73 (-17.05%)
Mutual labels:  vscode, vscode-extension
Vscode Glean
The extension provides refactoring tools for your React codebase
Stars: ✭ 1,194 (+1256.82%)
Mutual labels:  vscode, vscode-extension
Vscode Catch2 Test Adapter
Catch2, Google Test and doctest Adapter for the VSCode
Stars: ✭ 74 (-15.91%)
Mutual labels:  vscode, vscode-extension

Syntax Highlighter for VSCode

Syntax highlighter based on Tree-Sitter.

Languages:

C++, C, Python, TypeScript, TypeScriptReact, JavaScript,

Go, Rust, Php, Ruby, ShellScript, Bash, OCaml, Lua

demo

Languages:

  • C++
  • C
  • Python
  • TypeScript
  • TypeScriptReact
  • JavaScript
  • Go
  • Rust
  • Php
  • Ruby
  • ShellScript
  • Bash
  • OCaml
  • Lua
  • More to come...

Description

Provides universal syntax coloring engine for almost any programming language. See list of currently supported languages above. Under the hood the extension utilizes VSCode Semantic Token API to override syntax coloring provided by standard TextMate regex matching. 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. Incremental parsing system ensures high performance. All these advantages enable accurate and consistent syntax highlighting.

Customization

{Syntax Highlighter} is a semantic token provider. It follows the current color theme out-of-the-box, as soon as the theme enables semantic colorization through its semanticHighlighting setting. You can forcefully enable semantic highlighting in settings.json:

"editor.semanticTokenColorCustomizations": {
    "enabled": true, // enable for all themes
    "[Default Dark+]": {
        "enabled": true // enable for a particular theme
    }
}

To customize token colors follow this guide. For example:

"editor.semanticTokenColorCustomizations": {
    "[Default Dark+]": {
        "enabled": true,
        "rules": {
            "type":  "#26A69A",
            "namespace": "#00897B",
            "function": "#00BCD4",
            "variable": "#42A5F5",
            "number": "#90A4AE",
            "string": {
                "foreground": "#90A4AE",
                "italic": true
            },
            "comment": {
                "foreground": "#546E7A",
                "fontStyle": "italic"
            },
            "variable.readonly.defaultLibrary": "#A89F9B",
            "macro": "#7E57C2",
            "keyword": "#7986CB",
            "operator": "#9575CD",
            "type.modification": "#00897B",
            "punctuation": "#A1887F"
        }
    }
}

If no color is assigned to a semantic token by a theme, the VSCode uses the Semantic Token Scope Map.

{Syntax Highlighter} provides the next tokens:

  • type - types (class, struct, enum)
  • namespace - scopes (namespace, module, outer class)
  • function - functions (function, method, interface)
  • variable - variables (variable, property, member)
  • number - number literals (10, 10.0f, 0x10)
  • string - string literals (string, regex, char)
  • comment - comments
  • variable.readonly.defaultLibrary - language constants (true, nullptr, nil)
  • macro - directives (#include, import, use)
  • keyword - control keywords (if, continue, return)
  • operator - operators (&&, +=, ->)
  • type.modification - modifiers (const, public, override)
  • punctuation - punctuation symbols (., :, {)

punctuation is a custom (non-standard) token introduced by {Syntax Highlighter}. Its fallback TextMate scope is "punctuation". The default fallback for type.modification is "storage.modifier". Note that if you override type color you should also override type.modification. Otherwise, type.modification color will first fallback to a more general type instead of mapped TextMate scope. The same goes for variable and variable.readonly.defaultLibrary.

Settings

syntax.highlightComment

Enable/disable highlighting of comments.

This setting is useful, when you have other extensions, providing colorization within comments. For example, highlighting of ToDo-like tags or documentation syntax, like Doxygen or Sphinx. To not overwrite their colorization you can disable highlighting of comments, putting "syntax.highlightComment": false, in your settings.json.

syntax.highlightTerms

List of enabled terms.

If you want to disable {Syntax Highlighter} for certain terms and use standard coloring instead, just remove them from syntax.highlightTerms list in your settings.json. By default all supported terms are enabled.

syntax.highlightLanguages

List of enabled languages.

If you want to disable {Syntax Highlighter} for certain languages and use standard coloring instead, just remove them from syntax.highlightLanguages list in your settings.json. By default all supported languages are enabled.

Build

{Syntax Highlighter} utilizes WebAssembly bindings to the Tree-sitter parsing library. All language parsers are compiled to binary .wasm modules. To build .wasm you'll need Emscripten SDK. Refer to BUILD.md for instructions.

Contribute

The best way to contribute is to implement support of new languages. Extension improvements are also welcome. Refer to CONTRIBUTE.md for details.

ToDo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].