From 0921178b4224e1420c07d311bded6695f95a7fdf Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Mon, 5 Dec 2022 11:29:52 -0800 Subject: [PATCH] Got tree sitter integration to a shippable place --- Cargo.lock | 12 +- crates/zed/Cargo.toml | 3 +- crates/zed/src/languages.rs | 3 +- .../zed/src/languages/commonlisp/config.toml | 9 - crates/zed/src/languages/commonlisp/folds.scm | 3 - .../src/languages/commonlisp/highlights.scm | 189 ------------------ crates/zed/src/languages/installation.rs | 21 -- crates/zed/src/languages/racket/brackets.scm | 3 + crates/zed/src/languages/racket/config.toml | 6 +- crates/zed/src/languages/racket/folds.scm | 3 - .../zed/src/languages/racket/highlights.scm | 132 ++---------- crates/zed/src/languages/racket/indents.scm | 3 + .../zed/src/languages/racket/injections.scm | 4 - crates/zed/src/languages/racket/outline.scm | 10 + crates/zed/src/languages/ruby/brackets.scm | 14 ++ crates/zed/src/languages/scheme/brackets.scm | 3 + crates/zed/src/languages/scheme/config.toml | 8 +- crates/zed/src/languages/scheme/folds.scm | 3 - .../zed/src/languages/scheme/highlights.scm | 187 ++--------------- crates/zed/src/languages/scheme/indents.scm | 3 + .../zed/src/languages/scheme/injections.scm | 3 - crates/zed/src/languages/scheme/outline.scm | 10 + 22 files changed, 88 insertions(+), 544 deletions(-) delete mode 100644 crates/zed/src/languages/commonlisp/config.toml delete mode 100644 crates/zed/src/languages/commonlisp/folds.scm delete mode 100644 crates/zed/src/languages/commonlisp/highlights.scm create mode 100644 crates/zed/src/languages/racket/brackets.scm delete mode 100644 crates/zed/src/languages/racket/folds.scm create mode 100644 crates/zed/src/languages/racket/indents.scm delete mode 100644 crates/zed/src/languages/racket/injections.scm create mode 100644 crates/zed/src/languages/racket/outline.scm create mode 100644 crates/zed/src/languages/scheme/brackets.scm delete mode 100644 crates/zed/src/languages/scheme/folds.scm create mode 100644 crates/zed/src/languages/scheme/indents.scm delete mode 100644 crates/zed/src/languages/scheme/injections.scm create mode 100644 crates/zed/src/languages/scheme/outline.scm diff --git a/Cargo.lock b/Cargo.lock index 82fcd2edf4..d3cc50f991 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6461,15 +6461,6 @@ dependencies = [ "tree-sitter", ] -[[package]] -name = "tree-sitter-commonlisp" -version = "0.3.0" -source = "git+https://github.com/theHamsta/tree-sitter-commonlisp?rev=c7e814975ab0d0d04333d1f32391c41180c58919#c7e814975ab0d0d04333d1f32391c41180c58919" -dependencies = [ - "cc", - "tree-sitter", -] - [[package]] name = "tree-sitter-cpp" version = "0.20.0" @@ -6578,7 +6569,7 @@ dependencies = [ [[package]] name = "tree-sitter-racket" version = "0.0.1" -source = "git+https://github.com/6cdh/tree-sitter-racket?rev=69ca563af3bcf9d67220532e0814786f2dc34db1#69ca563af3bcf9d67220532e0814786f2dc34db1" +source = "git+https://github.com/zed-industries/tree-sitter-racket?rev=eb010cf2c674c6fd9a6316a84e28ef90190fe51a#eb010cf2c674c6fd9a6316a84e28ef90190fe51a" dependencies = [ "cc", "tree-sitter", @@ -7823,7 +7814,6 @@ dependencies = [ "toml", "tree-sitter", "tree-sitter-c", - "tree-sitter-commonlisp", "tree-sitter-cpp", "tree-sitter-css", "tree-sitter-elixir", diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 755d876bec..cc81f3bf23 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -105,8 +105,7 @@ tree-sitter-typescript = "0.20.1" tree-sitter-ruby = "0.20.0" tree-sitter-html = "0.19.0" tree-sitter-scheme = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "af0fd1fa452cb2562dc7b5c8a8c55551c39273b9"} -tree-sitter-racket = { git = "https://github.com/6cdh/tree-sitter-racket", rev = "69ca563af3bcf9d67220532e0814786f2dc34db1"} -tree-sitter-commonlisp = { git = "https://github.com/theHamsta/tree-sitter-commonlisp", rev = "c7e814975ab0d0d04333d1f32391c41180c58919" } +tree-sitter-racket = { git = "https://github.com/zed-industries/tree-sitter-racket", rev = "eb010cf2c674c6fd9a6316a84e28ef90190fe51a"} url = "2.2" [dev-dependencies] diff --git a/crates/zed/src/languages.rs b/crates/zed/src/languages.rs index 03df3fbab4..0250c53684 100644 --- a/crates/zed/src/languages.rs +++ b/crates/zed/src/languages.rs @@ -129,8 +129,7 @@ pub async fn init(languages: Arc, _executor: Arc) Some(CachedLspAdapter::new(ruby::RubyLanguageServer).await), ), ("scheme", tree_sitter_scheme::language(), None), - // ("racket", tree_sitter_racket::language(), None), - ("commonlisp", tree_sitter_commonlisp::language(), None), + ("racket", tree_sitter_racket::language(), None), ] { languages.add(language(name, grammar, lsp_adapter)); } diff --git a/crates/zed/src/languages/commonlisp/config.toml b/crates/zed/src/languages/commonlisp/config.toml deleted file mode 100644 index a8200f5d32..0000000000 --- a/crates/zed/src/languages/commonlisp/config.toml +++ /dev/null @@ -1,9 +0,0 @@ -name = "Racket" -path_suffixes = ["lisp", "lsp", "l", "cl"] -line_comment = "; " -autoclose_before = "])" -brackets = [ - { start = "[", end = "]", close = true, newline = true }, - { start = "(", end = ")", close = true, newline = true }, - { start = "'", end = "'", close = false, newline = false }, -] diff --git a/crates/zed/src/languages/commonlisp/folds.scm b/crates/zed/src/languages/commonlisp/folds.scm deleted file mode 100644 index c140fa39d8..0000000000 --- a/crates/zed/src/languages/commonlisp/folds.scm +++ /dev/null @@ -1,3 +0,0 @@ -;; Copied from nvim: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/commonlisp/folds.scm - -(source (list_lit) @fold) \ No newline at end of file diff --git a/crates/zed/src/languages/commonlisp/highlights.scm b/crates/zed/src/languages/commonlisp/highlights.scm deleted file mode 100644 index 74b1b8399e..0000000000 --- a/crates/zed/src/languages/commonlisp/highlights.scm +++ /dev/null @@ -1,189 +0,0 @@ -;; Copied from nvim: https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/master/queries/commonlisp/highlights.scm - -(sym_lit) @variable - -;; A highlighting for functions/macros in th cl namespace is available in theHamsta/nvim-treesitter-commonlisp -;(list_lit . (sym_lit) @function.builtin (#cl-standard-function? @function.builtin)) -;(list_lit . (sym_lit) @function.builtin (#cl-standard-macro? @function.macro)) - -(dis_expr) @comment - -(defun_keyword) @function.macro -(defun_header - function_name: (_) @function) -(defun_header - lambda_list: (list_lit (sym_lit) @parameter)) -(defun_header - keyword: (defun_keyword "defmethod") - lambda_list: (list_lit (list_lit . (sym_lit) . (sym_lit) @symbol))) -(defun_header - lambda_list: (list_lit (list_lit . (sym_lit) @parameter . (_)))) -(defun_header - specifier: (sym_lit) @symbol) - -[":" "::" "."] @punctuation.special - -[ - (accumulation_verb) - (for_clause_word) - "for" - "and" - "finally" - "thereis" - "always" - "when" - "if" - "unless" - "else" - "do" - "loop" - "below" - "in" - "from" - "across" - "repeat" - "being" - "into" - "with" - "as" - "while" - "until" - "return" - "initially" -] @function.macro -"=" @operator - -(include_reader_macro) @symbol -["#C" "#c"] @number - -[(kwd_lit) (self_referential_reader_macro)] @symbol - -(package_lit - package: (_) @namespace) -"cl" @namespace - -(str_lit) @string - -(num_lit) @number - -((sym_lit) @boolean (#match? @boolean "^(t|T)$")) - -(nil_lit) @constant.builtin - -(comment) @comment - -;; dynamic variables -((sym_lit) @variable.builtin - (#match? @variable.builtin "^[*].+[*]$")) - -;; quote -"'" @string.escape -(format_specifier) @string.escape -(quoting_lit) @string.escape - -;; syntax quote -"`" @string.escape -"," @string.escape -",@" @string.escape -(syn_quoting_lit) @string.escape -(unquoting_lit) @none -(unquote_splicing_lit) @none - - -["(" ")"] @punctuation.bracket - -(block_comment) @comment - - -(with_clause - type: (_) @type) -(for_clause - type: (_) @type) - -;; defun-like things -(list_lit - . - (sym_lit) @function.macro - . - (sym_lit) @function - (#eq? @function.macro "deftest")) - -;;; Macros and Special Operators -(list_lit - . - (sym_lit) @function.macro - ;; For a complete and more efficient version install theHamsta/nvim-treesitter-commonlisp - (#any-of? @function.macro - "let" - "function" - "the" - "unwind-protect" - "labels" - "flet" - "tagbody" - "go" - "symbol-macrolet" - "symbol-macrolet" - "progn" - "prog1" - "error" - "or" - "and" - "defvar" - "defparameter" - "in-package" - "defpackage" - "case" - "ecase" - "typecase" - "etypecase" - "defstruct" - "defclass" - "if" - "when" - "unless" - "cond" - "switch" - "declaim" - "optimize")) - -;; constant -((sym_lit) @constant - (#match? @constant "^[+].+[+]$")) - -(var_quoting_lit - marker: "#'" @symbol - value: (_) @symbol) - -["#" "#p" "#P"] @symbol - -(list_lit - . - (sym_lit) @function.builtin - ;; For a complete and more efficient version install theHamsta/nvim-treesitter-commonlisp - (#any-of? @function.builtin - "mapcar" - "reduce" - "remove-if-not" - "cons" - "car" - "last" - "nth" - "equal" - "cdr" - "first" - "rest" - "format")) - -(list_lit - . - (sym_lit) @operator - (#match? @operator "^([+*-+=<>]|<=|>=|/=)$")) - - -((sym_lit) @symbol -(#match? @symbol "^[&]")) - -[(array_dimension) "#0A" "#0a"] @number - -(char_lit) @character diff --git a/crates/zed/src/languages/installation.rs b/crates/zed/src/languages/installation.rs index 2e5705d5a0..40edbb88d7 100644 --- a/crates/zed/src/languages/installation.rs +++ b/crates/zed/src/languages/installation.rs @@ -35,18 +35,6 @@ pub(crate) struct GithubReleaseAsset { pub browser_download_url: String, } -#[derive(Deserialize)] -pub(crate) struct CodebergReleaseAsset { - pub name: String, - pub assets: Vec, -} - -#[derive(Deserialize)] -pub(crate) struct CodebergRelease { - pub name: String, - pub browser_download_url: String, -} - pub async fn npm_package_latest_version(name: &str) -> Result { let output = smol::process::Command::new("npm") .args(["info", name, "--json"]) @@ -115,12 +103,3 @@ pub(crate) async fn latest_github_release( serde_json::from_slice(body.as_slice()).context("error deserializing latest release")?; Ok(release) } - -// pub(crate) async fn latest_codeberg_release( -// repo_name_with_owner: &str, -// http: Arc, -// ) -> anyhow::Result { -// let mut response = http.get(uri, body, follow_redirects); - -// bail!("unimplemented :("); -// } diff --git a/crates/zed/src/languages/racket/brackets.scm b/crates/zed/src/languages/racket/brackets.scm new file mode 100644 index 0000000000..191fd9c084 --- /dev/null +++ b/crates/zed/src/languages/racket/brackets.scm @@ -0,0 +1,3 @@ +("(" @open ")" @close) +("[" @open "]" @close) +("{" @open "}" @close) diff --git a/crates/zed/src/languages/racket/config.toml b/crates/zed/src/languages/racket/config.toml index 33dd539c41..0177e6ef6d 100644 --- a/crates/zed/src/languages/racket/config.toml +++ b/crates/zed/src/languages/racket/config.toml @@ -3,7 +3,7 @@ path_suffixes = ["rkt"] line_comment = "; " autoclose_before = "])" brackets = [ - { start = "[", end = "]", close = true, newline = true }, - { start = "(", end = ")", close = true, newline = true }, - { start = "'", end = "'", close = false, newline = false }, + { start = "[", end = "]", close = true, newline = false }, + { start = "(", end = ")", close = true, newline = false }, + { start = "\"", end = "\"", close = true, newline = false }, ] diff --git a/crates/zed/src/languages/racket/folds.scm b/crates/zed/src/languages/racket/folds.scm deleted file mode 100644 index d85ef45cfb..0000000000 --- a/crates/zed/src/languages/racket/folds.scm +++ /dev/null @@ -1,3 +0,0 @@ -; Copied from nvim: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/racket/folds.scm - -(program (list) @fold) \ No newline at end of file diff --git a/crates/zed/src/languages/racket/highlights.scm b/crates/zed/src/languages/racket/highlights.scm index b410479529..9eeeb1d4ea 100644 --- a/crates/zed/src/languages/racket/highlights.scm +++ b/crates/zed/src/languages/racket/highlights.scm @@ -1,140 +1,40 @@ -;; Copied from nvim: https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/master/queries/racket/highlights.scm - -;; A highlight query can override the highlights queries before it. -;; So the order is important. -;; We should highlight general rules, then highlight special forms. - -;;------------------------------------------------------------------;; -;; Basic highlights ;; -;;------------------------------------------------------------------;; - -(ERROR) @error - -;; basic ;; - -(number) @number -(character) @character -(boolean) @boolean -(keyword) @symbol - -;; string ;; +["(" ")" "[" "]" "{" "}"] @punctuation.bracket [(string) (here_string) (byte_string)] @string - -(escape_sequence) @string.escape - -(regex) @string.regex - -;; comment ;; +(regex) @string.special +(escape_sequence) @escape [(comment) (block_comment) (sexp_comment)] @comment -;; symbol ;; - (symbol) @variable -((symbol) @comment - (#match? @comment "^#[cC][iIsS]$")) - -;; extension ;; +(number) @number +(character) @constant.builtin +(boolean) @constant.builtin +(keyword) @constant +(quote . (symbol)) @constant (extension) @keyword (lang_name) @variable.builtin -;; quote ;; - -(quote) @symbol - -;; list ;; - -["(" ")" "[" "]" "{" "}"] @punctuation.bracket - -;; procedure ;; +((symbol) @operator + (#match? @operator "^(\\+|-|\\*|/|=|>|<|>=|<=)$")) (list - . - (symbol) @function) - -;;------------------------------------------------------------------;; -;; Builtin highlights ;; -;;------------------------------------------------------------------;; - -;; The following lists are generated by a racket script: -;; https://gist.github.com/6cdh/65619e761753eb4166d15185a6236040 -;; Don't edit them directly. - -;; keyword ;; + . + (symbol) @function) (list . (symbol) @keyword - (#any-of? @keyword - "#%app" "#%datum" "#%declare" "#%expression" "#%module-begin" "#%plain-app" "#%plain-lambda" "#%plain-module-begin" "#%printing-module-begin" "#%provide" "#%require" "#%stratified-body" "#%top" "#%top-interaction" "#%variable-reference" "->" "->*" "->*m" "->d" "->dm" "->i" "->m" "..." ":do-in" "==" "=>" "_" "absent" "abstract" "all-defined-out" "all-from-out" "and" "any" "augment" "augment*" "augment-final" "augment-final*" "augride" "augride*" "begin" "begin-for-syntax" "begin0" "case" "case->" "case->m" "case-lambda" "class" "class*" "class-field-accessor" "class-field-mutator" "class/c" "class/derived" "combine-in" "combine-out" "command-line" "compound-unit" "compound-unit/infer" "cond" "cons/dc" "contract" "contract-out" "contract-pos/neg-doubling" "contract-struct" "contracted" "current-contract-region" "define" "define-compound-unit" "define-compound-unit/infer" "define-contract-struct" "define-custom-hash-types" "define-custom-set-types" "define-for-syntax" "define-local-member-name" "define-logger" "define-match-expander" "define-member-name" "define-module-boundary-contract" "define-namespace-anchor" "define-opt/c" "define-sequence-syntax" "define-serializable-class" "define-serializable-class*" "define-signature" "define-signature-form" "define-splicing-for-clause-syntax" "define-struct" "define-struct/contract" "define-struct/derived" "define-syntax" "define-syntax-rule" "define-syntaxes" "define-unit" "define-unit-binding" "define-unit-from-context" "define-unit/contract" "define-unit/new-import-export" "define-unit/s" "define-values" "define-values-for-export" "define-values-for-syntax" "define-values/invoke-unit" "define-values/invoke-unit/infer" "define/augment" "define/augment-final" "define/augride" "define/contract" "define/final-prop" "define/match" "define/overment" "define/override" "define/override-final" "define/private" "define/public" "define/public-final" "define/pubment" "define/subexpression-pos-prop" "define/subexpression-pos-prop/name" "delay" "delay/idle" "delay/name" "delay/strict" "delay/sync" "delay/thread" "do" "else" "except" "except-in" "except-out" "export" "extends" "failure-cont" "field" "field-bound?" "file" "flat-murec-contract" "flat-rec-contract" "for" "for*" "for*/and" "for*/async" "for*/first" "for*/fold" "for*/fold/derived" "for*/foldr" "for*/foldr/derived" "for*/hash" "for*/hasheq" "for*/hasheqv" "for*/last" "for*/list" "for*/lists" "for*/mutable-set" "for*/mutable-seteq" "for*/mutable-seteqv" "for*/or" "for*/product" "for*/set" "for*/seteq" "for*/seteqv" "for*/stream" "for*/sum" "for*/vector" "for*/weak-set" "for*/weak-seteq" "for*/weak-seteqv" "for-label" "for-meta" "for-space" "for-syntax" "for-template" "for/and" "for/async" "for/first" "for/fold" "for/fold/derived" "for/foldr" "for/foldr/derived" "for/hash" "for/hasheq" "for/hasheqv" "for/last" "for/list" "for/lists" "for/mutable-set" "for/mutable-seteq" "for/mutable-seteqv" "for/or" "for/product" "for/set" "for/seteq" "for/seteqv" "for/stream" "for/sum" "for/vector" "for/weak-set" "for/weak-seteq" "for/weak-seteqv" "gen:custom-write" "gen:dict" "gen:equal+hash" "gen:set" "gen:stream" "generic" "get-field" "hash/dc" "if" "implies" "import" "include" "include-at/relative-to" "include-at/relative-to/reader" "include/reader" "inherit" "inherit-field" "inherit/inner" "inherit/super" "init" "init-depend" "init-field" "init-rest" "inner" "inspect" "instantiate" "interface" "interface*" "invariant-assertion" "invoke-unit" "invoke-unit/infer" "lambda" "lazy" "let" "let*" "let*-values" "let-syntax" "let-syntaxes" "let-values" "let/cc" "let/ec" "letrec" "letrec-syntax" "letrec-syntaxes" "letrec-syntaxes+values" "letrec-values" "lib" "link" "local" "local-require" "log-debug" "log-error" "log-fatal" "log-info" "log-warning" "match" "match*" "match*/derived" "match-define" "match-define-values" "match-lambda" "match-lambda*" "match-lambda**" "match-let" "match-let*" "match-let*-values" "match-let-values" "match-letrec" "match-letrec-values" "match/derived" "match/values" "member-name-key" "mixin" "module" "module*" "module+" "nand" "new" "nor" "object-contract" "object/c" "only" "only-in" "only-meta-in" "only-space-in" "open" "opt/c" "or" "overment" "overment*" "override" "override*" "override-final" "override-final*" "parameterize" "parameterize*" "parameterize-break" "parametric->/c" "place" "place*" "place/context" "planet" "prefix" "prefix-in" "prefix-out" "private" "private*" "prompt-tag/c" "prop:dict/contract" "protect-out" "provide" "provide-signature-elements" "provide/contract" "public" "public*" "public-final" "public-final*" "pubment" "pubment*" "quasiquote" "quasisyntax" "quasisyntax/loc" "quote" "quote-syntax" "quote-syntax/prune" "recontract-out" "recursive-contract" "relative-in" "rename" "rename-in" "rename-inner" "rename-out" "rename-super" "require" "send" "send*" "send+" "send-generic" "send/apply" "send/keyword-apply" "set!" "set!-values" "set-field!" "shared" "stream" "stream*" "stream-cons" "stream-lazy" "struct" "struct*" "struct-copy" "struct-field-index" "struct-guard/c" "struct-out" "struct/c" "struct/contract" "struct/ctc" "struct/dc" "struct/derived" "submod" "super" "super-instantiate" "super-make-object" "super-new" "syntax" "syntax-case" "syntax-case*" "syntax-id-rules" "syntax-rules" "syntax/loc" "tag" "this" "this%" "thunk" "thunk*" "time" "unconstrained-domain->" "unit" "unit-from-context" "unit/c" "unit/new-import-export" "unit/s" "unless" "unquote" "unquote-splicing" "unsyntax" "unsyntax-splicing" "values/drop" "when" "with-continuation-mark" "with-contract" "with-contract-continuation-mark" "with-handlers" "with-handlers*" "with-method" "with-syntax" "~?" "~@" "λ" + (#match? @keyword + "^(unit-from-context|for/last|syntax-case|match-let\\*-values|define-for-syntax|define/subexpression-pos-prop|set-field!|class-field-accessor|invoke-unit|#%stratified-body|for\\*/and|for\\*/weak-set|flat-rec-contract|for\\*/stream|planet|for/mutable-seteqv|log-error|delay|#%declare|prop:dict/contract|->d|lib|override\\*|define-local-member-name|send-generic|for\\*/hasheq|define-syntax|submod|except|include-at/relative-to/reader|public\\*|define-member-name|define/public|let\\*|for/and|for\\*/first|for|delay/strict|define-values-for-export|==|match-define-values|for/weak-seteq|for\\*/async|for/stream|for/weak-seteqv|set!-values|lambda|for\\*/product|augment-final\\*|pubment\\*|command-line|contract|case|struct-field-index|contract-struct|unless|for/hasheq|for/seteqv|with-method|define-values-for-syntax|for-template|pubment|for\\*/list|syntax-case\\*|init-field|define-serializable-class|=>|for/foldr/derived|letrec-syntaxes|overment\\*|unquote-splicing|_|inherit-field|for\\*|stream-lazy|match-lambda\\*|contract-pos/neg-doubling|unit/c|match-define|for\\*/set|unit/s|nor|#%expression|class/c|this%|place/context|super-make-object|when|set!|parametric->/c|syntax-id-rules|include/reader|compound-unit|override-final|get-field|gen:dict|for\\*/seteqv|for\\*/hash|#%provide|combine-out|link|with-contract-continuation-mark|define-struct/derived|stream\\*|λ|rename-out|define-serializable-class\\*|augment|define/augment|let|define-signature-form|letrec-syntax|abstract|define-namespace-anchor|#%module-begin|#%top-interaction|for\\*/weak-seteqv|do|define/subexpression-pos-prop/name|absent|send/apply|with-handlers\\*|all-from-out|provide-signature-elements|gen:stream|define/override-final|for\\*/mutable-seteqv|rename|quasisyntax/loc|instantiate|for/list|extends|include-at/relative-to|mixin|define/pubment|#%plain-lambda|except-out|#%plain-module-begin|init|for\\*/last|relative-in|define-unit/new-import-export|->dm|member-name-key|nand|interface\\*|struct|define/override|else|define/augment-final|failure-cont|open|log-info|define/final-prop|all-defined-out|for/sum|for\\*/sum|recursive-contract|define|define-logger|match\\*|log-debug|rename-inner|->|struct/derived|unit|class\\*|prefix-out|any|define/overment|define-signature|match-letrec-values|let-syntaxes|for/mutable-set|define/match|cond|super-instantiate|define-contract-struct|import|hash/dc|define-custom-set-types|public-final|for/vector|for-label|prefix-in|for\\*/foldr/derived|define-unit-binding|object-contract|syntax-rules|augride|for\\*/mutable-seteq|quasisyntax|inner|for-syntax|overment|send/keyword-apply|generic|let\\*-values|->m|define-values|struct-copy|init-depend|struct/ctc|match-lambda|#%printing-module-begin|match\\*/derived|case->m|this|file|stream-cons|inspect|field|for/weak-set|struct\\*|gen:custom-write|thunk\\*|combine-in|unquote|for/lists|define/private|for\\*/foldr|define-unit/s|with-continuation-mark|begin|prefix|quote-syntax/prune|object/c|interface|match/derived|for/hasheqv|current-contract-region|define-compound-unit|override|define/public-final|recontract-out|let/cc|augride\\*|inherit|send|define-values/invoke-unit|for/mutable-seteq|#%datum|for/first|match-let\\*|invoke-unit/infer|define/contract|syntax/loc|for\\*/hasheqv|define-sequence-syntax|let/ec|for/product|for\\*/fold/derived|define-syntax-rule|lazy|unconstrained-domain->|augment-final|private|class|define-splicing-for-clause-syntax|for\\*/fold|prompt-tag/c|contract-out|match/values|public-final\\*|case-lambda|for/fold|unsyntax|for/set|begin0|#%require|time|public|define-struct|include|define-values/invoke-unit/infer|only-space-in|struct/c|only-meta-in|unit/new-import-export|place|begin-for-syntax|shared|inherit/super|quote|for/or|struct/contract|export|inherit/inner|struct-out|let-syntax|augment\\*|for\\*/vector|rename-in|match-let|define-unit|:do-in|~@|for\\*/weak-seteq|private\\*|and|except-in|log-fatal|gen:equal\\+hash|provide|require|thunk|invariant-assertion|define-match-expander|init-rest|->\\*|class/derived|super-new|for/fold/derived|for\\*/mutable-set|match-lambda\\*\\*|only|with-contract|~\\?|opt/c|let-values|delay/thread|->i|for/foldr|for-meta|only-in|send\\+|\\.\\.\\.|struct-guard/c|->\\*m|gen:set|struct/dc|define-syntaxes|if|parameterize|module\\*|module|send\\*|#%variable-reference|compound-unit/infer|#%plain-app|for/hash|contracted|case->|match|for\\*/lists|#%app|letrec-values|log-warning|super|define/augride|local-require|provide/contract|define-struct/contract|match-let-values|quote-syntax|for\\*/seteq|define-compound-unit/infer|parameterize\\*|values/drop|for/seteq|tag|stream|delay/idle|module\\+|define-custom-hash-types|cons/dc|define-module-boundary-contract|or|protect-out|define-opt/c|implies|letrec-syntaxes\\+values|for\\*/or|unsyntax-splicing|override-final\\*|for/async|parameterize-break|syntax|place\\*|for-space|quasiquote|with-handlers|delay/sync|define-unit-from-context|match-letrec|#%top|define-unit/contract|delay/name|new|field-bound\\?|letrec|class-field-mutator|with-syntax|flat-murec-contract|rename-super|local)$" )) -;; builtin procedures - -((symbol) @function.builtin - (#any-of? @function.builtin - "*" "*list/c" "+" "-" "/" "<" "" ">/c" ">=" ">=/c" "abort-current-continuation" "abs" "absolute-path?" "acos" "add-between" "add1" "alarm-evt" "and/c" "andmap" "angle" "any/c" "append" "append*" "append-map" "apply" "argmax" "argmin" "arithmetic-shift" "arity-at-least" "arity-at-least-value" "arity-at-least?" "arity-checking-wrapper" "arity-includes?" "arity=?" "arrow-contract-info" "arrow-contract-info-accepts-arglist" "arrow-contract-info-chaperone-procedure" "arrow-contract-info-check-first-order" "arrow-contract-info?" "asin" "assert-unreachable" "assf" "assoc" "assq" "assv" "atan" "bad-number-of-results" "banner" "base->-doms/c" "base->-rngs/c" "base->?" "between/c" "bitwise-and" "bitwise-bit-field" "bitwise-bit-set?" "bitwise-ior" "bitwise-not" "bitwise-xor" "blame-add-car-context" "blame-add-cdr-context" "blame-add-context" "blame-add-missing-party" "blame-add-nth-arg-context" "blame-add-range-context" "blame-add-unknown-context" "blame-context" "blame-contract" "blame-fmt->-string" "blame-missing-party?" "blame-negative" "blame-original?" "blame-positive" "blame-replace-negative" "blame-replaced-negative?" "blame-source" "blame-swap" "blame-swapped?" "blame-update" "blame-value" "blame?" "boolean=?" "boolean?" "bound-identifier=?" "box" "box-cas!" "box-immutable" "box-immutable/c" "box/c" "box?" "break-enabled" "break-parameterization?" "break-thread" "build-chaperone-contract-property" "build-compound-type-name" "build-contract-property" "build-flat-contract-property" "build-list" "build-path" "build-path/convention-type" "build-string" "build-vector" "byte-pregexp" "byte-pregexp?" "byte-ready?" "byte-regexp" "byte-regexp?" "byte?" "bytes" "bytes->immutable-bytes" "bytes->list" "bytes->path" "bytes->path-element" "bytes->string/latin-1" "bytes->string/locale" "bytes->string/utf-8" "bytes-append" "bytes-append*" "bytes-close-converter" "bytes-convert" "bytes-convert-end" "bytes-converter?" "bytes-copy" "bytes-copy!" "bytes-environment-variable-name?" "bytes-fill!" "bytes-join" "bytes-length" "bytes-no-nuls?" "bytes-open-converter" "bytes-ref" "bytes-set!" "bytes-utf-8-index" "bytes-utf-8-length" "bytes-utf-8-ref" "bytes?" "bytes?" "caaaar" "caaadr" "caaar" "caadar" "caaddr" "caadr" "caar" "cadaar" "cadadr" "cadar" "caddar" "cadddr" "caddr" "cadr" "call-in-continuation" "call-in-nested-thread" "call-with-atomic-output-file" "call-with-break-parameterization" "call-with-composable-continuation" "call-with-continuation-barrier" "call-with-continuation-prompt" "call-with-current-continuation" "call-with-default-reading-parameterization" "call-with-escape-continuation" "call-with-exception-handler" "call-with-file-lock/timeout" "call-with-immediate-continuation-mark" "call-with-input-bytes" "call-with-input-file" "call-with-input-file*" "call-with-input-string" "call-with-output-bytes" "call-with-output-file" "call-with-output-file*" "call-with-output-string" "call-with-parameterization" "call-with-semaphore" "call-with-semaphore/enable-break" "call-with-values" "call/cc" "call/ec" "car" "cartesian-product" "cdaaar" "cdaadr" "cdaar" "cdadar" "cdaddr" "cdadr" "cdar" "cddaar" "cddadr" "cddar" "cdddar" "cddddr" "cdddr" "cddr" "cdr" "ceiling" "channel-get" "channel-put" "channel-put-evt" "channel-put-evt?" "channel-try-get" "channel/c" "channel?" "chaperone-box" "chaperone-channel" "chaperone-continuation-mark-key" "chaperone-contract-property?" "chaperone-contract?" "chaperone-evt" "chaperone-hash" "chaperone-hash-set" "chaperone-of?" "chaperone-procedure" "chaperone-procedure*" "chaperone-prompt-tag" "chaperone-struct" "chaperone-struct-type" "chaperone-vector" "chaperone-vector*" "chaperone?" "char->integer" "char-alphabetic?" "char-blank?" "char-ci<=?" "char-ci=?" "char-ci>?" "char-downcase" "char-foldcase" "char-general-category" "char-graphic?" "char-in" "char-in/c" "char-iso-control?" "char-lower-case?" "char-numeric?" "char-punctuation?" "char-ready?" "char-symbolic?" "char-title-case?" "char-titlecase" "char-upcase" "char-upper-case?" "char-utf-8-length" "char-whitespace?" "char<=?" "char=?" "char>?" "char?" "check-duplicate-identifier" "check-duplicates" "checked-procedure-check-and-extract" "choice-evt" "class->interface" "class-info" "class-seal" "class-unseal" "class?" "cleanse-path" "close-input-port" "close-output-port" "coerce-chaperone-contract" "coerce-chaperone-contracts" "coerce-contract" "coerce-contract/f" "coerce-contracts" "coerce-flat-contract" "coerce-flat-contracts" "collect-garbage" "collection-file-path" "collection-path" "combinations" "combine-output" "compile" "compile-allow-set!-undefined" "compile-context-preservation-enabled" "compile-enforce-module-constants" "compile-syntax" "compile-target-machine?" "compiled-expression-recompile" "compiled-expression?" "compiled-module-expression?" "complete-path?" "complex?" "compose" "compose1" "conjoin" "conjugate" "cons" "cons/c" "cons?" "const" "continuation-mark-key/c" "continuation-mark-key?" "continuation-mark-set->context" "continuation-mark-set->iterator" "continuation-mark-set->list" "continuation-mark-set->list*" "continuation-mark-set-first" "continuation-mark-set?" "continuation-marks" "continuation-prompt-available?" "continuation-prompt-tag?" "continuation?" "contract-custom-write-property-proc" "contract-equivalent?" "contract-exercise" "contract-first-order" "contract-first-order-passes?" "contract-late-neg-projection" "contract-name" "contract-proc" "contract-projection" "contract-property?" "contract-random-generate" "contract-random-generate-env?" "contract-random-generate-fail?" "contract-random-generate-get-current-environment" "contract-random-generate-stash" "contract-random-generate/choose" "contract-stronger?" "contract-struct-exercise" "contract-struct-generate" "contract-struct-late-neg-projection" "contract-struct-list-contract?" "contract-val-first-projection" "contract?" "convert-stream" "copy-directory/files" "copy-file" "copy-port" "cos" "cosh" "count" "current-blame-format" "current-break-parameterization" "current-code-inspector" "current-command-line-arguments" "current-compile" "current-compile-realm" "current-compile-target-machine" "current-compiled-file-roots" "current-continuation-marks" "current-custodian" "current-directory" "current-directory-for-user" "current-drive" "current-environment-variables" "current-error-message-adjuster" "current-error-port" "current-eval" "current-evt-pseudo-random-generator" "current-force-delete-permissions" "current-future" "current-gc-milliseconds" "current-get-interaction-evt" "current-get-interaction-input-port" "current-inexact-milliseconds" "current-inexact-monotonic-milliseconds" "current-input-port" "current-inspector" "current-library-collection-links" "current-library-collection-paths" "current-load" "current-load-extension" "current-load-relative-directory" "current-load/use-compiled" "current-locale" "current-logger" "current-memory-use" "current-milliseconds" "current-module-declare-name" "current-module-declare-source" "current-module-name-resolver" "current-module-path-for-load" "current-namespace" "current-output-port" "current-parameterization" "current-plumber" "current-preserved-thread-cell-values" "current-print" "current-process-milliseconds" "current-prompt-read" "current-pseudo-random-generator" "current-read-interaction" "current-reader-guard" "current-readtable" "current-seconds" "current-security-guard" "current-subprocess-custodian-mode" "current-subprocess-keep-file-descriptors" "current-thread" "current-thread-group" "current-thread-initial-stack-size" "current-write-relative-directory" "curry" "curryr" "custodian-box-value" "custodian-box?" "custodian-limit-memory" "custodian-managed-list" "custodian-memory-accounting-available?" "custodian-require-memory" "custodian-shut-down?" "custodian-shutdown-all" "custodian?" "custom-print-quotable-accessor" "custom-print-quotable?" "custom-write-accessor" "custom-write-property-proc" "custom-write?" "date" "date*" "date*-nanosecond" "date*-time-zone-name" "date*?" "date-day" "date-dst?" "date-hour" "date-minute" "date-month" "date-second" "date-time-zone-offset" "date-week-day" "date-year" "date-year-day" "date?" "datum->syntax" "datum-intern-literal" "default-continuation-prompt-tag" "degrees->radians" "delete-directory" "delete-directory/files" "delete-file" "denominator" "dict->list" "dict-can-functional-set?" "dict-can-remove-keys?" "dict-clear" "dict-clear!" "dict-copy" "dict-count" "dict-empty?" "dict-for-each" "dict-has-key?" "dict-implements/c" "dict-implements?" "dict-iter-contract" "dict-iterate-first" "dict-iterate-key" "dict-iterate-next" "dict-iterate-value" "dict-key-contract" "dict-keys" "dict-map" "dict-mutable?" "dict-ref" "dict-ref!" "dict-remove" "dict-remove!" "dict-set" "dict-set!" "dict-set*" "dict-set*!" "dict-update" "dict-update!" "dict-value-contract" "dict-values" "dict?" "directory-exists?" "directory-list" "disjoin" "display" "display-lines" "display-lines-to-file" "display-to-file" "displayln" "double-flonum?" "drop" "drop-common-prefix" "drop-right" "dropf" "dropf-right" "dump-memory-stats" "dup-input-port" "dup-output-port" "dynamic->*" "dynamic-get-field" "dynamic-object/c" "dynamic-place" "dynamic-place*" "dynamic-require" "dynamic-require-for-syntax" "dynamic-send" "dynamic-set-field!" "dynamic-wind" "eighth" "empty?" "environment-variables-copy" "environment-variables-names" "environment-variables-ref" "environment-variables-set!" "environment-variables?" "eof-evt" "eof-object?" "ephemeron-value" "ephemeron?" "eprintf" "eq-contract-val" "eq-contract?" "eq-hash-code" "eq?" "equal-contract-val" "equal-contract?" "equal-hash-code" "equal-secondary-hash-code" "equal?" "equal?/recur" "eqv-hash-code" "eqv?" "error" "error-contract->adjusted-string" "error-display-handler" "error-escape-handler" "error-message->adjusted-string" "error-print-context-length" "error-print-source-location" "error-print-width" "error-syntax->string-handler" "error-value->string-handler" "eval" "eval-jit-enabled" "eval-syntax" "even?" "evt/c" "evt?" "exact->inexact" "exact-ceiling" "exact-floor" "exact-integer?" "exact-nonnegative-integer?" "exact-positive-integer?" "exact-round" "exact-truncate" "exact?" "executable-yield-handler" "exit" "exit-handler" "exn" "exn-continuation-marks" "exn-message" "exn:break" "exn:break-continuation" "exn:break:hang-up" "exn:break:hang-up?" "exn:break:terminate" "exn:break:terminate?" "exn:break?" "exn:fail" "exn:fail:contract" "exn:fail:contract:arity" "exn:fail:contract:arity?" "exn:fail:contract:blame" "exn:fail:contract:blame-object" "exn:fail:contract:blame?" "exn:fail:contract:continuation" "exn:fail:contract:continuation?" "exn:fail:contract:divide-by-zero" "exn:fail:contract:divide-by-zero?" "exn:fail:contract:non-fixnum-result" "exn:fail:contract:non-fixnum-result?" "exn:fail:contract:variable" "exn:fail:contract:variable-id" "exn:fail:contract:variable?" "exn:fail:contract?" "exn:fail:filesystem" "exn:fail:filesystem:errno" "exn:fail:filesystem:errno-errno" "exn:fail:filesystem:errno?" "exn:fail:filesystem:exists" "exn:fail:filesystem:exists?" "exn:fail:filesystem:missing-module" "exn:fail:filesystem:missing-module-path" "exn:fail:filesystem:missing-module?" "exn:fail:filesystem:version" "exn:fail:filesystem:version?" "exn:fail:filesystem?" "exn:fail:network" "exn:fail:network:errno" "exn:fail:network:errno-errno" "exn:fail:network:errno?" "exn:fail:network?" "exn:fail:object" "exn:fail:object?" "exn:fail:out-of-memory" "exn:fail:out-of-memory?" "exn:fail:read" "exn:fail:read-srclocs" "exn:fail:read:eof" "exn:fail:read:eof?" "exn:fail:read:non-char" "exn:fail:read:non-char?" "exn:fail:read?" "exn:fail:syntax" "exn:fail:syntax-exprs" "exn:fail:syntax:missing-module" "exn:fail:syntax:missing-module-path" "exn:fail:syntax:missing-module?" "exn:fail:syntax:unbound" "exn:fail:syntax:unbound?" "exn:fail:syntax?" "exn:fail:unsupported" "exn:fail:unsupported?" "exn:fail:user" "exn:fail:user?" "exn:fail?" "exn:misc:match?" "exn:missing-module-accessor" "exn:missing-module?" "exn:srclocs-accessor" "exn:srclocs?" "exn?" "exp" "expand" "expand-once" "expand-syntax" "expand-syntax-once" "expand-syntax-to-top-form" "expand-to-top-form" "expand-user-path" "explode-path" "expt" "false?" "field-names" "fifth" "file->bytes" "file->bytes-lines" "file->lines" "file->list" "file->string" "file->value" "file-exists?" "file-name-from-path" "file-or-directory-identity" "file-or-directory-modify-seconds" "file-or-directory-permissions" "file-or-directory-stat" "file-or-directory-type" "file-position" "file-position*" "file-size" "file-stream-buffer-mode" "file-stream-port?" "file-truncate" "filename-extension" "filesystem-change-evt" "filesystem-change-evt-cancel" "filesystem-change-evt?" "filesystem-root-list" "filter" "filter-map" "filter-not" "filter-read-input-port" "find-compiled-file-roots" "find-executable-path" "find-files" "find-library-collection-links" "find-library-collection-paths" "find-relative-path" "find-system-path" "findf" "first" "first-or/c" "fixnum?" "flat-contract" "flat-contract-predicate" "flat-contract-property?" "flat-contract-with-explanation" "flat-contract?" "flat-named-contract" "flatten" "floating-point-bytes->real" "flonum?" "floor" "flush-output" "fold-files" "foldl" "foldr" "for-each" "force" "format" "fourth" "fprintf" "free-identifier=?" "free-label-identifier=?" "free-template-identifier=?" "free-transformer-identifier=?" "fsemaphore-count" "fsemaphore-post" "fsemaphore-try-wait?" "fsemaphore-wait" "fsemaphore?" "future" "future?" "futures-enabled?" "gcd" "generate-member-key" "generate-temporaries" "generic-set?" "generic?" "gensym" "get-output-bytes" "get-output-string" "get-preference" "get/build-late-neg-projection" "get/build-val-first-projection" "getenv" "global-port-print-handler" "group-by" "guard-evt" "handle-evt" "handle-evt?" "has-blame?" "has-contract?" "hash" "hash->list" "hash-clear" "hash-clear!" "hash-copy" "hash-copy-clear" "hash-count" "hash-empty?" "hash-ephemeron?" "hash-eq?" "hash-equal?" "hash-eqv?" "hash-for-each" "hash-has-key?" "hash-iterate-first" "hash-iterate-key" "hash-iterate-key+value" "hash-iterate-next" "hash-iterate-pair" "hash-iterate-value" "hash-keys" "hash-keys-subset?" "hash-map" "hash-placeholder?" "hash-ref" "hash-ref!" "hash-ref-key" "hash-remove" "hash-remove!" "hash-set" "hash-set!" "hash-set*" "hash-set*!" "hash-strong?" "hash-update" "hash-update!" "hash-values" "hash-weak?" "hash/c" "hash?" "hasheq" "hasheqv" "identifier-binding" "identifier-binding-portal-syntax" "identifier-binding-symbol" "identifier-distinct-binding" "identifier-label-binding" "identifier-prune-lexical-context" "identifier-prune-to-source-module" "identifier-remove-from-definition-context" "identifier-template-binding" "identifier-transformer-binding" "identifier?" "identity" "if/c" "imag-part" "immutable?" "impersonate-box" "impersonate-channel" "impersonate-continuation-mark-key" "impersonate-hash" "impersonate-hash-set" "impersonate-procedure" "impersonate-procedure*" "impersonate-prompt-tag" "impersonate-struct" "impersonate-vector" "impersonate-vector*" "impersonator-contract?" "impersonator-ephemeron" "impersonator-of?" "impersonator-property-accessor-procedure?" "impersonator-property?" "impersonator?" "implementation?" "implementation?/c" "in-bytes" "in-bytes-lines" "in-combinations" "in-cycle" "in-dict" "in-dict-keys" "in-dict-pairs" "in-dict-values" "in-directory" "in-ephemeron-hash" "in-ephemeron-hash-keys" "in-ephemeron-hash-pairs" "in-ephemeron-hash-values" "in-hash" "in-hash-keys" "in-hash-pairs" "in-hash-values" "in-immutable-hash" "in-immutable-hash-keys" "in-immutable-hash-pairs" "in-immutable-hash-values" "in-immutable-set" "in-inclusive-range" "in-indexed" "in-input-port-bytes" "in-input-port-chars" "in-lines" "in-list" "in-mlist" "in-mutable-hash" "in-mutable-hash-keys" "in-mutable-hash-pairs" "in-mutable-hash-values" "in-mutable-set" "in-naturals" "in-parallel" "in-permutations" "in-port" "in-producer" "in-range" "in-sequences" "in-set" "in-slice" "in-stream" "in-string" "in-syntax" "in-value" "in-values*-sequence" "in-values-sequence" "in-vector" "in-weak-hash" "in-weak-hash-keys" "in-weak-hash-pairs" "in-weak-hash-values" "in-weak-set" "inclusive-range" "index-of" "index-where" "indexes-of" "indexes-where" "inexact->exact" "inexact-real?" "inexact?" "infinite?" "input-port-append" "input-port?" "inspector-superior?" "inspector?" "instanceof/c" "integer->char" "integer->integer-bytes" "integer-bytes->integer" "integer-in" "integer-length" "integer-sqrt" "integer-sqrt/remainder" "integer?" "interface->method-names" "interface-extension?" "interface?" "internal-definition-context-add-scopes" "internal-definition-context-binding-identifiers" "internal-definition-context-introduce" "internal-definition-context-seal" "internal-definition-context-splice-binding-identifier" "internal-definition-context?" "is-a?" "is-a?/c" "keyword->string" "keyword-apply" "keyword-apply/dict" "keywordbytes" "list->mutable-set" "list->mutable-seteq" "list->mutable-seteqv" "list->set" "list->seteq" "list->seteqv" "list->string" "list->vector" "list->weak-set" "list->weak-seteq" "list->weak-seteqv" "list-contract?" "list-prefix?" "list-ref" "list-set" "list-tail" "list-update" "list/c" "list?" "listen-port-number?" "listof" "load" "load-extension" "load-on-demand-enabled" "load-relative" "load-relative-extension" "load/cd" "load/use-compiled" "local-expand" "local-expand/capture-lifts" "local-transformer-expand" "local-transformer-expand/capture-lifts" "locale-string-encoding" "log" "log-all-levels" "log-level-evt" "log-level?" "log-max-level" "log-message" "log-receiver?" "logger-name" "logger?" "magnitude" "make-arity-at-least" "make-base-empty-namespace" "make-base-namespace" "make-bytes" "make-channel" "make-chaperone-contract" "make-continuation-mark-key" "make-continuation-prompt-tag" "make-contract" "make-custodian" "make-custodian-box" "make-custom-hash" "make-custom-hash-types" "make-custom-set" "make-custom-set-types" "make-date" "make-date*" "make-derived-parameter" "make-directory" "make-directory*" "make-do-sequence" "make-empty-namespace" "make-environment-variables" "make-ephemeron" "make-ephemeron-hash" "make-ephemeron-hasheq" "make-ephemeron-hasheqv" "make-exn" "make-exn:break" "make-exn:break:hang-up" "make-exn:break:terminate" "make-exn:fail" "make-exn:fail:contract" "make-exn:fail:contract:arity" "make-exn:fail:contract:blame" "make-exn:fail:contract:continuation" "make-exn:fail:contract:divide-by-zero" "make-exn:fail:contract:non-fixnum-result" "make-exn:fail:contract:variable" "make-exn:fail:filesystem" "make-exn:fail:filesystem:errno" "make-exn:fail:filesystem:exists" "make-exn:fail:filesystem:missing-module" "make-exn:fail:filesystem:version" "make-exn:fail:network" "make-exn:fail:network:errno" "make-exn:fail:object" "make-exn:fail:out-of-memory" "make-exn:fail:read" "make-exn:fail:read:eof" "make-exn:fail:read:non-char" "make-exn:fail:syntax" "make-exn:fail:syntax:missing-module" "make-exn:fail:syntax:unbound" "make-exn:fail:unsupported" "make-exn:fail:user" "make-file-or-directory-link" "make-flat-contract" "make-fsemaphore" "make-generic" "make-handle-get-preference-locked" "make-hash" "make-hash-placeholder" "make-hasheq" "make-hasheq-placeholder" "make-hasheqv" "make-hasheqv-placeholder" "make-immutable-custom-hash" "make-immutable-hash" "make-immutable-hasheq" "make-immutable-hasheqv" "make-impersonator-property" "make-input-port" "make-input-port/read-to-peek" "make-inspector" "make-interned-syntax-introducer" "make-keyword-procedure" "make-known-char-range-list" "make-limited-input-port" "make-list" "make-lock-file-name" "make-log-receiver" "make-logger" "make-mixin-contract" "make-mutable-custom-set" "make-none/c" "make-object" "make-output-port" "make-parameter" "make-parent-directory*" "make-phantom-bytes" "make-pipe" "make-pipe-with-specials" "make-placeholder" "make-plumber" "make-polar" "make-portal-syntax" "make-prefab-struct" "make-primitive-class" "make-proj-contract" "make-pseudo-random-generator" "make-reader-graph" "make-readtable" "make-rectangular" "make-rename-transformer" "make-resolved-module-path" "make-security-guard" "make-semaphore" "make-set!-transformer" "make-shared-bytes" "make-sibling-inspector" "make-special-comment" "make-srcloc" "make-string" "make-struct-field-accessor" "make-struct-field-mutator" "make-struct-type" "make-struct-type-property" "make-syntax-delta-introducer" "make-syntax-introducer" "make-temporary-directory" "make-temporary-directory*" "make-temporary-file" "make-temporary-file*" "make-tentative-pretty-print-output-port" "make-thread-cell" "make-thread-group" "make-vector" "make-weak-box" "make-weak-custom-hash" "make-weak-custom-set" "make-weak-hash" "make-weak-hasheq" "make-weak-hasheqv" "make-will-executor" "map" "match-equality-test" "matches-arity-exactly?" "max" "mcar" "mcdr" "mcons" "member" "member-name-key-hash-code" "member-name-key=?" "member-name-key?" "memf" "memory-order-acquire" "memory-order-release" "memq" "memv" "merge-input" "method-in-interface?" "min" "module->exports" "module->imports" "module->indirect-exports" "module->language-info" "module->namespace" "module->realm" "module-compiled-cross-phase-persistent?" "module-compiled-exports" "module-compiled-imports" "module-compiled-indirect-exports" "module-compiled-language-info" "module-compiled-name" "module-compiled-realm" "module-compiled-submodules" "module-declared?" "module-path-index-join" "module-path-index-resolve" "module-path-index-split" "module-path-index-submodule" "module-path-index?" "module-path?" "module-predefined?" "module-provide-protected?" "modulo" "mpair?" "mutable-set" "mutable-seteq" "mutable-seteqv" "n->th" "nack-guard-evt" "namespace-anchor->empty-namespace" "namespace-anchor->namespace" "namespace-anchor?" "namespace-attach-module" "namespace-attach-module-declaration" "namespace-base-phase" "namespace-call-with-registry-lock" "namespace-mapped-symbols" "namespace-module-identifier" "namespace-module-registry" "namespace-require" "namespace-require/constant" "namespace-require/copy" "namespace-require/expansion-time" "namespace-set-variable-value!" "namespace-symbol->identifier" "namespace-syntax-introduce" "namespace-undefine-variable!" "namespace-unprotect-module" "namespace-variable-value" "namespace?" "nan?" "natural-number/c" "natural?" "negate" "negative-integer?" "negative?" "new-∀/c" "new-∃/c" "newline" "ninth" "non-empty-listof" "non-empty-string?" "none/c" "nonnegative-integer?" "nonpositive-integer?" "normal-case-path" "normalize-arity" "normalize-path" "normalized-arity?" "not" "not/c" "null?" "number->string" "number?" "numerator" "object->vector" "object-info" "object-interface" "object-method-arity-includes?" "object-name" "object-or-false=?" "object=-hash-code" "object=?" "object?" "odd?" "one-of/c" "open-input-bytes" "open-input-file" "open-input-output-file" "open-input-string" "open-output-bytes" "open-output-file" "open-output-nowhere" "open-output-string" "or/c" "order-of-magnitude" "ormap" "output-port?" "pair?" "parameter-procedure=?" "parameter/c" "parameter?" "parameterization?" "parse-command-line" "partition" "path->bytes" "path->complete-path" "path->directory-path" "path->string" "path-add-extension" "path-add-suffix" "path-convention-type" "path-element->bytes" "path-element->string" "path-element?" "path-for-some-system?" "path-get-extension" "path-has-extension?" "path-list-string->path-list" "path-only" "path-replace-extension" "path-replace-suffix" "path-string?" "pathbytes" "port->bytes-lines" "port->lines" "port->list" "port->string" "port-closed-evt" "port-closed?" "port-commit-peeked" "port-count-lines!" "port-count-lines-enabled" "port-counts-lines?" "port-display-handler" "port-file-identity" "port-file-unlock" "port-next-location" "port-number?" "port-print-handler" "port-progress-evt" "port-provides-progress-evts?" "port-read-handler" "port-try-file-lock?" "port-waiting-peer?" "port-write-handler" "port-writes-atomic?" "port-writes-special?" "port?" "portal-syntax-content" "portal-syntax?" "positive-integer?" "positive?" "prefab-key->struct-type" "prefab-key?" "prefab-struct-key" "preferences-lock-file-mode" "pregexp" "pregexp?" "pretty-display" "pretty-format" "pretty-print" "pretty-print-.-symbol-without-bars" "pretty-print-abbreviate-read-macros" "pretty-print-columns" "pretty-print-current-style-table" "pretty-print-depth" "pretty-print-exact-as-decimal" "pretty-print-extend-style-table" "pretty-print-handler" "pretty-print-newline" "pretty-print-post-print-hook" "pretty-print-pre-print-hook" "pretty-print-print-hook" "pretty-print-print-line" "pretty-print-remap-stylable" "pretty-print-show-inexactness" "pretty-print-size-hook" "pretty-print-style-table?" "pretty-printing" "pretty-write" "primitive-closure?" "primitive-result-arity" "primitive?" "print" "print-as-expression" "print-boolean-long-form" "print-box" "print-graph" "print-hash-table" "print-mpair-curly-braces" "print-pair-curly-braces" "print-reader-abbreviations" "print-struct" "print-syntax-width" "print-unreadable" "print-value-columns" "print-vector-length" "printable/c" "printf" "println" "procedure->method" "procedure-arity" "procedure-arity-includes/c" "procedure-arity-includes?" "procedure-arity-mask" "procedure-arity?" "procedure-closure-contents-eq?" "procedure-extract-target" "procedure-impersonator*?" "procedure-keywords" "procedure-realm" "procedure-reduce-arity" "procedure-reduce-arity-mask" "procedure-reduce-keyword-arity" "procedure-reduce-keyword-arity-mask" "procedure-rename" "procedure-result-arity" "procedure-specialize" "procedure-struct-type?" "procedure?" "process" "process*" "process*/ports" "process/ports" "processor-count" "progress-evt?" "promise-forced?" "promise-running?" "promise/c" "promise/name?" "promise?" "prop:arrow-contract-get-info" "prop:arrow-contract?" "prop:orc-contract-get-subcontracts" "prop:orc-contract?" "prop:recursive-contract-unroll" "prop:recursive-contract?" "proper-subset?" "property/c" "pseudo-random-generator->vector" "pseudo-random-generator-vector?" "pseudo-random-generator?" "put-preferences" "putenv" "quotient" "quotient/remainder" "radians->degrees" "raise" "raise-argument-error" "raise-argument-error*" "raise-arguments-error" "raise-arguments-error*" "raise-arity-error" "raise-arity-error*" "raise-arity-mask-error" "raise-arity-mask-error*" "raise-blame-error" "raise-contract-error" "raise-mismatch-error" "raise-not-cons-blame-error" "raise-range-error" "raise-range-error*" "raise-result-arity-error" "raise-result-arity-error*" "raise-result-error" "raise-result-error*" "raise-syntax-error" "raise-type-error" "raise-user-error" "random" "random-seed" "range" "rational?" "rationalize" "read" "read-accept-bar-quote" "read-accept-box" "read-accept-compiled" "read-accept-dot" "read-accept-graph" "read-accept-infix-dot" "read-accept-lang" "read-accept-quasiquote" "read-accept-reader" "read-byte" "read-byte-or-special" "read-bytes" "read-bytes!" "read-bytes!-evt" "read-bytes-avail!" "read-bytes-avail!*" "read-bytes-avail!-evt" "read-bytes-avail!/enable-break" "read-bytes-evt" "read-bytes-line" "read-bytes-line-evt" "read-case-sensitive" "read-cdot" "read-char" "read-char-or-special" "read-curly-brace-as-paren" "read-curly-brace-with-tag" "read-decimal-as-inexact" "read-eval-print-loop" "read-installation-configuration-table" "read-language" "read-line" "read-line-evt" "read-on-demand-source" "read-single-flonum" "read-square-bracket-as-paren" "read-square-bracket-with-tag" "read-string" "read-string!" "read-string!-evt" "read-string-evt" "read-syntax" "read-syntax-accept-graph" "read-syntax/recursive" "read/recursive" "readtable-mapping" "readtable?" "real->decimal-string" "real->double-flonum" "real->floating-point-bytes" "real->single-flonum" "real-in" "real-part" "real?" "reencode-input-port" "reencode-output-port" "regexp" "regexp-match" "regexp-match*" "regexp-match-evt" "regexp-match-exact?" "regexp-match-peek" "regexp-match-peek-immediate" "regexp-match-peek-positions" "regexp-match-peek-positions*" "regexp-match-peek-positions-immediate" "regexp-match-peek-positions-immediate/end" "regexp-match-peek-positions/end" "regexp-match-positions" "regexp-match-positions*" "regexp-match-positions/end" "regexp-match/end" "regexp-match?" "regexp-max-lookbehind" "regexp-quote" "regexp-replace" "regexp-replace*" "regexp-replace-quote" "regexp-replaces" "regexp-split" "regexp-try-match" "regexp?" "relative-path?" "relocate-input-port" "relocate-output-port" "remainder" "remf" "remf*" "remove" "remove*" "remove-duplicates" "remq" "remq*" "remv" "remv*" "rename-contract" "rename-file-or-directory" "rename-transformer-target" "rename-transformer?" "replace-evt" "reroot-path" "resolve-path" "resolved-module-path-name" "resolved-module-path?" "rest" "reverse" "round" "second" "seconds->date" "security-guard?" "semaphore-peek-evt" "semaphore-peek-evt?" "semaphore-post" "semaphore-try-wait?" "semaphore-wait" "semaphore-wait/enable-break" "semaphore?" "sequence->list" "sequence->stream" "sequence-add-between" "sequence-andmap" "sequence-append" "sequence-count" "sequence-filter" "sequence-fold" "sequence-for-each" "sequence-generate" "sequence-generate*" "sequence-length" "sequence-map" "sequence-ormap" "sequence-ref" "sequence-tail" "sequence/c" "sequence?" "set" "set!-transformer-procedure" "set!-transformer?" "set->list" "set->stream" "set-add" "set-add!" "set-box!" "set-box*!" "set-clear" "set-clear!" "set-copy" "set-copy-clear" "set-count" "set-empty?" "set-eq?" "set-equal?" "set-eqv?" "set-first" "set-for-each" "set-implements/c" "set-implements?" "set-intersect" "set-intersect!" "set-map" "set-mcar!" "set-mcdr!" "set-member?" "set-mutable?" "set-phantom-bytes!" "set-port-next-location!" "set-remove" "set-remove!" "set-rest" "set-subtract" "set-subtract!" "set-symmetric-difference" "set-symmetric-difference!" "set-union" "set-union!" "set-weak?" "set/c" "set=?" "set?" "seteq" "seteqv" "seventh" "sgn" "sha1-bytes" "sha224-bytes" "sha256-bytes" "shared-bytes" "shell-execute" "shrink-path-wrt" "shuffle" "simple-form-path" "simplify-path" "sin" "single-flonum-available?" "single-flonum?" "sinh" "sixth" "skip-projection-wrapper?" "sleep" "some-system-path->string" "sort" "special-comment-value" "special-comment?" "special-filter-input-port" "split-at" "split-at-right" "split-common-prefix" "split-path" "splitf-at" "splitf-at-right" "sqr" "sqrt" "srcloc" "srcloc->string" "srcloc-column" "srcloc-line" "srcloc-position" "srcloc-source" "srcloc-span" "srcloc?" "stop-after" "stop-before" "stream->list" "stream-add-between" "stream-andmap" "stream-append" "stream-count" "stream-empty?" "stream-filter" "stream-first" "stream-fold" "stream-for-each" "stream-force" "stream-length" "stream-map" "stream-ormap" "stream-ref" "stream-rest" "stream-tail" "stream-take" "stream/c" "stream?" "string" "string->bytes/latin-1" "string->bytes/locale" "string->bytes/utf-8" "string->immutable-string" "string->keyword" "string->list" "string->number" "string->path" "string->path-element" "string->some-system-path" "string->symbol" "string->uninterned-symbol" "string->unreadable-symbol" "string-append" "string-append*" "string-append-immutable" "string-ci<=?" "string-ci=?" "string-ci>?" "string-contains?" "string-copy" "string-copy!" "string-downcase" "string-environment-variable-name?" "string-fill!" "string-foldcase" "string-join" "string-len/c" "string-length" "string-locale-ci?" "string-locale-downcase" "string-locale-upcase" "string-locale?" "string-no-nuls?" "string-normalize-nfc" "string-normalize-nfd" "string-normalize-nfkc" "string-normalize-nfkd" "string-normalize-spaces" "string-port?" "string-prefix?" "string-ref" "string-replace" "string-set!" "string-split" "string-suffix?" "string-titlecase" "string-trim" "string-upcase" "string-utf-8-length" "string<=?" "string=?" "string>?" "string?" "struct->vector" "struct-accessor-procedure?" "struct-constructor-procedure?" "struct-info" "struct-mutator-procedure?" "struct-predicate-procedure?" "struct-type-authentic?" "struct-type-info" "struct-type-make-constructor" "struct-type-make-predicate" "struct-type-property-accessor-procedure?" "struct-type-property-predicate-procedure?" "struct-type-property/c" "struct-type-property?" "struct-type-sealed?" "struct-type?" "struct?" "sub1" "subbytes" "subclass?" "subclass?/c" "subprocess" "subprocess-group-enabled" "subprocess-kill" "subprocess-pid" "subprocess-status" "subprocess-wait" "subprocess?" "subset?" "substring" "suggest/c" "symbol->string" "symbol-interned?" "symbol-unreadable?" "symboldatum" "syntax->list" "syntax-arm" "syntax-binding-set" "syntax-binding-set->syntax" "syntax-binding-set-extend" "syntax-binding-set?" "syntax-column" "syntax-debug-info" "syntax-deserialize" "syntax-disarm" "syntax-e" "syntax-line" "syntax-local-apply-transformer" "syntax-local-bind-syntaxes" "syntax-local-certifier" "syntax-local-context" "syntax-local-expand-expression" "syntax-local-get-shadower" "syntax-local-identifier-as-binding" "syntax-local-introduce" "syntax-local-lift-context" "syntax-local-lift-expression" "syntax-local-lift-module" "syntax-local-lift-module-end-declaration" "syntax-local-lift-provide" "syntax-local-lift-require" "syntax-local-lift-values-expression" "syntax-local-make-definition-context" "syntax-local-make-delta-introducer" "syntax-local-module-defined-identifiers" "syntax-local-module-exports" "syntax-local-module-interned-scope-symbols" "syntax-local-module-required-identifiers" "syntax-local-name" "syntax-local-phase-level" "syntax-local-submodules" "syntax-local-transforming-module-provides?" "syntax-local-value" "syntax-local-value/immediate" "syntax-original?" "syntax-position" "syntax-property" "syntax-property-preserved?" "syntax-property-remove" "syntax-property-symbol-keys" "syntax-protect" "syntax-rearm" "syntax-recertify" "syntax-serialize" "syntax-shift-phase-level" "syntax-source" "syntax-source-module" "syntax-span" "syntax-taint" "syntax-tainted?" "syntax-track-origin" "syntax-transforming-module-expression?" "syntax-transforming-with-lifts?" "syntax-transforming?" "syntax/c" "syntax?" "system" "system*" "system*/exit-code" "system-big-endian?" "system-idle-evt" "system-language+country" "system-library-subpath" "system-path-convention-type" "system-type" "system/exit-code" "tail-marks-match?" "take" "take-common-prefix" "take-right" "takef" "takef-right" "tan" "tanh" "tcp-abandon-port" "tcp-accept" "tcp-accept-evt" "tcp-accept-ready?" "tcp-accept/enable-break" "tcp-addresses" "tcp-close" "tcp-connect" "tcp-connect/enable-break" "tcp-listen" "tcp-listener?" "tcp-port?" "tentative-pretty-print-port-cancel" "tentative-pretty-print-port-transfer" "tenth" "terminal-port?" "third" "thread" "thread-cell-ref" "thread-cell-set!" "thread-cell-values?" "thread-cell?" "thread-dead-evt" "thread-dead?" "thread-group?" "thread-receive" "thread-receive-evt" "thread-resume" "thread-resume-evt" "thread-rewind-receive" "thread-running?" "thread-send" "thread-suspend" "thread-suspend-evt" "thread-try-receive" "thread-wait" "thread/suspend-to-kill" "thread?" "time-apply" "touch" "transplant-input-port" "transplant-output-port" "truncate" "udp-addresses" "udp-bind!" "udp-bound?" "udp-close" "udp-connect!" "udp-connected?" "udp-multicast-interface" "udp-multicast-join-group!" "udp-multicast-leave-group!" "udp-multicast-loopback?" "udp-multicast-set-interface!" "udp-multicast-set-loopback!" "udp-multicast-set-ttl!" "udp-multicast-ttl" "udp-open-socket" "udp-receive!" "udp-receive!*" "udp-receive!-evt" "udp-receive!/enable-break" "udp-receive-ready-evt" "udp-send" "udp-send*" "udp-send-evt" "udp-send-ready-evt" "udp-send-to" "udp-send-to*" "udp-send-to-evt" "udp-send-to/enable-break" "udp-send/enable-break" "udp-set-receive-buffer-size!" "udp-set-ttl!" "udp-ttl" "udp?" "unbox" "unbox*" "uncaught-exception-handler" "unit?" "unquoted-printing-string" "unquoted-printing-string-value" "unquoted-printing-string?" "unsupplied-arg?" "use-collection-link-paths" "use-compiled-file-check" "use-compiled-file-paths" "use-user-specific-search-paths" "value-blame" "value-contract" "values" "variable-reference->empty-namespace" "variable-reference->module-base-phase" "variable-reference->module-declaration-inspector" "variable-reference->module-path-index" "variable-reference->module-source" "variable-reference->namespace" "variable-reference->phase" "variable-reference->resolved-module-path" "variable-reference-constant?" "variable-reference-from-unsafe?" "variable-reference?" "vector" "vector*-length" "vector*-ref" "vector*-set!" "vector->immutable-vector" "vector->list" "vector->pseudo-random-generator" "vector->pseudo-random-generator!" "vector->values" "vector-append" "vector-argmax" "vector-argmin" "vector-cas!" "vector-copy" "vector-copy!" "vector-count" "vector-drop" "vector-drop-right" "vector-empty?" "vector-fill!" "vector-filter" "vector-filter-not" "vector-immutable" "vector-immutable/c" "vector-immutableof" "vector-length" "vector-map" "vector-map!" "vector-member" "vector-memq" "vector-memv" "vector-ref" "vector-set!" "vector-set*!" "vector-set-performance-stats!" "vector-sort" "vector-sort!" "vector-split-at" "vector-split-at-right" "vector-take" "vector-take-right" "vector/c" "vector?" "vectorof" "version" "void" "void?" "weak-box-value" "weak-box?" "weak-set" "weak-seteq" "weak-seteqv" "will-execute" "will-executor?" "will-register" "will-try-execute" "with-input-from-bytes" "with-input-from-file" "with-input-from-string" "with-output-to-bytes" "with-output-to-file" "with-output-to-string" "would-be-future" "wrap-evt" "write" "write-byte" "write-bytes" "write-bytes-avail" "write-bytes-avail*" "write-bytes-avail-evt" "write-bytes-avail/enable-break" "write-char" "write-special" "write-special-avail*" "write-special-evt" "write-string" "write-to-file" "writeln" "xor" "zero?" "~.a" "~.s" "~.v" "~a" "~e" "~r" "~s" "~v" - )) - -;; operators ;; - -((symbol) @operator - (#any-of? @operator - "+" "-" "*" "/" "=" "<=" ">=" "<" ">")) - -;; builtin variables ;; - -((symbol) @variable.builtin - (#any-of? @variable.builtin - "always-evt" "block-device-type-bits" "character-device-type-bits" "check-tail-contract" "contract-continuation-mark-key" "contract-random-generate-fail" "directory-type-bits" "empty" "empty-sequence" "empty-stream" "eof" "equal<%>" "error-message-adjuster-key" "externalizable<%>" "failure-result/c" "false" "false/c" "fifo-type-bits" "file-type-bits" "for-clause-syntax-protect" "group-execute-bit" "group-permission-bits" "group-read-bit" "group-write-bit" "impersonator-prop:application-mark" "impersonator-prop:blame" "impersonator-prop:contracted" "legacy-match-expander?" "match-...-nesting" "match-expander?" "mixin-contract" "never-evt" "null" "object%" "other-execute-bit" "other-permission-bits" "other-read-bit" "other-write-bit" "pi" "pi.f" "predicate/c" "printable<%>" "prop:arity-string" "prop:arrow-contract" "prop:authentic" "prop:blame" "prop:chaperone-contract" "prop:checked-procedure" "prop:contract" "prop:contracted" "prop:custom-print-quotable" "prop:custom-write" "prop:dict" "prop:equal+hash" "prop:evt" "prop:exn:missing-module" "prop:exn:srclocs" "prop:expansion-contexts" "prop:flat-contract" "prop:impersonator-of" "prop:input-port" "prop:legacy-match-expander" "prop:liberal-define-context" "prop:match-expander" "prop:object-name" "prop:orc-contract" "prop:output-port" "prop:place-location" "prop:procedure" "prop:recursive-contract" "prop:rename-transformer" "prop:sealed" "prop:sequence" "prop:set!-transformer" "prop:stream" "regular-file-type-bits" "set-group-id-bit" "set-user-id-bit" "socket-type-bits" "sticky-bit" "struct:arity-at-least" "struct:arrow-contract-info" "struct:date" "struct:date*" "struct:exn" "struct:exn:break" "struct:exn:break:hang-up" "struct:exn:break:terminate" "struct:exn:fail" "struct:exn:fail:contract" "struct:exn:fail:contract:arity" "struct:exn:fail:contract:blame" "struct:exn:fail:contract:continuation" "struct:exn:fail:contract:divide-by-zero" "struct:exn:fail:contract:non-fixnum-result" "struct:exn:fail:contract:variable" "struct:exn:fail:filesystem" "struct:exn:fail:filesystem:errno" "struct:exn:fail:filesystem:exists" "struct:exn:fail:filesystem:missing-module" "struct:exn:fail:filesystem:version" "struct:exn:fail:network" "struct:exn:fail:network:errno" "struct:exn:fail:object" "struct:exn:fail:out-of-memory" "struct:exn:fail:read" "struct:exn:fail:read:eof" "struct:exn:fail:read:non-char" "struct:exn:fail:syntax" "struct:exn:fail:syntax:missing-module" "struct:exn:fail:syntax:unbound" "struct:exn:fail:unsupported" "struct:exn:fail:user" "struct:srcloc" "symbolic-link-type-bits" "syntax-local-match-introduce" "syntax-pattern-variable?" "the-unsupplied-arg" "true" "unspecified-dom" "user-execute-bit" "user-permission-bits" "user-read-bit" "user-write-bit" "writable<%>" - )) - -(dot) @variable.builtin - -;;------------------------------------------------------------------;; -;; Special cases ;; -;;------------------------------------------------------------------;; - -(list - "[" - (symbol) @variable - "]") - -(list - . - (symbol) @_p - . - (list - (symbol) @variable) - (#any-of? @_p - "lambda" "λ" "define-values" "define-syntaxes" "define-values-for-export" - "define-values-for-syntax" - )) - -;;------------------------------------------------------------------;; -;; Solve conflicts ;; -;;------------------------------------------------------------------;; - -;; See `:h treesitter`, and search `priority` - -(list - . - (symbol) @include - (#eq? @include "require") - (#set! "priority" 101)) - -(quote - . - (symbol) - (#set! "priority" 105)) @symbol - -((sexp_comment) @comment - (#set! "priority" 110)) +((symbol) @comment + (#match? @comment "^#[cC][iIsS]$")) diff --git a/crates/zed/src/languages/racket/indents.scm b/crates/zed/src/languages/racket/indents.scm new file mode 100644 index 0000000000..9a1cbad161 --- /dev/null +++ b/crates/zed/src/languages/racket/indents.scm @@ -0,0 +1,3 @@ +(_ "[" "]") @indent +(_ "{" "}") @indent +(_ "(" ")") @indent diff --git a/crates/zed/src/languages/racket/injections.scm b/crates/zed/src/languages/racket/injections.scm deleted file mode 100644 index 9bfa09db91..0000000000 --- a/crates/zed/src/languages/racket/injections.scm +++ /dev/null @@ -1,4 +0,0 @@ -; Copied from nvim: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/racket/injections.scm - -[(comment) - (block_comment)] @comment \ No newline at end of file diff --git a/crates/zed/src/languages/racket/outline.scm b/crates/zed/src/languages/racket/outline.scm new file mode 100644 index 0000000000..604e052a63 --- /dev/null +++ b/crates/zed/src/languages/racket/outline.scm @@ -0,0 +1,10 @@ +(list + . + (symbol) @start-symbol @context + . + [ + (symbol) @name + (list . (symbol) @name) + ] + (#match? @start-symbol "^define") +) @item \ No newline at end of file diff --git a/crates/zed/src/languages/ruby/brackets.scm b/crates/zed/src/languages/ruby/brackets.scm index e69de29bb2..957b20ecdb 100644 --- a/crates/zed/src/languages/ruby/brackets.scm +++ b/crates/zed/src/languages/ruby/brackets.scm @@ -0,0 +1,14 @@ +("[" @open "]" @close) +("{" @open "}" @close) +("\"" @open "\"" @close) +("do" @open "end" @close) + +(block_parameters "|" @open "|" @close) +(interpolation "#{" @open "}" @close) + +(if "if" @open "end" @close) +(unless "unless" @open "end" @close) +(begin "begin" @open "end" @close) +(module "module" @open "end" @close) +(_ . "def" @open "end" @close) +(_ . "class" @open "end" @close) \ No newline at end of file diff --git a/crates/zed/src/languages/scheme/brackets.scm b/crates/zed/src/languages/scheme/brackets.scm new file mode 100644 index 0000000000..191fd9c084 --- /dev/null +++ b/crates/zed/src/languages/scheme/brackets.scm @@ -0,0 +1,3 @@ +("(" @open ")" @close) +("[" @open "]" @close) +("{" @open "}" @close) diff --git a/crates/zed/src/languages/scheme/config.toml b/crates/zed/src/languages/scheme/config.toml index c23099a551..7e63673834 100644 --- a/crates/zed/src/languages/scheme/config.toml +++ b/crates/zed/src/languages/scheme/config.toml @@ -1,9 +1,9 @@ name = "Scheme" -path_suffixes = ["scm", "ss", "mjs"] +path_suffixes = ["scm", "ss"] line_comment = "; " autoclose_before = "])" brackets = [ - { start = "[", end = "]", close = true, newline = true }, - { start = "(", end = ")", close = true, newline = true }, - { start = "'", end = "'", close = false, newline = false }, + { start = "[", end = "]", close = true, newline = false }, + { start = "(", end = ")", close = true, newline = false }, + { start = "\"", end = "\"", close = true, newline = false }, ] diff --git a/crates/zed/src/languages/scheme/folds.scm b/crates/zed/src/languages/scheme/folds.scm deleted file mode 100644 index e8ba2f269c..0000000000 --- a/crates/zed/src/languages/scheme/folds.scm +++ /dev/null @@ -1,3 +0,0 @@ -; Copied from nvim: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/scheme/folds.scm - -(program (list) @fold) \ No newline at end of file diff --git a/crates/zed/src/languages/scheme/highlights.scm b/crates/zed/src/languages/scheme/highlights.scm index 222675d3fc..40ba61cd05 100644 --- a/crates/zed/src/languages/scheme/highlights.scm +++ b/crates/zed/src/languages/scheme/highlights.scm @@ -1,183 +1,28 @@ -;; Copied from nvim: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/scheme/highlights.scm - -;; A highlight query can override the highlights queries before it. -;; So the order is important. -;; We should highlight general rules, then highlight special forms. - -(number) @number -(character) @character -(boolean) @boolean -(string) @string -[(comment) - (block_comment)] @comment - -;; highlight for datum comment -;; copied from ../clojure/highlights.scm -([(comment) (directive)] @comment - (#set! "priority" 105)) - -(escape_sequence) @string.escape - ["(" ")" "[" "]" "{" "}"] @punctuation.bracket -;; variables +(number) @number +(character) @constant.builtin +(boolean) @constant.builtin (symbol) @variable -((symbol) @variable.builtin - (#any-of? @variable.builtin "..." ".")) +(string) @string -;; procedure +(escape_sequence) @escape -(list - . - (symbol) @function) - -;; special forms - -(list - "[" - (symbol)+ @variable - "]") - -(list - . - (symbol) @_f - . - (list - (symbol) @variable) - (#any-of? @_f "lambda" "λ")) - -(list - . - (symbol) @_f - . - (list - (list - (symbol) @variable)) - (#any-of? @_f - "let" "let*" "let-syntax" "let-values" "let*-values" "letrec" "letrec*" "letrec-syntax")) - -;; operators +[(comment) + (block_comment) + (directive)] @comment ((symbol) @operator - (#any-of? @operator - "+" "-" "*" "/" "=" "<=" ">=" "<" ">")) - -;; keyword - -((symbol) @keyword - (#any-of? @keyword - "define" "lambda" "λ" "begin" "do" "define-syntax" - "and" "or" - "if" "cond" "case" "when" "unless" "else" "=>" - "let" "let*" "let-syntax" "let-values" "let*-values" "letrec" "letrec*" "letrec-syntax" - "set!" - "syntax-rules" "identifier-syntax" - "quote" "unquote" "quote-splicing" "quasiquote" "unquote-splicing" - "delay" - "assert" - "library" "export" "import" "rename" "only" "except" "prefix")) - -((symbol) @conditional - (#any-of? @conditional "if" "cond" "case" "when" "unless")) - -;; quote - -(abbreviation - "'" - (symbol)) @symbol + (#match? @operator "^(\\+|-|\\*|/|=|>|<|>=|<=)$")) (list - . - (symbol) @_f - (#eq? @_f "quote")) @symbol - -;; library + . + (symbol) @function) (list - . - (symbol) @_lib - . - (symbol) @namespace - - (#eq? @_lib "library")) - -;; builtin procedures -;; procedures in R5RS and R6RS but not in R6RS-lib - -((symbol) @function.builtin - (#any-of? @function.builtin - ;; eq - "eqv?" "eq?" "equal?" - ;; number - "number?" "complex?" "real?" "rational?" "integer?" - "exact?" "inexact?" - "zero?" "positive?" "negative?" "odd?" "even?" "finite?" "infinite?" "nan?" - "max" "min" - "abs" "quotient" "remainder" "modulo" - "div" "div0" "mod" "mod0" "div-and-mod" "div0-and-mod0" - "gcd" "lcm" "numerator" "denominator" - "floor" "ceiling" "truncate" "round" - "rationalize" - "exp" "log" "sin" "cos" "tan" "asin" "acos" "atan" - "sqrt" "expt" - "exact-integer-sqrt" - "make-rectangular" "make-polar" "real-part" "imag-part" "magnitude" "angle" - "real-valued" "rational-valued?" "integer-valued?" - "exact" "inexact" "exact->inexact" "inexact->exact" - "number->string" "string->number" - ;; boolean - "boolean?" "not" "boolean=?" - ;; pair - "pair?" "cons" - "car" "cdr" - "caar" "cadr" "cdar" "cddr" - "caaar" "caadr" "cadar" "caddr" "cdaar" "cdadr" "cddar" "cdddr" - "caaaar" "caaadr" "caadar" "caaddr" "cadaar" "cadadr" "caddar" "cadddr" - "cdaaar" "cdaadr" "cdadar" "cdaddr" "cddaar" "cddadr" "cdddar" "cddddr" - "set-car!" "set-cdr!" - ;; list - "null?" "list?" - "list" "length" "append" "reverse" "list-tail" "list-ref" - "map" "for-each" - "memq" "memv" "member" "assq" "assv" "assoc" - ;; symbol - "symbol?" "symbol->string" "string->symbol" "symbol=?" - ;; char - "char?" "char=?" "char?" "char<=?" "char>=?" - "char-ci=?" "char-ci?" "char-ci<=?" "char-ci>=?" - "char-alphabetic?" "char-numeric?" "char-whitespace?" "char-upper-case?" "char-lower-case?" - "char->integer" "integer->char" - "char-upcase" "char-downcase" - ;; string - "string?" "make-string" "string" "string-length" "string-ref" "string-set!" - "string=?" "string-ci=?" "string?" "string<=?" "string>=?" - "string-ci?" "string-ci<=?" "string-ci>=?" - "substring" "string-append" "string->list" "list->string" - "string-for-each" - "string-copy" "string-fill!" - "string-upcase" "string-downcase" - ;; vector - "vector?" "make-vector" "vector" "vector-length" "vector-ref" "vector-set!" - "vector->list" "list->vector" "vector-fill!" "vector-map" "vector-for-each" - ;; bytevector - "bytevector?" "native-endianness" - "make-bytevector" "bytevector-length" "bytevector=?" "bytevector-fill!" - "bytevector-copy!" "bytevector-copy" - ;; error - "error" "assertion-violation" - ;; control - "procedure?" "apply" "force" - "call-with-current-continuation" "call/cc" - "values" "call-with-values" "dynamic-wind" - "eval" "scheme-report-environment" "null-environment" "interaction-environment" - ;; IO - "call-with-input-file" "call-with-output-file" "input-port?" "output-port?" - "current-input-port" "current-output-port" "with-input-from-file" "with-output-to-file" - "open-input-file" "open-output-file" "close-input-port" "close-output-port" - ;; input - "read" "read-char" "peek-char" "eof-object?" "char-ready?" - ;; output - "write" "display" "newline" "write-char" - ;; system - "load" "transcript-on" "transcript-off")) \ No newline at end of file + . + (symbol) @keyword + (#match? @keyword + "^(define-syntax|let\\*|lambda|λ|case|=>|quote-splicing|unquote-splicing|set!|let|letrec|letrec-syntax|let-values|let\\*-values|do|else|define|cond|syntax-rules|unquote|begin|quote|let-syntax|and|if|quasiquote|letrec|delay|or|when|unless|identifier-syntax|assert|library|export|import|rename|only|except|prefix)$" + )) diff --git a/crates/zed/src/languages/scheme/indents.scm b/crates/zed/src/languages/scheme/indents.scm new file mode 100644 index 0000000000..9a1cbad161 --- /dev/null +++ b/crates/zed/src/languages/scheme/indents.scm @@ -0,0 +1,3 @@ +(_ "[" "]") @indent +(_ "{" "}") @indent +(_ "(" ")") @indent diff --git a/crates/zed/src/languages/scheme/injections.scm b/crates/zed/src/languages/scheme/injections.scm deleted file mode 100644 index 5a76034eed..0000000000 --- a/crates/zed/src/languages/scheme/injections.scm +++ /dev/null @@ -1,3 +0,0 @@ -; Copied from nvim: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/scheme/injections.scm - -(comment) @comment \ No newline at end of file diff --git a/crates/zed/src/languages/scheme/outline.scm b/crates/zed/src/languages/scheme/outline.scm new file mode 100644 index 0000000000..604e052a63 --- /dev/null +++ b/crates/zed/src/languages/scheme/outline.scm @@ -0,0 +1,10 @@ +(list + . + (symbol) @start-symbol @context + . + [ + (symbol) @name + (list . (symbol) @name) + ] + (#match? @start-symbol "^define") +) @item \ No newline at end of file