{"id":13588785,"url":"https://github.com/EvgeniyPeshkov/syntax-highlighter","last_synced_at":"2025-04-08T06:32:45.766Z","repository":{"id":43439269,"uuid":"187913464","full_name":"EvgeniyPeshkov/syntax-highlighter","owner":"EvgeniyPeshkov","description":"Syntax Highlighter extension for Visual Studio Code (VSCode). Based on Tree-sitter.","archived":false,"fork":false,"pushed_at":"2023-08-10T12:56:21.000Z","size":1000,"stargazers_count":218,"open_issues_count":26,"forks_count":47,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-02T10:33:03.194Z","etag":null,"topics":["c","cpp","cxx","go","golang","javascript","lua","php","python","ruby","rust","shellscript","syntax","syntax-highlighter","syntax-highlighting","syntax-tree","tree-sitter","typescript","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=evgeniypeshkov.syntax-highlighter","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvgeniyPeshkov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-05-21T21:05:10.000Z","updated_at":"2025-03-16T19:07:19.000Z","dependencies_parsed_at":"2024-01-16T09:55:48.279Z","dependency_job_id":"47615520-10e2-41ea-a08a-392bf96033f8","html_url":"https://github.com/EvgeniyPeshkov/syntax-highlighter","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvgeniyPeshkov%2Fsyntax-highlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvgeniyPeshkov%2Fsyntax-highlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvgeniyPeshkov%2Fsyntax-highlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvgeniyPeshkov%2Fsyntax-highlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvgeniyPeshkov","download_url":"https://codeload.github.com/EvgeniyPeshkov/syntax-highlighter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247792178,"owners_count":20996878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cpp","cxx","go","golang","javascript","lua","php","python","ruby","rust","shellscript","syntax","syntax-highlighter","syntax-highlighting","syntax-tree","tree-sitter","typescript","vscode","vscode-extension"],"created_at":"2024-08-01T15:06:55.718Z","updated_at":"2025-04-08T06:32:40.745Z","avatar_url":"https://github.com/EvgeniyPeshkov.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","c","Tools"],"sub_categories":["Others"],"readme":"# Syntax Highlighter for VSCode\n\n#### Syntax highlighter based on [Tree-Sitter](https://tree-sitter.github.io/tree-sitter/).\n#### Languages:\n#### C++, C, Python, TypeScript, TypeScriptReact, JavaScript,\n#### Go, Rust, Php, Ruby, ShellScript, Bash, OCaml, Lua\n\n![demo](images/demo.gif)\n\n#### Languages:\n* C++\n* C\n* Python\n* TypeScript\n* TypeScriptReact\n* JavaScript\n* Go\n* Rust\n* Php\n* Ruby\n* ShellScript\n* Bash\n* OCaml\n* Lua\n* More to come...\n\n## Description\n\nProvides universal syntax coloring engine for almost any programming language.\nSee [list of currently supported languages](#languages) above. Under the hood the\nextension utilizes VSCode Semantic Token API to override syntax coloring provided\nby standard TextMate regex matching. Constructing entire syntax tree, Tree-sitter\nefficiently overcomes all limitations of built-in TextMate grammars. Being\ncontext-aware, it's able to parse complex language structures providing complete\ncoverage of source code. Incremental parsing system ensures high performance.\nAll these advantages enable accurate and consistent syntax highlighting.\n\n## Customization\n\n{Syntax Highlighter} is a\n[semantic token provider](https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide).\nIt follows the current color theme out-of-the-box, as soon as the theme\nenables semantic colorization through its `semanticHighlighting` setting.\nYou can forcefully enable semantic highlighting in `settings.json`:\n\n```json\n\"editor.semanticTokenColorCustomizations\": {\n    \"enabled\": true, // enable for all themes\n    \"[Default Dark+]\": {\n        \"enabled\": true // enable for a particular theme\n    }\n}\n```\n\nTo customize token colors follow\n[this guide](https://code.visualstudio.com/docs/getstarted/themes#_editor-semantic-highlighting).\nFor example:\n\n```json\n\"editor.semanticTokenColorCustomizations\": {\n    \"[Default Dark+]\": {\n        \"enabled\": true,\n        \"rules\": {\n            \"type\":  \"#26A69A\",\n            \"namespace\": \"#00897B\",\n            \"function\": \"#00BCD4\",\n            \"variable\": \"#42A5F5\",\n            \"number\": \"#90A4AE\",\n            \"string\": {\n                \"foreground\": \"#90A4AE\",\n                \"italic\": true\n            },\n            \"comment\": {\n                \"foreground\": \"#546E7A\",\n                \"fontStyle\": \"italic\"\n            },\n            \"variable.readonly.defaultLibrary\": \"#A89F9B\",\n            \"macro\": \"#7E57C2\",\n            \"keyword\": \"#7986CB\",\n            \"operator\": \"#9575CD\",\n            \"type.modification\": \"#00897B\",\n            \"punctuation\": \"#A1887F\"\n        }\n    }\n}\n```\n\nIf no color is assigned to a semantic token by a theme, the VSCode uses the\n[Semantic Token Scope Map](https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#semantic-token-scope-map).\n\n{Syntax Highlighter} provides the next tokens:\n* **type** - types (class, struct, enum)\n* **namespace** - scopes (namespace, module, outer class)\n* **function** - functions (function, method, interface)\n* **variable** - variables (variable, property, member)\n* **number** - number literals (10, 10.0f, 0x10)\n* **string** - string literals (string, regex, char)\n* **comment** - comments\n* **variable.readonly.defaultLibrary** - language constants (true, nullptr, nil)\n* **macro** - directives (#include, import, use)\n* **keyword** - control keywords (if, continue, return)\n* **operator** - operators (\u0026\u0026, +=, -\u003e)\n* **type.modification** - modifiers (const, public, override)\n* **punctuation** - punctuation symbols (., :, {)\n\n**punctuation** is a custom (non-standard) token introduced by {Syntax Highlighter}.\nIts fallback TextMate scope is *\"punctuation\"*. The default fallback for\n**type.modification** is *\"storage.modifier\"*. Note that if you override **type**\ncolor you should also override **type.modification**. Otherwise, **type.modification**\ncolor will first fallback to a more general **type** instead of mapped TextMate scope.\nThe same goes for **variable** and **variable.readonly.defaultLibrary**.\n\n## Settings\n#### `syntax.highlightComment`\nEnable/disable highlighting of comments.\n\nThis setting is useful, when you have other extensions, providing colorization within\ncomments. For example, highlighting of ToDo-like tags or documentation syntax, like\nDoxygen or Sphinx. To not overwrite their colorization you can disable highlighting of\ncomments, putting `\"syntax.highlightComment\": false,` in your `settings.json`.\n\n#### `syntax.highlightTerms`\nList of enabled terms.\n\nIf you want to disable {Syntax Highlighter} for certain terms and use standard\ncoloring instead, just remove them from `syntax.highlightTerms` list in your\n`settings.json`. By default all [supported terms]((#customization)) are enabled.\n\n#### `syntax.highlightLanguages`\nList of enabled languages.\n\nIf you want to disable {Syntax Highlighter} for certain languages and use standard\ncoloring instead, just remove them from `syntax.highlightLanguages` list in your\n`settings.json`. By default all [supported languages]((#languages)) are enabled.\n\n## [Build](BUILD.md)\n\n{Syntax Highlighter} utilizes\n[WebAssembly bindings to the Tree-sitter parsing library](https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_web).\nAll language parsers are\n[compiled to binary .wasm modules](https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_web#generate-wasm-language-files).\nTo build .wasm you'll need Emscripten SDK. Refer to [BUILD.md](BUILD.md) for instructions.\n\n## [Contribute](CONTRIBUTING.md)\n\nThe best way to contribute is to implement support of new languages. Extension\nimprovements are also welcome. Refer to [CONTRIBUTE.md](CONTRIBUTE.md) for details.\n\n## [ToDo](TODO.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEvgeniyPeshkov%2Fsyntax-highlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEvgeniyPeshkov%2Fsyntax-highlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEvgeniyPeshkov%2Fsyntax-highlighter/lists"}