├── .github ├── FUNDING.yml └── workflows │ ├── test.yml │ ├── build.yml │ └── docs.yml ├── examples ├── js │ ├── node │ │ ├── .gitignore │ │ ├── README.md │ │ ├── package.json │ │ ├── index.js │ │ └── package-lock.json │ └── vite │ │ ├── .vscode │ │ └── extensions.json │ │ ├── src │ │ ├── vite-env.d.ts │ │ ├── main.ts │ │ └── app.css │ │ ├── tsconfig.node.json │ │ ├── svelte.config.js │ │ ├── index.html │ │ ├── .gitignore │ │ ├── package.json │ │ ├── tsconfig.json │ │ ├── vite.config.ts │ │ └── README.md ├── all_languages.rs └── themes.rs ├── syntastica-parsers-git ├── .gitignore ├── src │ └── lib.rs ├── Cargo.toml └── README.md ├── tree-sitter-wasm-build-tool ├── wasm-sysroot │ ├── stdio.h │ ├── stdlib.h │ ├── stdbool.h │ ├── stdint.h │ ├── wctype.c │ └── wctype.h ├── Cargo.toml ├── README.md └── src │ └── lib.rs ├── .gitignore ├── queries ├── tsx │ ├── injections.scm │ ├── locals.scm │ └── highlights.scm ├── javascript │ ├── injections.scm │ ├── highlights.scm │ └── locals.scm ├── typescript │ ├── injections.scm │ ├── locals.scm │ └── highlights.scm ├── css │ ├── injections.scm │ └── highlights.scm ├── java │ ├── injections.scm │ └── locals.scm ├── cpp │ └── injections.scm ├── c │ └── injections.scm ├── html │ ├── highlights.scm │ └── injections.scm ├── rust │ ├── locals.scm │ └── injections.scm ├── python │ ├── injections.scm │ └── locals.scm ├── bash │ ├── locals.scm │ ├── injections.scm │ └── highlights.scm ├── jsx │ ├── injections.scm │ └── highlights.scm ├── asm │ └── highlights.scm ├── go │ ├── injections.scm │ └── locals.scm ├── json │ └── highlights.scm ├── regex │ └── highlights.scm ├── ecma │ └── locals.scm └── html_tags │ ├── highlights.scm │ └── injections.scm ├── syntastica-js ├── .gitignore ├── src │ ├── main.rs │ └── syntastica-js.d.ts ├── .cargo │ └── config.toml ├── pkg │ ├── syntastica_js.wasm │ └── syntastica-js.d.ts ├── typedoc.json ├── build.rs ├── Cargo.toml ├── tsconfig.json ├── README.md └── package.json ├── syntastica-queries ├── generated_queries │ ├── asm │ │ ├── locals.scm │ │ ├── injections.scm │ │ ├── locals_crates_io.scm │ │ ├── injections_crates_io.scm │ │ ├── highlights.scm │ │ └── highlights_crates_io.scm │ ├── c │ │ ├── locals.scm │ │ ├── locals_crates_io.scm │ │ ├── injections.scm │ │ └── injections_crates_io.scm │ ├── cpp │ │ ├── locals.scm │ │ ├── locals_crates_io.scm │ │ ├── injections_crates_io.scm │ │ └── injections.scm │ ├── css │ │ ├── locals.scm │ │ ├── locals_crates_io.scm │ │ ├── injections.scm │ │ ├── injections_crates_io.scm │ │ ├── highlights.scm │ │ └── highlights_crates_io.scm │ ├── html │ │ ├── locals.scm │ │ ├── locals_crates_io.scm │ │ ├── highlights.scm │ │ ├── highlights_crates_io.scm │ │ ├── injections.scm │ │ └── injections_crates_io.scm │ ├── json │ │ ├── locals.scm │ │ ├── injections.scm │ │ ├── locals_crates_io.scm │ │ ├── injections_crates_io.scm │ │ ├── highlights.scm │ │ └── highlights_crates_io.scm │ ├── regex │ │ ├── locals.scm │ │ ├── injections.scm │ │ ├── locals_crates_io.scm │ │ ├── injections_crates_io.scm │ │ ├── highlights.scm │ │ └── highlights_crates_io.scm │ ├── python │ │ ├── injections_crates_io.scm │ │ ├── injections.scm │ │ ├── locals.scm │ │ └── locals_crates_io.scm │ ├── java │ │ ├── injections.scm │ │ ├── injections_crates_io.scm │ │ ├── locals.scm │ │ └── locals_crates_io.scm │ ├── rust │ │ ├── locals.scm │ │ ├── locals_crates_io.scm │ │ ├── injections.scm │ │ └── injections_crates_io.scm │ ├── bash │ │ ├── locals.scm │ │ ├── locals_crates_io.scm │ │ ├── injections.scm │ │ ├── injections_crates_io.scm │ │ ├── highlights.scm │ │ └── highlights_crates_io.scm │ ├── README.md │ ├── go │ │ ├── injections.scm │ │ ├── injections_crates_io.scm │ │ ├── locals.scm │ │ ├── locals_crates_io.scm │ │ └── highlights_crates_io.scm │ ├── tsx │ │ ├── locals.scm │ │ └── locals_crates_io.scm │ ├── typescript │ │ ├── locals.scm │ │ └── locals_crates_io.scm │ └── javascript │ │ ├── locals.scm │ │ └── locals_crates_io.scm ├── build.rs ├── Cargo.toml └── README.md ├── _typos.toml ├── .nlsp-settings └── rust_analyzer.json ├── .cargo └── config.toml ├── .gitattributes ├── rsexpr ├── README.md ├── build.rs ├── src │ └── error.rs ├── Cargo.toml └── tests │ └── display.rs ├── syntastica-themes ├── README.md ├── build.rs ├── Cargo.toml └── nvim_extract.lua ├── syntastica-macros ├── README.md ├── Cargo.toml └── src │ └── schema.rs ├── syntastica-core ├── README.md ├── build.rs ├── src │ ├── lib.rs │ └── error.rs └── Cargo.toml ├── syntastica-highlight ├── README.md ├── Cargo.toml └── LICENSE ├── lua-pattern ├── README.md ├── build.rs ├── Cargo.toml └── src │ └── error.rs ├── xtask ├── src │ ├── codegen │ │ ├── generated_queries_readme.md │ │ ├── parsers_dep.rs │ │ ├── parsers_gitdep.rs │ │ ├── js_lists.rs │ │ ├── theme_list.rs │ │ └── parser_lists.rs │ ├── set_version.rs │ └── main.rs └── Cargo.toml ├── tests ├── validate_queries.rs ├── validate_queries_crates_io.rs └── _shared.rs ├── syntastica-parsers ├── build.rs ├── src │ └── lib.rs ├── README.md └── Cargo.toml ├── syntastica-parsers-gitdep ├── build.rs ├── src │ └── lib.rs └── README.md ├── .pre-commit-config.yaml ├── dprint.json ├── src └── lib.rs └── Cargo.toml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: rubixdev 2 | -------------------------------------------------------------------------------- /examples/js/node/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /syntastica-parsers-git/.gitignore: -------------------------------------------------------------------------------- 1 | /parsers 2 | -------------------------------------------------------------------------------- /tree-sitter-wasm-build-tool/wasm-sysroot/stdio.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /Cargo.lock 3 | /ignored/ 4 | -------------------------------------------------------------------------------- /queries/tsx/injections.scm: -------------------------------------------------------------------------------- 1 | ; inherits: ecma,jsx 2 | -------------------------------------------------------------------------------- /queries/tsx/locals.scm: -------------------------------------------------------------------------------- 1 | ; inherits: typescript 2 | -------------------------------------------------------------------------------- /syntastica-js/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /docs 3 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/asm/locals.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/c/locals.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/cpp/locals.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/css/locals.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/html/locals.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/json/locals.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/regex/locals.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /queries/javascript/injections.scm: -------------------------------------------------------------------------------- 1 | ; inherits: ecma,jsx 2 | -------------------------------------------------------------------------------- /queries/tsx/highlights.scm: -------------------------------------------------------------------------------- 1 | ; inherits: typescript,jsx 2 | -------------------------------------------------------------------------------- /queries/typescript/injections.scm: -------------------------------------------------------------------------------- 1 | ; inherits: ecma 2 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/asm/injections.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/json/injections.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/regex/injections.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/asm/locals_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/c/locals_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/cpp/locals_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/css/locals_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/html/locals_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/json/locals_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/regex/locals_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_typos.toml: -------------------------------------------------------------------------------- 1 | [default.extend-identifiers] 2 | darcula = "darcula" 3 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/asm/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/json/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/regex/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /syntastica-js/src/main.rs: -------------------------------------------------------------------------------- 1 | pub use syntastica_js::*; 2 | 3 | fn main() {} 4 | -------------------------------------------------------------------------------- /tree-sitter-wasm-build-tool/wasm-sysroot/stdlib.h: -------------------------------------------------------------------------------- 1 | #define NULL ((void*)0) 2 | -------------------------------------------------------------------------------- /syntastica-js/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | target = "wasm32-unknown-emscripten" 3 | -------------------------------------------------------------------------------- /.nlsp-settings/rust_analyzer.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.cargo.features": "all" 3 | } 4 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | xtask = "run --package xtask --" 3 | make = "run --package xtask --" 4 | -------------------------------------------------------------------------------- /examples/js/vite/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["svelte.svelte-vscode"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/js/vite/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /queries/css/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /syntastica-queries/generated_queries/** linguist-vendored 2 | /syntastica-js/pkg/** linguist-vendored 3 | -------------------------------------------------------------------------------- /syntastica-js/pkg/syntastica_js.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gobidev/syntastica/main/syntastica-js/pkg/syntastica_js.wasm -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/css/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/css/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/python/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | -------------------------------------------------------------------------------- /queries/java/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | [ 3 | (line_comment) 4 | (block_comment) 5 | ] @injection.content 6 | (#set! injection.language "comment") 7 | ) 8 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/java/injections.scm: -------------------------------------------------------------------------------- 1 | [ 2 | (line_comment) 3 | (block_comment) 4 | ] @injection.content 5 | 6 | (#set! injection.language "comment") 7 | -------------------------------------------------------------------------------- /examples/js/vite/src/main.ts: -------------------------------------------------------------------------------- 1 | import './app.css' 2 | import App from './App.svelte' 3 | 4 | const app = new App({ 5 | target: document.body, 6 | }) 7 | 8 | export default app 9 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/java/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | [ 2 | (line_comment) 3 | (block_comment) 4 | ] @injection.content 5 | 6 | (#set! injection.language "comment") 7 | -------------------------------------------------------------------------------- /examples/js/vite/src/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | color-scheme: dark; 3 | font-family: sans-serif; 4 | } 5 | 6 | body { 7 | background-color: #282c34; 8 | margin: 1rem; 9 | } 10 | -------------------------------------------------------------------------------- /queries/cpp/injections.scm: -------------------------------------------------------------------------------- 1 | ; inherits: c 2 | ; crates.io skip 3 | (raw_string_literal 4 | delimiter: (raw_string_delimiter) @injection.language 5 | (raw_string_content) @injection.content 6 | ) 7 | -------------------------------------------------------------------------------- /queries/c/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ( 7 | (preproc_arg) @injection.content 8 | (#set! injection.language "c") 9 | ) 10 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/c/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ( 7 | (preproc_arg) @injection.content 8 | (#set! injection.language "c") 9 | ) 10 | -------------------------------------------------------------------------------- /examples/js/vite/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler" 7 | }, 8 | "include": ["vite.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /rsexpr/README.md: -------------------------------------------------------------------------------- 1 | # `rsexpr` 2 | 3 | Small and simple S-expression parsing and manipulation with support for 4 | square-bracketed groups and strings. Used by 5 | [`syntastica`](https://crates.io/crates/syntastica) for processing tree-sitter 6 | queries. 7 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/c/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ( 7 | (preproc_arg) @injection.content 8 | (#set! injection.language "c") 9 | ) 10 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/cpp/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ( 7 | (preproc_arg) @injection.content 8 | (#set! injection.language "c") 9 | ) 10 | -------------------------------------------------------------------------------- /queries/html/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; Forked from https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/html/highlights.scm 2 | ;; Licensed under the Apache License 2.0 3 | ; inherits: html_tags 4 | (doctype) @constant 5 | 6 | " 2 | 3 | 4 | 5 | 6 | syntastica Demo 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /lua-pattern/README.md: -------------------------------------------------------------------------------- 1 | # `lua-pattern` 2 | 3 | Parser for Lua patterns and conversion to regular expressions. 4 | 5 | This crate provides a basic parser for Lua patterns, and, with the `to-regex` 6 | feature enabled, conversion to standard regular expressions as usable by the 7 | [`regex`](https://crates.io/crates/regex) or 8 | [`fancy-regex`](https://crates.io/crates/fancy-regex) crate. 9 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/cpp/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ( 7 | (preproc_arg) @injection.content 8 | (#set! injection.language "c") 9 | ) 10 | 11 | (raw_string_literal 12 | delimiter: (raw_string_delimiter) @injection.language 13 | (raw_string_content) @injection.content 14 | ) 15 | -------------------------------------------------------------------------------- /examples/js/vite/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/README.md: -------------------------------------------------------------------------------- 1 | # Generated Queries for `syntastica-queries` 2 | 3 | **DO NOT EDIT THESE FILES!** All files in this directory were automatically 4 | generated by running `cargo xtask codegen` in the syntastica workspace. If you 5 | wish to make changes to any query, edit the appropriate file in 6 | [the `queries` directory at the repository root](../../queries) instead. 7 | -------------------------------------------------------------------------------- /xtask/src/codegen/generated_queries_readme.md: -------------------------------------------------------------------------------- 1 | # Generated Queries for `syntastica-queries` 2 | 3 | **DO NOT EDIT THESE FILES!** All files in this directory were automatically 4 | generated by running `cargo xtask codegen` in the syntastica workspace. If you 5 | wish to make changes to any query, edit the appropriate file in 6 | [the `queries` directory at the repository root](../../queries) instead. 7 | -------------------------------------------------------------------------------- /tree-sitter-wasm-build-tool/wasm-sysroot/wctype.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswalpha(wint_t ch) { 4 | return (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122); 5 | } 6 | 7 | int iswspace(wint_t ch) { 8 | return ch == 32 || (ch >= 9 && ch <= 13); 9 | } 10 | 11 | int iswalnum(wint_t ch) { 12 | return (ch >= 48 && ch <= 57) || (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122); 13 | } 14 | -------------------------------------------------------------------------------- /queries/rust/locals.scm: -------------------------------------------------------------------------------- 1 | ;; Forked from https://github.com/helix-editor/helix 2 | ;; Licensed under the Mozilla Public License 2.0 3 | ; Scopes 4 | [ 5 | (function_item) 6 | (closure_expression) 7 | (block) 8 | ] @local.scope 9 | 10 | ; Definitions 11 | (parameter 12 | (identifier) @local.definition 13 | ) 14 | 15 | (closure_parameters 16 | (identifier) @local.definition 17 | ) 18 | 19 | ; References 20 | (identifier) @local.reference 21 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/bash/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ( 7 | (regex) @injection.content 8 | (#set! injection.language "regex") 9 | ) 10 | 11 | (command 12 | name: (command_name 13 | (word) @_command 14 | ) 15 | argument: (raw_string) @injection.content 16 | (#match? @_command "^[gnm]?awk$") 17 | (#set! injection.language "awk") 18 | ) 19 | -------------------------------------------------------------------------------- /tests/validate_queries.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | use once_cell::sync::Lazy; 4 | use syntastica::provider::LanguageProvider; 5 | use tree_sitter::Language; 6 | 7 | mod _shared; 8 | use _shared::*; 9 | 10 | syntastica_macros::queries_test!(); 11 | 12 | static PARSERS: Lazy> = Lazy::new(|| { 13 | syntastica_parsers_git::LanguageProviderImpl::all() 14 | .get_parsers() 15 | .unwrap() 16 | }); 17 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/bash/injections_crates_io.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ( 7 | (regex) @injection.content 8 | (#set! injection.language "regex") 9 | ) 10 | 11 | (command 12 | name: (command_name 13 | (word) @_command 14 | ) 15 | argument: (raw_string) @injection.content 16 | (#match? @_command "^[gnm]?awk$") 17 | (#set! injection.language "awk") 18 | ) 19 | -------------------------------------------------------------------------------- /tests/validate_queries_crates_io.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | 3 | use once_cell::sync::Lazy; 4 | use syntastica::provider::LanguageProvider; 5 | use tree_sitter::Language; 6 | 7 | mod _shared; 8 | use _shared::*; 9 | 10 | syntastica_macros::queries_test_crates_io!(); 11 | 12 | static PARSERS: Lazy> = Lazy::new(|| { 13 | syntastica_parsers::LanguageProviderImpl::all() 14 | .get_parsers() 15 | .unwrap() 16 | }); 17 | -------------------------------------------------------------------------------- /queries/python/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ; crates.io skip 7 | ( 8 | (call 9 | function: (attribute 10 | object: (identifier) @_re 11 | ) 12 | arguments: (argument_list 13 | (string 14 | (string_content) @injection.content 15 | ) @_string 16 | ) 17 | ) 18 | (#eq? @_re "re") 19 | (#match? @_string "^r.*") 20 | (#set! injection.language "regex") 21 | ) 22 | -------------------------------------------------------------------------------- /syntastica-queries/generated_queries/python/injections.scm: -------------------------------------------------------------------------------- 1 | ( 2 | (comment) @injection.content 3 | (#set! injection.language "comment") 4 | ) 5 | 6 | ( 7 | (call 8 | function: (attribute 9 | object: (identifier) @_re 10 | ) 11 | arguments: (argument_list 12 | (string 13 | (string_content) @injection.content 14 | ) @_string 15 | ) 16 | ) 17 | (#eq? @_re "re") 18 | (#match? @_string "^r.*") 19 | (#set! injection.language "regex") 20 | ) 21 | -------------------------------------------------------------------------------- /queries/bash/locals.scm: -------------------------------------------------------------------------------- 1 | ;; Forked from https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/bash/locals.scm 2 | ;; Licensed under the Apache License 2.0 3 | ; Scopes 4 | (function_definition) @local.scope 5 | 6 | ; Definitions 7 | (variable_assignment 8 | name: (variable_name) @local.definition 9 | ) 10 | 11 | (function_definition 12 | name: (word) @local.definition 13 | ) 14 | 15 | ; References 16 | (variable_name) @local.reference 17 | 18 | (word) @local.reference 19 | -------------------------------------------------------------------------------- /syntastica-queries/build.rs: -------------------------------------------------------------------------------- 1 | use rustc_version::Channel; 2 | 3 | fn main() { 4 | // for documenting features when using nightly 5 | let channel = match rustc_version::version_meta().unwrap().channel { 6 | Channel::Dev => "CHANNEL_DEV", 7 | Channel::Nightly => "CHANNEL_NIGHTLY", 8 | Channel::Beta => "CHANNEL_BETA", 9 | Channel::Stable => "CHANNEL_STABLE", 10 | }; 11 | println!("cargo:rustc-cfg={channel}"); 12 | println!("cargo:rerun-if-changed=build.rs"); 13 | } 14 | -------------------------------------------------------------------------------- /syntastica-queries/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "syntastica-queries" 3 | version = "0.3.0" 4 | authors.workspace = true 5 | edition = "2021" 6 | license.workspace = true 7 | repository.workspace = true 8 | description = "Collection of tree-sitter queries for syntastica" 9 | 10 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 11 | 12 | [dependencies] 13 | 14 | [build-dependencies] 15 | rustc_version = "0.4.0" 16 | 17 | [package.metadata.docs.rs] 18 | all-features = true 19 | -------------------------------------------------------------------------------- /queries/bash/injections.scm: -------------------------------------------------------------------------------- 1 | ;; Forked from https://github.com/helix-editor/helix 2 | ;; Licensed under the Mozilla Public License 2.0 3 | ( 4 | (comment) @injection.content 5 | (#set! injection.language "comment") 6 | ) 7 | 8 | ( 9 | (regex) @injection.content 10 | (#set! injection.language "regex") 11 | ) 12 | 13 | (command 14 | name: (command_name 15 | (word) @_command 16 | ) 17 | argument: (raw_string) @injection.content 18 | (#match? @_command "^[gnm]?awk$") 19 | (#set! injection.language "awk") 20 | ) 21 | -------------------------------------------------------------------------------- /queries/jsx/injections.scm: -------------------------------------------------------------------------------- 1 | ;; Forked from https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/jsx/injections.scm 2 | ;; Licensed under the Apache License 2.0 3 | ; Styled Jsx 4 | ; 5 | ; Add "lang" to predicate check so that vue/svelte can inherit this 6 | ; without having this element being captured twice 7 | ( 8 | (style_element 9 | (start_tag) @_no_type_lang 10 | (#not-lua-match? @_no_type_lang "%slang%s*=") 11 | (#not-lua-match? @_no_type_lang "%stype%s*=") 12 | (raw_text) @injection.content 13 | ) 14 | (#set! injection.language "css") 15 | ) 16 | 17 | ( 18 | (style_element 19 | (start_tag 20 | (attribute 21 | (attribute_name) @_type 22 | (quoted_attribute_value 23 | (attribute_value) @_css 24 | ) 25 | ) 26 | ) 27 | (raw_text) @injection.content 28 | ) 29 | (#eq? @_type "type") 30 | (#eq? @_css "text/css") 31 | (#set! injection.language "css") 32 | ) 33 | 34 | ; 35 | ; 36 | ( 37 | (script_element 38 | (start_tag) @_no_type_lang 39 | (#not-lua-match? @_no_type_lang "%slang%s*=") 40 | (#not-lua-match? @_no_type_lang "%stype%s*=") 41 | (raw_text) @injection.content 42 | ) 43 | (#set! injection.language "javascript") 44 | ) 45 | 46 | ;