)
+--- - type of arguments that needs to be passed to the vim command
+--- - {args}: (string, optional)
+--- - vim command attributes
+---
+---* @example
+--- If module is nvim-treesitter.custom_mod
+---
+--- M.commands = {
+--- custom_command = {
+--- run = M.module_function,
+--- f_args = "",
+--- args = {
+--- "-range"
+--- }
+--- }
+--- }
+---
+--- utils.setup_commands("custom_mod", require("nvim-treesitter.custom_mod").commands)
+---
+---
+--- Will generate command :
+---
+--- command! -range custom_command \
+--- lua require'nvim-treesitter.custom_mod'.commands.custom_command['run']()
+---
+function M.setup_commands(mod, commands)
+ for command_name, def in pairs(commands) do
+ local f_args = def.f_args or ""
+ local call_fn =
+ string.format("lua require'nvim-treesitter.%s'.commands.%s['run'](%s)", mod, command_name, f_args)
+ local parts = require("nvim-treesitter.compat").flatten {
+ "command!",
+ "-bar",
+ def.args,
+ command_name,
+ call_fn,
+ }
+ api.nvim_command(table.concat(parts, " "))
+ end
+end
+
+---@param dir string
+---@param create_err string
+---@param writeable_err string
+---@return string|nil, string|nil
+function M.create_or_reuse_writable_dir(dir, create_err, writeable_err)
+ create_err = create_err or M.join_space("Could not create dir '", dir, "': ")
+ writeable_err = writeable_err or M.join_space("Invalid rights, '", dir, "' should be read/write")
+ -- Try creating and using parser_dir if it doesn't exist
+ if not luv.fs_stat(dir) then
+ local ok, error = pcall(vim.fn.mkdir, dir, "p", "0755")
+ if not ok then
+ return nil, M.join_space(create_err, error)
+ end
+
+ return dir
+ end
+
+ -- parser_dir exists, use it if it's read/write
+ if luv.fs_access(dir, "RW") then
+ return dir
+ end
+
+ -- parser_dir exists but isn't read/write, give up
+ return nil, M.join_space(writeable_err, dir, "'")
+end
+
+function M.get_package_path()
+ -- Path to this source file, removing the leading '@'
+ local source = string.sub(debug.getinfo(1, "S").source, 2)
+
+ -- Path to the package root
+ return fn.fnamemodify(source, ":p:h:h:h")
+end
+
+function M.get_cache_dir()
+ local cache_dir = fn.stdpath "data"
+
+ if luv.fs_access(cache_dir, "RW") then
+ return cache_dir
+ elseif luv.fs_access("/tmp", "RW") then
+ return "/tmp"
+ end
+
+ return nil, M.join_space("Invalid cache rights,", fn.stdpath "data", "or /tmp should be read/write")
+end
+
+-- Returns $XDG_DATA_HOME/nvim/site, but could use any directory that is in
+-- runtimepath
+function M.get_site_dir()
+ return M.join_path(fn.stdpath "data", "site")
+end
+
+-- Gets a property at path
+---@param tbl table the table to access
+---@param path string the '.' separated path
+---@return table|nil result the value at path or nil
+function M.get_at_path(tbl, path)
+ if path == "" then
+ return tbl
+ end
+
+ local segments = vim.split(path, ".", true)
+ ---@type table[]|table
+ local result = tbl
+
+ for _, segment in ipairs(segments) do
+ if type(result) == "table" then
+ ---@type table
+ -- TODO: figure out the actual type of tbl
+ result = result[segment]
+ end
+ end
+
+ return result
+end
+
+function M.set_jump()
+ vim.cmd "normal! m'"
+end
+
+-- Filters a list based on the given predicate
+---@param tbl any[] The list to filter
+---@param predicate fun(v:any, i:number):boolean The predicate to filter with
+function M.filter(tbl, predicate)
+ local result = {}
+
+ for i, v in ipairs(tbl) do
+ if predicate(v, i) then
+ table.insert(result, v)
+ end
+ end
+
+ return result
+end
+
+-- Returns a list of all values from the first list
+-- that are not present in the second list.
+---@param tbl1 any[] The first table
+---@param tbl2 any[] The second table
+---@return table
+function M.difference(tbl1, tbl2)
+ return M.filter(tbl1, function(v)
+ return not vim.tbl_contains(tbl2, v)
+ end)
+end
+
+function M.identity(a)
+ return a
+end
+
+-- Returns a function returning the given value
+---@param a any
+---@return fun():any
+function M.constant(a)
+ return function()
+ return a
+ end
+end
+
+-- Returns a function that returns the given value if it is a function,
+-- otherwise returns a function that returns the given value.
+---@param a any
+---@return fun(...):any
+function M.to_func(a)
+ return type(a) == "function" and a or M.constant(a)
+end
+
+---@return string|nil
+function M.ts_cli_version()
+ if fn.executable "tree-sitter" == 1 then
+ local handle = io.popen "tree-sitter -V"
+ if not handle then
+ return
+ end
+ local result = handle:read "*a"
+ handle:close()
+ return vim.split(result, "\n")[1]:match "[^tree%psitter ].*"
+ end
+end
+
+return M
diff --git a/parser-info/.gitignore b/parser-info/.gitignore
new file mode 100644
index 000000000..d6b7ef32c
--- /dev/null
+++ b/parser-info/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/parser/.gitignore b/parser/.gitignore
new file mode 100644
index 000000000..d6b7ef32c
--- /dev/null
+++ b/parser/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua
deleted file mode 100644
index f8fe0c287..000000000
--- a/plugin/filetypes.lua
+++ /dev/null
@@ -1,69 +0,0 @@
-local filetypes = {
- angular = { 'htmlangular' },
- bash = { 'sh' },
- bibtex = { 'bib' },
- c_sharp = { 'cs', 'csharp' },
- commonlisp = { 'lisp' },
- cooklang = { 'cook' },
- devicetree = { 'dts' },
- diff = { 'gitdiff' },
- eex = { 'eelixir' },
- elixir = { 'ex' },
- embedded_template = { 'eruby' },
- erlang = { 'erl' },
- facility = { 'fsd' },
- faust = { 'dsp' },
- gdshader = { 'gdshaderinc' },
- git_config = { 'gitconfig' },
- git_rebase = { 'gitrebase' },
- glimmer = { 'handlebars', 'html.handlebars' },
- godot_resource = { 'gdresource' },
- haskell = { 'hs' },
- haskell_persistent = { 'haskellpersistent' },
- idris = { 'idris2' },
- ini = { 'confini', 'dosini' },
- janet_simple = { 'janet' },
- javascript = { 'javascriptreact', 'ecma', 'ecmascript', 'jsx', 'js' },
- json = { 'jsonc' },
- glimmer_javascript = { 'javascript.glimmer' },
- latex = { 'tex' },
- linkerscript = { 'ld' },
- m68k = { 'asm68k' },
- make = { 'automake' },
- markdown = { 'pandoc' },
- muttrc = { 'neomuttrc' },
- ocaml_interface = { 'ocamlinterface' },
- perl = { 'pl' },
- poe_filter = { 'poefilter' },
- powershell = { 'ps1' },
- properties = { 'jproperties' },
- python = { 'py', 'gyp' },
- qmljs = { 'qml' },
- runescript = { 'clientscript' },
- scala = { 'sbt' },
- slang = { 'shaderslang' },
- sqp = { 'mysqp' },
- ssh_config = { 'sshconfig' },
- starlark = { 'bzl' },
- surface = { 'sface' },
- systemverilog = { 'verilog' },
- t32 = { 'trace32' },
- tcl = { 'expect' },
- terraform = { 'terraform-vars' },
- textproto = { 'pbtxt' },
- tlaplus = { 'tla' },
- tsx = { 'typescriptreact', 'typescript.tsx' },
- typescript = { 'ts' },
- glimmer_typescript = { 'typescript.glimmer' },
- typst = { 'typ' },
- udev = { 'udevrules' },
- uxntal = { 'tal', 'uxn' },
- v = { 'vlang' },
- vhs = { 'tape' },
- xml = { 'xsd', 'xslt', 'svg' },
- xresources = { 'xdefaults' },
-}
-
-for lang, ft in pairs(filetypes) do
- vim.treesitter.language.register(lang, ft)
-end
diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua
index adeb41425..4ea3925fd 100644
--- a/plugin/nvim-treesitter.lua
+++ b/plugin/nvim-treesitter.lua
@@ -1,75 +1,34 @@
+-- Last Change: 2022 Apr 16
+
if vim.g.loaded_nvim_treesitter then
return
end
vim.g.loaded_nvim_treesitter = true
+-- setup modules
+require("nvim-treesitter").setup()
+
local api = vim.api
-local function complete_available_parsers(arglead)
- return vim.tbl_filter(
- --- @param v string
- function(v)
- return v:find(arglead) ~= nil
- end,
- require('nvim-treesitter.config').get_available()
- )
-end
+-- define autocommands
+local augroup = api.nvim_create_augroup("NvimTreesitter", {})
-local function complete_installed_parsers(arglead)
- return vim.tbl_filter(
- --- @param v string
- function(v)
- return v:find(arglead) ~= nil
- end,
- require('nvim-treesitter.config').get_installed()
- )
-end
-
--- create user commands
-api.nvim_create_user_command('TSInstall', function(args)
- require('nvim-treesitter.install').install(args.fargs, { force = args.bang, summary = true })
-end, {
- nargs = '+',
- bang = true,
- bar = true,
- complete = complete_available_parsers,
- desc = 'Install treesitter parsers',
-})
-
-api.nvim_create_user_command('TSInstallFromGrammar', function(args)
- require('nvim-treesitter.install').install(args.fargs, {
- generate = true,
- summary = true,
- force = args.bang,
- })
-end, {
- nargs = '+',
- bang = true,
- bar = true,
- complete = complete_available_parsers,
- desc = 'Install treesitter parsers from grammar',
-})
-
-api.nvim_create_user_command('TSUpdate', function(args)
- require('nvim-treesitter.install').update(args.fargs, { summary = true })
-end, {
- nargs = '*',
- bar = true,
- complete = complete_installed_parsers,
- desc = 'Update installed treesitter parsers',
-})
-
-api.nvim_create_user_command('TSUninstall', function(args)
- require('nvim-treesitter.install').uninstall(args.fargs, { summary = true })
-end, {
- nargs = '+',
- bar = true,
- complete = complete_installed_parsers,
- desc = 'Uninstall treesitter parsers',
-})
-
-api.nvim_create_user_command('TSLog', function()
- require('nvim-treesitter.log').show()
-end, {
- desc = 'View log messages',
+api.nvim_create_autocmd("Filetype", {
+ pattern = "query",
+ group = augroup,
+ callback = function()
+ api.nvim_clear_autocmds {
+ group = augroup,
+ event = "BufWritePost",
+ }
+ api.nvim_create_autocmd("BufWritePost", {
+ group = augroup,
+ buffer = 0,
+ callback = function(opts)
+ require("nvim-treesitter.query").invalidate_query_file(opts.file)
+ end,
+ desc = "Invalidate query file",
+ })
+ end,
+ desc = "Reload query",
})
diff --git a/plugin/query_predicates.lua b/plugin/query_predicates.lua
deleted file mode 100644
index 6511d3104..000000000
--- a/plugin/query_predicates.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-local query = vim.treesitter.query
-
-local predicates = {
- ---@param match table
- ---@param pred any[]
- ---@param any boolean
- ---@return boolean
- ['kind-eq'] = function(match, pred, any)
- local nodes = match[pred[2]]
- if not nodes or #nodes == 0 then
- return true
- end
-
- local types = { unpack(pred, 3) }
- for _, node in ipairs(nodes) do
- local res = vim.list_contains(types, node:type())
- if any and res then
- return true
- elseif not any and not res then
- return false
- end
- end
- return not any
- end,
-}
-
--- register custom predicates (overwrite existing; needed for CI)
-
----@param match table
----@param pred any[]
----@return boolean
-query.add_predicate('kind-eq?', function(match, _, _, pred)
- return predicates['kind-eq'](match, pred, false)
-end, { force = true })
-
----@param match table
----@param pred any[]
----@return boolean
-query.add_predicate('any-kind-eq?', function(match, _, _, pred)
- return predicates['kind-eq'](match, pred, true)
-end, { force = true })
diff --git a/runtime/queries/ada/folds.scm b/queries/ada/folds.scm
similarity index 100%
rename from runtime/queries/ada/folds.scm
rename to queries/ada/folds.scm
diff --git a/runtime/queries/ada/highlights.scm b/queries/ada/highlights.scm
similarity index 100%
rename from runtime/queries/ada/highlights.scm
rename to queries/ada/highlights.scm
diff --git a/runtime/queries/ada/injections.scm b/queries/ada/injections.scm
similarity index 100%
rename from runtime/queries/ada/injections.scm
rename to queries/ada/injections.scm
diff --git a/runtime/queries/ada/locals.scm b/queries/ada/locals.scm
similarity index 100%
rename from runtime/queries/ada/locals.scm
rename to queries/ada/locals.scm
diff --git a/runtime/queries/agda/folds.scm b/queries/agda/folds.scm
similarity index 100%
rename from runtime/queries/agda/folds.scm
rename to queries/agda/folds.scm
diff --git a/runtime/queries/agda/highlights.scm b/queries/agda/highlights.scm
similarity index 100%
rename from runtime/queries/agda/highlights.scm
rename to queries/agda/highlights.scm
diff --git a/runtime/queries/agda/injections.scm b/queries/agda/injections.scm
similarity index 100%
rename from runtime/queries/agda/injections.scm
rename to queries/agda/injections.scm
diff --git a/runtime/queries/angular/folds.scm b/queries/angular/folds.scm
similarity index 100%
rename from runtime/queries/angular/folds.scm
rename to queries/angular/folds.scm
diff --git a/runtime/queries/angular/highlights.scm b/queries/angular/highlights.scm
similarity index 91%
rename from runtime/queries/angular/highlights.scm
rename to queries/angular/highlights.scm
index d248d2e4c..3783933f8 100644
--- a/runtime/queries/angular/highlights.scm
+++ b/queries/angular/highlights.scm
@@ -2,11 +2,12 @@
(identifier) @variable
-(style_unit) @variable
-
(pipe_operator) @operator
-(string) @string
+[
+ (string)
+ (static_member_expression)
+] @string
(number) @number
@@ -28,12 +29,6 @@
(binding_name
(identifier) @keyword)
-(class_binding
- [
- (identifier)
- (class_name)
- ] @keyword)
-
(event_binding
(binding_name
(identifier) @keyword))
@@ -113,14 +108,6 @@
"}}"
] @punctuation.special
-(template_substitution
- [
- "${"
- "}"
- ] @punctuation.special)
-
-(template_chars) @string
-
[
";"
"."
diff --git a/runtime/queries/angular/indents.scm b/queries/angular/indents.scm
similarity index 100%
rename from runtime/queries/angular/indents.scm
rename to queries/angular/indents.scm
diff --git a/runtime/queries/angular/injections.scm b/queries/angular/injections.scm
similarity index 100%
rename from runtime/queries/angular/injections.scm
rename to queries/angular/injections.scm
diff --git a/runtime/queries/angular/locals.scm b/queries/angular/locals.scm
similarity index 100%
rename from runtime/queries/angular/locals.scm
rename to queries/angular/locals.scm
diff --git a/runtime/queries/apex/folds.scm b/queries/apex/folds.scm
similarity index 100%
rename from runtime/queries/apex/folds.scm
rename to queries/apex/folds.scm
diff --git a/runtime/queries/apex/highlights.scm b/queries/apex/highlights.scm
similarity index 100%
rename from runtime/queries/apex/highlights.scm
rename to queries/apex/highlights.scm
diff --git a/runtime/queries/asm/injections.scm b/queries/apex/injections.scm
similarity index 100%
rename from runtime/queries/asm/injections.scm
rename to queries/apex/injections.scm
diff --git a/runtime/queries/apex/locals.scm b/queries/apex/locals.scm
similarity index 95%
rename from runtime/queries/apex/locals.scm
rename to queries/apex/locals.scm
index d758f14cf..2457752fa 100644
--- a/runtime/queries/apex/locals.scm
+++ b/queries/apex/locals.scm
@@ -57,6 +57,9 @@
(formal_parameter
name: (identifier) @local.definition.parameter)
+(catch_formal_parameter
+ name: (identifier) @local.definition.parameter)
+
(field_declaration
declarator: (variable_declarator
name: (identifier) @local.definition.field))
diff --git a/runtime/queries/arduino/folds.scm b/queries/arduino/folds.scm
similarity index 100%
rename from runtime/queries/arduino/folds.scm
rename to queries/arduino/folds.scm
diff --git a/runtime/queries/arduino/highlights.scm b/queries/arduino/highlights.scm
similarity index 100%
rename from runtime/queries/arduino/highlights.scm
rename to queries/arduino/highlights.scm
diff --git a/runtime/queries/arduino/indents.scm b/queries/arduino/indents.scm
similarity index 100%
rename from runtime/queries/arduino/indents.scm
rename to queries/arduino/indents.scm
diff --git a/queries/arduino/injections.scm b/queries/arduino/injections.scm
new file mode 100644
index 000000000..b637d9b2b
--- /dev/null
+++ b/queries/arduino/injections.scm
@@ -0,0 +1,5 @@
+((preproc_arg) @injection.content
+ (#set! injection.language "arduino"))
+
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/arduino/locals.scm b/queries/arduino/locals.scm
similarity index 100%
rename from runtime/queries/arduino/locals.scm
rename to queries/arduino/locals.scm
diff --git a/runtime/queries/asm/highlights.scm b/queries/asm/highlights.scm
similarity index 100%
rename from runtime/queries/asm/highlights.scm
rename to queries/asm/highlights.scm
diff --git a/runtime/queries/c3/injections.scm b/queries/asm/injections.scm
similarity index 100%
rename from runtime/queries/c3/injections.scm
rename to queries/asm/injections.scm
diff --git a/runtime/queries/astro/folds.scm b/queries/astro/folds.scm
similarity index 100%
rename from runtime/queries/astro/folds.scm
rename to queries/astro/folds.scm
diff --git a/runtime/queries/astro/highlights.scm b/queries/astro/highlights.scm
similarity index 84%
rename from runtime/queries/astro/highlights.scm
rename to queries/astro/highlights.scm
index e2917ad4d..e4baf5380 100644
--- a/runtime/queries/astro/highlights.scm
+++ b/queries/astro/highlights.scm
@@ -20,10 +20,6 @@
(tag_name) @type)
(#lua-match? @type "^[A-Z]"))
-((self_closing_tag
- (tag_name) @type)
- (#lua-match? @type "^[A-Z]"))
-
((erroneous_end_tag
(erroneous_end_tag_name) @type)
(#lua-match? @type "^[A-Z]"))
diff --git a/runtime/queries/astro/indents.scm b/queries/astro/indents.scm
similarity index 100%
rename from runtime/queries/astro/indents.scm
rename to queries/astro/indents.scm
diff --git a/runtime/queries/astro/injections.scm b/queries/astro/injections.scm
similarity index 100%
rename from runtime/queries/astro/injections.scm
rename to queries/astro/injections.scm
diff --git a/runtime/queries/astro/locals.scm b/queries/astro/locals.scm
similarity index 100%
rename from runtime/queries/astro/locals.scm
rename to queries/astro/locals.scm
diff --git a/runtime/queries/authzed/highlights.scm b/queries/authzed/highlights.scm
similarity index 100%
rename from runtime/queries/authzed/highlights.scm
rename to queries/authzed/highlights.scm
diff --git a/runtime/queries/authzed/injections.scm b/queries/authzed/injections.scm
similarity index 100%
rename from runtime/queries/authzed/injections.scm
rename to queries/authzed/injections.scm
diff --git a/runtime/queries/awk/highlights.scm b/queries/awk/highlights.scm
similarity index 87%
rename from runtime/queries/awk/highlights.scm
rename to queries/awk/highlights.scm
index 51ec9c08e..904cf2a9a 100644
--- a/runtime/queries/awk/highlights.scm
+++ b/queries/awk/highlights.scm
@@ -53,40 +53,6 @@
(identifier) @variable.parameter))
[
- "asort"
- "asorti"
- "bindtextdomain"
- "compl"
- "cos"
- "dcgettext"
- "dcngettext"
- "exp"
- "gensub"
- "gsub"
- "index"
- "int"
- "isarray"
- "length"
- "log"
- "lshift"
- "match"
- "mktime"
- "patsplit"
- "rand"
- "rshift"
- "sin"
- "split"
- "sprintf"
- "sqrt"
- "srand"
- "strftime"
- "strtonum"
- "sub"
- "substr"
- "systime"
- "tolower"
- "toupper"
- "typeof"
"print"
"printf"
"getline"
diff --git a/runtime/queries/awk/injections.scm b/queries/awk/injections.scm
similarity index 100%
rename from runtime/queries/awk/injections.scm
rename to queries/awk/injections.scm
diff --git a/runtime/queries/bash/folds.scm b/queries/bash/folds.scm
similarity index 100%
rename from runtime/queries/bash/folds.scm
rename to queries/bash/folds.scm
diff --git a/runtime/queries/bash/highlights.scm b/queries/bash/highlights.scm
similarity index 56%
rename from runtime/queries/bash/highlights.scm
rename to queries/bash/highlights.scm
index 69bfaad1a..0e192bbcd 100644
--- a/runtime/queries/bash/highlights.scm
+++ b/queries/bash/highlights.scm
@@ -105,6 +105,21 @@
(special_variable_name) @constant
+; trap -l
+((word) @constant.builtin
+ (#any-of? @constant.builtin
+ "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT" "SIGBUS" "SIGFPE" "SIGKILL" "SIGUSR1"
+ "SIGSEGV" "SIGUSR2" "SIGPIPE" "SIGALRM" "SIGTERM" "SIGSTKFLT" "SIGCHLD" "SIGCONT" "SIGSTOP"
+ "SIGTSTP" "SIGTTIN" "SIGTTOU" "SIGURG" "SIGXCPU" "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH"
+ "SIGIO" "SIGPWR" "SIGSYS" "SIGRTMIN" "SIGRTMIN+1" "SIGRTMIN+2" "SIGRTMIN+3" "SIGRTMIN+4"
+ "SIGRTMIN+5" "SIGRTMIN+6" "SIGRTMIN+7" "SIGRTMIN+8" "SIGRTMIN+9" "SIGRTMIN+10" "SIGRTMIN+11"
+ "SIGRTMIN+12" "SIGRTMIN+13" "SIGRTMIN+14" "SIGRTMIN+15" "SIGRTMAX-14" "SIGRTMAX-13"
+ "SIGRTMAX-12" "SIGRTMAX-11" "SIGRTMAX-10" "SIGRTMAX-9" "SIGRTMAX-8" "SIGRTMAX-7" "SIGRTMAX-6"
+ "SIGRTMAX-5" "SIGRTMAX-4" "SIGRTMAX-3" "SIGRTMAX-2" "SIGRTMAX-1" "SIGRTMAX"))
+
+((word) @boolean
+ (#any-of? @boolean "true" "false"))
+
(comment) @comment @spell
(test_operator) @operator
@@ -154,11 +169,11 @@
(command_name
(word) @function.builtin
(#any-of? @function.builtin
- "." ":" "alias" "bg" "bind" "break" "builtin" "caller" "cd" "command" "compgen" "complete"
- "compopt" "continue" "coproc" "dirs" "disown" "echo" "enable" "eval" "exec" "exit" "false" "fc"
- "fg" "getopts" "hash" "help" "history" "jobs" "kill" "let" "logout" "mapfile" "popd" "printf"
- "pushd" "pwd" "read" "readarray" "return" "set" "shift" "shopt" "source" "suspend" "test" "time"
- "times" "trap" "true" "type" "typeset" "ulimit" "umask" "unalias" "wait"))
+ "alias" "bg" "bind" "break" "builtin" "caller" "cd" "command" "compgen" "complete" "compopt"
+ "continue" "coproc" "dirs" "disown" "echo" "enable" "eval" "exec" "exit" "fc" "fg" "getopts"
+ "hash" "help" "history" "jobs" "kill" "let" "logout" "mapfile" "popd" "printf" "pushd" "pwd"
+ "read" "readarray" "return" "set" "shift" "shopt" "source" "suspend" "test" "time" "times"
+ "trap" "type" "typeset" "ulimit" "umask" "unalias" "wait"))
(command
argument: [
@@ -167,30 +182,6 @@
(word) @variable.parameter)
])
-; help trap
-(command
- name: (command_name
- (word) @_command)
- argument: (word) @string.special
- (#eq? @_command "trap")
- (#any-of? @string.special "EXIT" "DEBUG" "RETURN" "ERR"))
-
-; trap -l
-(command
- name: (command_name
- (word) @_command)
- argument: (word) @string.special
- (#any-of? @_command "trap" "kill")
- (#any-of? @string.special
- "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT" "SIGBUS" "SIGFPE" "SIGKILL" "SIGUSR1"
- "SIGSEGV" "SIGUSR2" "SIGPIPE" "SIGALRM" "SIGTERM" "SIGSTKFLT" "SIGCHLD" "SIGCONT" "SIGSTOP"
- "SIGTSTP" "SIGTTIN" "SIGTTOU" "SIGURG" "SIGXCPU" "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH"
- "SIGIO" "SIGPWR" "SIGSYS" "SIGRTMIN" "SIGRTMIN+1" "SIGRTMIN+2" "SIGRTMIN+3" "SIGRTMIN+4"
- "SIGRTMIN+5" "SIGRTMIN+6" "SIGRTMIN+7" "SIGRTMIN+8" "SIGRTMIN+9" "SIGRTMIN+10" "SIGRTMIN+11"
- "SIGRTMIN+12" "SIGRTMIN+13" "SIGRTMIN+14" "SIGRTMIN+15" "SIGRTMAX-14" "SIGRTMAX-13"
- "SIGRTMAX-12" "SIGRTMAX-11" "SIGRTMAX-10" "SIGRTMAX-9" "SIGRTMAX-8" "SIGRTMAX-7" "SIGRTMAX-6"
- "SIGRTMAX-5" "SIGRTMAX-4" "SIGRTMAX-3" "SIGRTMAX-2" "SIGRTMAX-1" "SIGRTMAX"))
-
(declaration_command
(word) @variable.parameter)
@@ -199,11 +190,11 @@
(number) @number
-(file_redirect
- (word) @string.special.path)
+((word) @number
+ (#lua-match? @number "^[0-9]+$"))
-(herestring_redirect
- (word) @string)
+(file_redirect
+ destination: (word) @variable.parameter)
(file_descriptor) @operator
@@ -234,36 +225,6 @@
((variable_name) @constant
(#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
-((variable_name) @variable.builtin
- (#any-of? @variable.builtin
- ; https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Variables.html
- "CDPATH" "HOME" "IFS" "MAIL" "MAILPATH" "OPTARG" "OPTIND" "PATH" "PS1" "PS2"
- ; https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html
- "_" "BASH" "BASHOPTS" "BASHPID" "BASH_ALIASES" "BASH_ARGC" "BASH_ARGV" "BASH_ARGV0" "BASH_CMDS"
- "BASH_COMMAND" "BASH_COMPAT" "BASH_ENV" "BASH_EXECUTION_STRING" "BASH_LINENO"
- "BASH_LOADABLES_PATH" "BASH_REMATCH" "BASH_SOURCE" "BASH_SUBSHELL" "BASH_VERSINFO"
- "BASH_VERSION" "BASH_XTRACEFD" "CHILD_MAX" "COLUMNS" "COMP_CWORD" "COMP_LINE" "COMP_POINT"
- "COMP_TYPE" "COMP_KEY" "COMP_WORDBREAKS" "COMP_WORDS" "COMPREPLY" "COPROC" "DIRSTACK" "EMACS"
- "ENV" "EPOCHREALTIME" "EPOCHSECONDS" "EUID" "EXECIGNORE" "FCEDIT" "FIGNORE" "FUNCNAME"
- "FUNCNEST" "GLOBIGNORE" "GROUPS" "histchars" "HISTCMD" "HISTCONTROL" "HISTFILE" "HISTFILESIZE"
- "HISTIGNORE" "HISTSIZE" "HISTTIMEFORMAT" "HOSTFILE" "HOSTNAME" "HOSTTYPE" "IGNOREEOF" "INPUTRC"
- "INSIDE_EMACS" "LANG" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_NUMERIC" "LC_TIME"
- "LINENO" "LINES" "MACHTYPE" "MAILCHECK" "MAPFILE" "OLDPWD" "OPTERR" "OSTYPE" "PIPESTATUS"
- "POSIXLY_CORRECT" "PPID" "PROMPT_COMMAND" "PROMPT_DIRTRIM" "PS0" "PS3" "PS4" "PWD" "RANDOM"
- "READLINE_ARGUMENT" "READLINE_LINE" "READLINE_MARK" "READLINE_POINT" "REPLY" "SECONDS" "SHELL"
- "SHELLOPTS" "SHLVL" "SRANDOM" "TIMEFORMAT" "TMOUT" "TMPDIR" "UID"))
-
-((command
- name: (command_name
- (word) @_printf)
- .
- argument: (word) @_v
- .
- argument: (word) @variable)
- (#eq? @_printf "printf")
- (#eq? @_v "-v")
- (#lua-match? @variable "^[a-zA-Z_][a-zA-Z0-9_]*$"))
-
(case_item
value: (word) @variable.parameter)
@@ -275,4 +236,4 @@
((program
.
(comment) @keyword.directive @nospell)
- (#lua-match? @keyword.directive "^#![ \t]*/"))
+ (#lua-match? @keyword.directive "^#!/"))
diff --git a/runtime/queries/zsh/injections.scm b/queries/bash/injections.scm
similarity index 73%
rename from runtime/queries/zsh/injections.scm
rename to queries/bash/injections.scm
index 3e21206ab..328630808 100644
--- a/runtime/queries/zsh/injections.scm
+++ b/queries/bash/injections.scm
@@ -2,28 +2,28 @@
(#set! injection.language "comment"))
((regex) @injection.content
- (#not-lua-match? @injection.content "%${.*}")
(#set! injection.language "regex"))
-(heredoc_redirect
+((heredoc_redirect
(heredoc_body) @injection.content
(heredoc_end) @injection.language)
+ (#downcase! @injection.language))
; printf 'format'
((command
name: (command_name) @_command
.
argument: [
- (string) @injection.content
+ (string
+ (string_content) @injection.content)
(concatenation
- (string) @injection.content)
+ (string
+ (string_content) @injection.content))
(raw_string) @injection.content
(concatenation
(raw_string) @injection.content)
])
(#eq? @_command "printf")
- (#offset! @injection.content 0 1 0 -1)
- (#set! injection.include-children)
(#set! injection.language "printf"))
; printf -v var 'format'
@@ -34,17 +34,17 @@
(_)
.
argument: [
- (string) @injection.content
+ (string
+ (string_content) @injection.content)
(concatenation
- (string) @injection.content)
+ (string
+ (string_content) @injection.content))
(raw_string) @injection.content
(concatenation
(raw_string) @injection.content)
])
(#eq? @_command "printf")
(#eq? @_arg "-v")
- (#offset! @injection.content 0 1 0 -1)
- (#set! injection.include-children)
(#set! injection.language "printf"))
; printf -- 'format'
@@ -53,17 +53,17 @@
argument: (word) @_arg
.
argument: [
- (string) @injection.content
+ (string
+ (string_content) @injection.content)
(concatenation
- (string) @injection.content)
+ (string
+ (string_content) @injection.content))
(raw_string) @injection.content
(concatenation
(raw_string) @injection.content)
])
(#eq? @_command "printf")
(#eq? @_arg "--")
- (#offset! @injection.content 0 1 0 -1)
- (#set! injection.include-children)
(#set! injection.language "printf"))
((command
diff --git a/runtime/queries/bash/locals.scm b/queries/bash/locals.scm
similarity index 100%
rename from runtime/queries/bash/locals.scm
rename to queries/bash/locals.scm
diff --git a/runtime/queries/bass/folds.scm b/queries/bass/folds.scm
similarity index 100%
rename from runtime/queries/bass/folds.scm
rename to queries/bass/folds.scm
diff --git a/runtime/queries/bass/highlights.scm b/queries/bass/highlights.scm
similarity index 98%
rename from runtime/queries/bass/highlights.scm
rename to queries/bass/highlights.scm
index 8508de9ab..f84993af1 100644
--- a/runtime/queries/bass/highlights.scm
+++ b/queries/bass/highlights.scm
@@ -79,7 +79,7 @@
; Repeats
((symbol) @keyword.repeat
- (#eq? @keyword.repeat "each"))
+ (#any-of? @keyword.repeat "each"))
; Operators
((symbol) @operator
diff --git a/runtime/queries/bass/indents.scm b/queries/bass/indents.scm
similarity index 100%
rename from runtime/queries/bass/indents.scm
rename to queries/bass/indents.scm
diff --git a/runtime/queries/bass/injections.scm b/queries/bass/injections.scm
similarity index 100%
rename from runtime/queries/bass/injections.scm
rename to queries/bass/injections.scm
diff --git a/runtime/queries/bass/locals.scm b/queries/bass/locals.scm
similarity index 100%
rename from runtime/queries/bass/locals.scm
rename to queries/bass/locals.scm
diff --git a/runtime/queries/beancount/folds.scm b/queries/beancount/folds.scm
similarity index 100%
rename from runtime/queries/beancount/folds.scm
rename to queries/beancount/folds.scm
diff --git a/runtime/queries/beancount/highlights.scm b/queries/beancount/highlights.scm
similarity index 100%
rename from runtime/queries/beancount/highlights.scm
rename to queries/beancount/highlights.scm
diff --git a/runtime/queries/beancount/injections.scm b/queries/beancount/injections.scm
similarity index 100%
rename from runtime/queries/beancount/injections.scm
rename to queries/beancount/injections.scm
diff --git a/runtime/queries/bibtex/folds.scm b/queries/bibtex/folds.scm
similarity index 100%
rename from runtime/queries/bibtex/folds.scm
rename to queries/bibtex/folds.scm
diff --git a/runtime/queries/bibtex/highlights.scm b/queries/bibtex/highlights.scm
similarity index 73%
rename from runtime/queries/bibtex/highlights.scm
rename to queries/bibtex/highlights.scm
index 2231a17db..a82b371ae 100644
--- a/runtime/queries/bibtex/highlights.scm
+++ b/queries/bibtex/highlights.scm
@@ -22,7 +22,7 @@
(number) @number
(field
- name: (identifier) @property)
+ name: (identifier) @variable.member)
(token
(identifier) @variable.parameter)
@@ -32,17 +32,10 @@
(quote_word)
] @string
-((field
- name: (identifier) @_url
- value: (value
- (token
- (brace_word) @string.special.url)))
- (#any-of? @_url "url" "doi"))
-
[
(key_brace)
(key_paren)
-] @markup.link.label
+] @string.special.symbol
(string
name: (identifier) @constant)
diff --git a/runtime/queries/bibtex/indents.scm b/queries/bibtex/indents.scm
similarity index 100%
rename from runtime/queries/bibtex/indents.scm
rename to queries/bibtex/indents.scm
diff --git a/runtime/queries/bibtex/injections.scm b/queries/bibtex/injections.scm
similarity index 100%
rename from runtime/queries/bibtex/injections.scm
rename to queries/bibtex/injections.scm
diff --git a/runtime/queries/bicep/folds.scm b/queries/bicep/folds.scm
similarity index 100%
rename from runtime/queries/bicep/folds.scm
rename to queries/bicep/folds.scm
diff --git a/runtime/queries/bicep/highlights.scm b/queries/bicep/highlights.scm
similarity index 100%
rename from runtime/queries/bicep/highlights.scm
rename to queries/bicep/highlights.scm
diff --git a/runtime/queries/bicep/indents.scm b/queries/bicep/indents.scm
similarity index 100%
rename from runtime/queries/bicep/indents.scm
rename to queries/bicep/indents.scm
diff --git a/runtime/queries/bicep/injections.scm b/queries/bicep/injections.scm
similarity index 100%
rename from runtime/queries/bicep/injections.scm
rename to queries/bicep/injections.scm
diff --git a/runtime/queries/bicep/locals.scm b/queries/bicep/locals.scm
similarity index 100%
rename from runtime/queries/bicep/locals.scm
rename to queries/bicep/locals.scm
diff --git a/runtime/queries/bitbake/folds.scm b/queries/bitbake/folds.scm
similarity index 100%
rename from runtime/queries/bitbake/folds.scm
rename to queries/bitbake/folds.scm
diff --git a/runtime/queries/bitbake/highlights.scm b/queries/bitbake/highlights.scm
similarity index 99%
rename from runtime/queries/bitbake/highlights.scm
rename to queries/bitbake/highlights.scm
index e10ae705b..c7316de6e 100644
--- a/runtime/queries/bitbake/highlights.scm
+++ b/queries/bitbake/highlights.scm
@@ -281,6 +281,7 @@
"=."
"-"
"-="
+ ":="
"!="
"*"
"**"
diff --git a/runtime/queries/bitbake/indents.scm b/queries/bitbake/indents.scm
similarity index 100%
rename from runtime/queries/bitbake/indents.scm
rename to queries/bitbake/indents.scm
diff --git a/runtime/queries/bitbake/injections.scm b/queries/bitbake/injections.scm
similarity index 100%
rename from runtime/queries/bitbake/injections.scm
rename to queries/bitbake/injections.scm
diff --git a/runtime/queries/bitbake/locals.scm b/queries/bitbake/locals.scm
similarity index 100%
rename from runtime/queries/bitbake/locals.scm
rename to queries/bitbake/locals.scm
diff --git a/queries/blueprint/highlights.scm b/queries/blueprint/highlights.scm
new file mode 100644
index 000000000..f3c39f232
--- /dev/null
+++ b/queries/blueprint/highlights.scm
@@ -0,0 +1,75 @@
+(object_id) @variable
+
+(string) @string
+
+(escape_sequence) @string.escape
+
+(comment) @comment @spell
+
+(constant) @constant.builtin
+
+(boolean) @boolean
+
+(using) @keyword.import
+
+(template) @keyword
+
+(decorator) @attribute
+
+(property_definition
+ (property_name) @property)
+
+(object) @type
+
+(signal_binding
+ (signal_name) @function.builtin)
+
+(signal_binding
+ (function
+ (identifier)) @function)
+
+(signal_binding
+ "swapped" @keyword)
+
+(styles_list
+ "styles" @function.macro)
+
+(layout_definition
+ "layout" @function.macro)
+
+(gettext_string
+ "_" @function.builtin)
+
+(menu_definition
+ "menu" @keyword)
+
+(menu_section
+ "section" @keyword)
+
+(menu_item
+ "item" @function.macro)
+
+(import_statement
+ (gobject_library) @module)
+
+(import_statement
+ (version_number) @number.float)
+
+(float) @number.float
+
+(number) @number
+
+[
+ ";"
+ "."
+ ","
+] @punctuation.delimiter
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
diff --git a/runtime/queries/bp/injections.scm b/queries/blueprint/injections.scm
similarity index 100%
rename from runtime/queries/bp/injections.scm
rename to queries/blueprint/injections.scm
diff --git a/runtime/queries/bp/folds.scm b/queries/bp/folds.scm
similarity index 100%
rename from runtime/queries/bp/folds.scm
rename to queries/bp/folds.scm
diff --git a/runtime/queries/bp/highlights.scm b/queries/bp/highlights.scm
similarity index 100%
rename from runtime/queries/bp/highlights.scm
rename to queries/bp/highlights.scm
diff --git a/runtime/queries/bp/indents.scm b/queries/bp/indents.scm
similarity index 100%
rename from runtime/queries/bp/indents.scm
rename to queries/bp/indents.scm
diff --git a/runtime/queries/brightscript/injections.scm b/queries/bp/injections.scm
similarity index 100%
rename from runtime/queries/brightscript/injections.scm
rename to queries/bp/injections.scm
diff --git a/runtime/queries/bp/locals.scm b/queries/bp/locals.scm
similarity index 100%
rename from runtime/queries/bp/locals.scm
rename to queries/bp/locals.scm
diff --git a/runtime/queries/c/folds.scm b/queries/c/folds.scm
similarity index 100%
rename from runtime/queries/c/folds.scm
rename to queries/c/folds.scm
diff --git a/runtime/queries/c/highlights.scm b/queries/c/highlights.scm
similarity index 98%
rename from runtime/queries/c/highlights.scm
rename to queries/c/highlights.scm
index 442343abf..bd6857fd1 100644
--- a/runtime/queries/c/highlights.scm
+++ b/queries/c/highlights.scm
@@ -65,7 +65,6 @@
";"
":"
","
- "."
"::"
] @punctuation.delimiter
@@ -94,6 +93,7 @@
"<<"
">>"
"->"
+ "."
"<"
"<="
">="
@@ -149,7 +149,7 @@
((field_expression
(field_identifier) @property) @_parent
- (#not-has-parent? @_parent function_declarator call_expression))
+ (#not-has-parent? @_parent template_method function_declarator call_expression))
(field_designator) @property
diff --git a/runtime/queries/c/indents.scm b/queries/c/indents.scm
similarity index 100%
rename from runtime/queries/c/indents.scm
rename to queries/c/indents.scm
diff --git a/runtime/queries/c/injections.scm b/queries/c/injections.scm
similarity index 96%
rename from runtime/queries/c/injections.scm
rename to queries/c/injections.scm
index ebedc1ec3..77b4d7a86 100644
--- a/runtime/queries/c/injections.scm
+++ b/queries/c/injections.scm
@@ -1,5 +1,5 @@
((preproc_arg) @injection.content
- (#set! injection.self))
+ (#set! injection.language "c"))
((comment) @injection.content
(#set! injection.language "comment"))
@@ -9,7 +9,7 @@
(#set! injection.language "re2c"))
((comment) @injection.content
- (#lua-match? @injection.content "/[*/][!*/][^a-zA-Z]")
+ (#lua-match? @injection.content "/[*\/][!*\/][^a-zA-Z]")
(#set! injection.language "doxygen"))
((call_expression
diff --git a/runtime/queries/c/locals.scm b/queries/c/locals.scm
similarity index 100%
rename from runtime/queries/c/locals.scm
rename to queries/c/locals.scm
diff --git a/runtime/queries/c_sharp/folds.scm b/queries/c_sharp/folds.scm
similarity index 100%
rename from runtime/queries/c_sharp/folds.scm
rename to queries/c_sharp/folds.scm
diff --git a/runtime/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm
similarity index 97%
rename from runtime/queries/c_sharp/highlights.scm
rename to queries/c_sharp/highlights.scm
index 75aa3f847..f23d7ec65 100644
--- a/runtime/queries/c_sharp/highlights.scm
+++ b/queries/c_sharp/highlights.scm
@@ -90,9 +90,6 @@
(parameter
name: (identifier) @variable.parameter)
-(parameter
- (modifier) @keyword.modifier)
-
(parameter_list
name: (identifier) @variable.parameter)
@@ -193,9 +190,6 @@
(enum_declaration
name: (identifier) @type)
-(delegate_declaration
- name: (identifier) @type)
-
(enum_member_declaration
name: (identifier) @variable.member)
@@ -327,9 +321,6 @@
(lambda_expression
type: (identifier) @type)
-(lambda_expression
- (modifier) @keyword.modifier)
-
(as_expression
right: (identifier) @type)
@@ -448,7 +439,6 @@
"."
","
":"
- "::"
] @punctuation.delimiter
(conditional_expression
@@ -468,12 +458,6 @@
(interpolation_brace) @punctuation.special
-(type_parameter_list
- [
- "<"
- ">"
- ] @punctuation.bracket)
-
(type_argument_list
[
"<"
diff --git a/runtime/queries/c_sharp/injections.scm b/queries/c_sharp/injections.scm
similarity index 100%
rename from runtime/queries/c_sharp/injections.scm
rename to queries/c_sharp/injections.scm
diff --git a/runtime/queries/c_sharp/locals.scm b/queries/c_sharp/locals.scm
similarity index 100%
rename from runtime/queries/c_sharp/locals.scm
rename to queries/c_sharp/locals.scm
diff --git a/runtime/queries/cairo/folds.scm b/queries/cairo/folds.scm
similarity index 100%
rename from runtime/queries/cairo/folds.scm
rename to queries/cairo/folds.scm
diff --git a/runtime/queries/cairo/highlights.scm b/queries/cairo/highlights.scm
similarity index 100%
rename from runtime/queries/cairo/highlights.scm
rename to queries/cairo/highlights.scm
diff --git a/runtime/queries/cairo/indents.scm b/queries/cairo/indents.scm
similarity index 100%
rename from runtime/queries/cairo/indents.scm
rename to queries/cairo/indents.scm
diff --git a/runtime/queries/cairo/injections.scm b/queries/cairo/injections.scm
similarity index 100%
rename from runtime/queries/cairo/injections.scm
rename to queries/cairo/injections.scm
diff --git a/runtime/queries/cairo/locals.scm b/queries/cairo/locals.scm
similarity index 100%
rename from runtime/queries/cairo/locals.scm
rename to queries/cairo/locals.scm
diff --git a/runtime/queries/capnp/folds.scm b/queries/capnp/folds.scm
similarity index 100%
rename from runtime/queries/capnp/folds.scm
rename to queries/capnp/folds.scm
diff --git a/runtime/queries/capnp/highlights.scm b/queries/capnp/highlights.scm
similarity index 100%
rename from runtime/queries/capnp/highlights.scm
rename to queries/capnp/highlights.scm
diff --git a/runtime/queries/capnp/indents.scm b/queries/capnp/indents.scm
similarity index 100%
rename from runtime/queries/capnp/indents.scm
rename to queries/capnp/indents.scm
diff --git a/runtime/queries/caddy/injections.scm b/queries/capnp/injections.scm
similarity index 100%
rename from runtime/queries/caddy/injections.scm
rename to queries/capnp/injections.scm
diff --git a/runtime/queries/capnp/locals.scm b/queries/capnp/locals.scm
similarity index 100%
rename from runtime/queries/capnp/locals.scm
rename to queries/capnp/locals.scm
diff --git a/runtime/queries/chatito/folds.scm b/queries/chatito/folds.scm
similarity index 100%
rename from runtime/queries/chatito/folds.scm
rename to queries/chatito/folds.scm
diff --git a/runtime/queries/chatito/highlights.scm b/queries/chatito/highlights.scm
similarity index 97%
rename from runtime/queries/chatito/highlights.scm
rename to queries/chatito/highlights.scm
index e756064b3..47113f2cf 100644
--- a/runtime/queries/chatito/highlights.scm
+++ b/queries/chatito/highlights.scm
@@ -11,7 +11,7 @@
"," @punctuation.delimiter
-eq: _ @operator
+(eq) @operator
([
"\""
diff --git a/runtime/queries/chatito/indents.scm b/queries/chatito/indents.scm
similarity index 100%
rename from runtime/queries/chatito/indents.scm
rename to queries/chatito/indents.scm
diff --git a/runtime/queries/capnp/injections.scm b/queries/chatito/injections.scm
similarity index 100%
rename from runtime/queries/capnp/injections.scm
rename to queries/chatito/injections.scm
diff --git a/runtime/queries/chatito/locals.scm b/queries/chatito/locals.scm
similarity index 100%
rename from runtime/queries/chatito/locals.scm
rename to queries/chatito/locals.scm
diff --git a/runtime/queries/clojure/folds.scm b/queries/clojure/folds.scm
similarity index 100%
rename from runtime/queries/clojure/folds.scm
rename to queries/clojure/folds.scm
diff --git a/runtime/queries/clojure/highlights.scm b/queries/clojure/highlights.scm
similarity index 100%
rename from runtime/queries/clojure/highlights.scm
rename to queries/clojure/highlights.scm
diff --git a/runtime/queries/chatito/injections.scm b/queries/clojure/injections.scm
similarity index 100%
rename from runtime/queries/chatito/injections.scm
rename to queries/clojure/injections.scm
diff --git a/runtime/queries/clojure/locals.scm b/queries/clojure/locals.scm
similarity index 100%
rename from runtime/queries/clojure/locals.scm
rename to queries/clojure/locals.scm
diff --git a/runtime/queries/cmake/folds.scm b/queries/cmake/folds.scm
similarity index 100%
rename from runtime/queries/cmake/folds.scm
rename to queries/cmake/folds.scm
diff --git a/runtime/queries/cmake/highlights.scm b/queries/cmake/highlights.scm
similarity index 99%
rename from runtime/queries/cmake/highlights.scm
rename to queries/cmake/highlights.scm
index 41713ea16..fbbf0d542 100644
--- a/runtime/queries/cmake/highlights.scm
+++ b/queries/cmake/highlights.scm
@@ -137,7 +137,7 @@
((argument) @_cache @keyword.modifier
.
(argument) @_type @type
- (#eq? @_cache "CACHE")
+ (#any-of? @_cache "CACHE")
(#any-of? @_type "BOOL" "FILEPATH" "PATH" "STRING" "INTERNAL"))))
(normal_command
diff --git a/runtime/queries/cmake/indents.scm b/queries/cmake/indents.scm
similarity index 100%
rename from runtime/queries/cmake/indents.scm
rename to queries/cmake/indents.scm
diff --git a/runtime/queries/cmake/injections.scm b/queries/cmake/injections.scm
similarity index 100%
rename from runtime/queries/cmake/injections.scm
rename to queries/cmake/injections.scm
diff --git a/runtime/queries/comment/highlights.scm b/queries/comment/highlights.scm
similarity index 100%
rename from runtime/queries/comment/highlights.scm
rename to queries/comment/highlights.scm
diff --git a/runtime/queries/commonlisp/folds.scm b/queries/commonlisp/folds.scm
similarity index 100%
rename from runtime/queries/commonlisp/folds.scm
rename to queries/commonlisp/folds.scm
diff --git a/runtime/queries/commonlisp/highlights.scm b/queries/commonlisp/highlights.scm
similarity index 99%
rename from runtime/queries/commonlisp/highlights.scm
rename to queries/commonlisp/highlights.scm
index dbd41657f..7236c84de 100644
--- a/runtime/queries/commonlisp/highlights.scm
+++ b/queries/commonlisp/highlights.scm
@@ -295,7 +295,8 @@
"clear-output" "assoc-if" "string/=" "princ" "directory-namestring" "stream-error-stream"
"array-element-type" "setq" "copy-seq" "time" "restart-case" "prog*" "shared-initialize"
"array-total-size" "simple-bit-vector-p" "define-method-combination" "write-byte" "constantly"
- "caddar" "print-object" "vector" "throw" "reverse" ">=" "upper-case-p" "nbutlast"))
+ "caddar" "print-object" "vector" "throw" "reverse" ">=" "upper-case-p" "nbutlast")
+ )
(list_lit
.
diff --git a/runtime/queries/commonlisp/injections.scm b/queries/commonlisp/injections.scm
similarity index 100%
rename from runtime/queries/commonlisp/injections.scm
rename to queries/commonlisp/injections.scm
diff --git a/runtime/queries/commonlisp/locals.scm b/queries/commonlisp/locals.scm
similarity index 100%
rename from runtime/queries/commonlisp/locals.scm
rename to queries/commonlisp/locals.scm
diff --git a/runtime/queries/cooklang/highlights.scm b/queries/cooklang/highlights.scm
similarity index 100%
rename from runtime/queries/cooklang/highlights.scm
rename to queries/cooklang/highlights.scm
diff --git a/runtime/queries/circom/injections.scm b/queries/cooklang/injections.scm
similarity index 100%
rename from runtime/queries/circom/injections.scm
rename to queries/cooklang/injections.scm
diff --git a/runtime/queries/corn/folds.scm b/queries/corn/folds.scm
similarity index 100%
rename from runtime/queries/corn/folds.scm
rename to queries/corn/folds.scm
diff --git a/runtime/queries/corn/highlights.scm b/queries/corn/highlights.scm
similarity index 100%
rename from runtime/queries/corn/highlights.scm
rename to queries/corn/highlights.scm
diff --git a/runtime/queries/corn/indents.scm b/queries/corn/indents.scm
similarity index 100%
rename from runtime/queries/corn/indents.scm
rename to queries/corn/indents.scm
diff --git a/runtime/queries/clojure/injections.scm b/queries/corn/injections.scm
similarity index 100%
rename from runtime/queries/clojure/injections.scm
rename to queries/corn/injections.scm
diff --git a/runtime/queries/corn/locals.scm b/queries/corn/locals.scm
similarity index 100%
rename from runtime/queries/corn/locals.scm
rename to queries/corn/locals.scm
diff --git a/runtime/queries/cpon/folds.scm b/queries/cpon/folds.scm
similarity index 100%
rename from runtime/queries/cpon/folds.scm
rename to queries/cpon/folds.scm
diff --git a/runtime/queries/cpon/highlights.scm b/queries/cpon/highlights.scm
similarity index 100%
rename from runtime/queries/cpon/highlights.scm
rename to queries/cpon/highlights.scm
diff --git a/runtime/queries/cpon/indents.scm b/queries/cpon/indents.scm
similarity index 100%
rename from runtime/queries/cpon/indents.scm
rename to queries/cpon/indents.scm
diff --git a/runtime/queries/cooklang/injections.scm b/queries/cpon/injections.scm
similarity index 100%
rename from runtime/queries/cooklang/injections.scm
rename to queries/cpon/injections.scm
diff --git a/runtime/queries/cpon/locals.scm b/queries/cpon/locals.scm
similarity index 100%
rename from runtime/queries/cpon/locals.scm
rename to queries/cpon/locals.scm
diff --git a/runtime/queries/cpp/folds.scm b/queries/cpp/folds.scm
similarity index 100%
rename from runtime/queries/cpp/folds.scm
rename to queries/cpp/folds.scm
diff --git a/runtime/queries/cpp/highlights.scm b/queries/cpp/highlights.scm
similarity index 97%
rename from runtime/queries/cpp/highlights.scm
rename to queries/cpp/highlights.scm
index ac0315275..85ff2dc40 100644
--- a/runtime/queries/cpp/highlights.scm
+++ b/queries/cpp/highlights.scm
@@ -154,11 +154,6 @@
(field_expression
(field_identifier) @function.method.call))
-(call_expression
- (field_expression
- (template_method
- (field_identifier) @function.method.call)))
-
; constructors
((function_declarator
(qualified_identifier
diff --git a/runtime/queries/cpp/indents.scm b/queries/cpp/indents.scm
similarity index 100%
rename from runtime/queries/cpp/indents.scm
rename to queries/cpp/indents.scm
diff --git a/queries/cpp/injections.scm b/queries/cpp/injections.scm
new file mode 100644
index 000000000..6e1657229
--- /dev/null
+++ b/queries/cpp/injections.scm
@@ -0,0 +1,13 @@
+((preproc_arg) @injection.content
+ (#set! injection.language "cpp"))
+
+((comment) @injection.content
+ (#set! injection.language "comment"))
+
+((comment) @injection.content
+ (#lua-match? @injection.content "/[*\/][!*\/][^a-zA-Z]")
+ (#set! injection.language "doxygen"))
+
+(raw_string_literal
+ delimiter: (raw_string_delimiter) @injection.language
+ (raw_string_content) @injection.content)
diff --git a/runtime/queries/cpp/locals.scm b/queries/cpp/locals.scm
similarity index 100%
rename from runtime/queries/cpp/locals.scm
rename to queries/cpp/locals.scm
diff --git a/queries/css/folds.scm b/queries/css/folds.scm
new file mode 100644
index 000000000..dc3c14df9
--- /dev/null
+++ b/queries/css/folds.scm
@@ -0,0 +1,4 @@
+[
+ (rule_set)
+ (import_statement)+
+] @fold
diff --git a/runtime/queries/css/highlights.scm b/queries/css/highlights.scm
similarity index 97%
rename from runtime/queries/css/highlights.scm
rename to queries/css/highlights.scm
index 5b43c014a..acc2b638d 100644
--- a/runtime/queries/css/highlights.scm
+++ b/queries/css/highlights.scm
@@ -27,6 +27,11 @@
(feature_name)
] @property
+[
+ (nesting_selector)
+ (universal_selector)
+] @character.special
+
(function_name) @function
[
@@ -53,11 +58,6 @@
(important) @keyword.modifier
-[
- (nesting_selector)
- (universal_selector)
-] @character.special
-
(attribute_selector
(plain_value) @string)
@@ -72,8 +72,6 @@
(namespace_name) @module
-(keyframes_name) @variable
-
((property_name) @variable
(#lua-match? @variable "^[-][-]"))
diff --git a/runtime/queries/css/indents.scm b/queries/css/indents.scm
similarity index 100%
rename from runtime/queries/css/indents.scm
rename to queries/css/indents.scm
diff --git a/runtime/queries/corn/injections.scm b/queries/css/injections.scm
similarity index 100%
rename from runtime/queries/corn/injections.scm
rename to queries/css/injections.scm
diff --git a/runtime/queries/csv/highlights.scm b/queries/csv/highlights.scm
similarity index 100%
rename from runtime/queries/csv/highlights.scm
rename to queries/csv/highlights.scm
diff --git a/runtime/queries/cuda/folds.scm b/queries/cuda/folds.scm
similarity index 100%
rename from runtime/queries/cuda/folds.scm
rename to queries/cuda/folds.scm
diff --git a/runtime/queries/cuda/highlights.scm b/queries/cuda/highlights.scm
similarity index 100%
rename from runtime/queries/cuda/highlights.scm
rename to queries/cuda/highlights.scm
diff --git a/runtime/queries/cuda/indents.scm b/queries/cuda/indents.scm
similarity index 100%
rename from runtime/queries/cuda/indents.scm
rename to queries/cuda/indents.scm
diff --git a/runtime/queries/pascal/injections.scm b/queries/cuda/injections.scm
similarity index 50%
rename from runtime/queries/pascal/injections.scm
rename to queries/cuda/injections.scm
index 1f6e475c8..0259958c5 100644
--- a/runtime/queries/pascal/injections.scm
+++ b/queries/cuda/injections.scm
@@ -1,5 +1,5 @@
+((preproc_arg) @injection.content
+ (#set! injection.language "cuda"))
+
((comment) @injection.content
(#set! injection.language "comment"))
-
-((asmBody) @injection.content
- (#set! injection.language "asm"))
diff --git a/runtime/queries/cuda/locals.scm b/queries/cuda/locals.scm
similarity index 100%
rename from runtime/queries/cuda/locals.scm
rename to queries/cuda/locals.scm
diff --git a/runtime/queries/cue/folds.scm b/queries/cue/folds.scm
similarity index 100%
rename from runtime/queries/cue/folds.scm
rename to queries/cue/folds.scm
diff --git a/runtime/queries/cue/highlights.scm b/queries/cue/highlights.scm
similarity index 100%
rename from runtime/queries/cue/highlights.scm
rename to queries/cue/highlights.scm
diff --git a/runtime/queries/cue/indents.scm b/queries/cue/indents.scm
similarity index 100%
rename from runtime/queries/cue/indents.scm
rename to queries/cue/indents.scm
diff --git a/runtime/queries/cpon/injections.scm b/queries/cue/injections.scm
similarity index 100%
rename from runtime/queries/cpon/injections.scm
rename to queries/cue/injections.scm
diff --git a/runtime/queries/cue/locals.scm b/queries/cue/locals.scm
similarity index 100%
rename from runtime/queries/cue/locals.scm
rename to queries/cue/locals.scm
diff --git a/runtime/queries/d/folds.scm b/queries/d/folds.scm
similarity index 100%
rename from runtime/queries/d/folds.scm
rename to queries/d/folds.scm
diff --git a/runtime/queries/d/highlights.scm b/queries/d/highlights.scm
similarity index 99%
rename from runtime/queries/d/highlights.scm
rename to queries/d/highlights.scm
index e08b83b45..11d08a1b7 100644
--- a/runtime/queries/d/highlights.scm
+++ b/queries/d/highlights.scm
@@ -263,10 +263,8 @@
(idouble)
(ifloat)
(creal)
+ (double)
(cfloat)
- (string)
- (dstring)
- (wstring)
] @type.builtin
; Functions
diff --git a/runtime/queries/d/indents.scm b/queries/d/indents.scm
similarity index 100%
rename from runtime/queries/d/indents.scm
rename to queries/d/indents.scm
diff --git a/runtime/queries/d/injections.scm b/queries/d/injections.scm
similarity index 100%
rename from runtime/queries/d/injections.scm
rename to queries/d/injections.scm
diff --git a/runtime/queries/d/locals.scm b/queries/d/locals.scm
similarity index 100%
rename from runtime/queries/d/locals.scm
rename to queries/d/locals.scm
diff --git a/runtime/queries/dart/folds.scm b/queries/dart/folds.scm
similarity index 100%
rename from runtime/queries/dart/folds.scm
rename to queries/dart/folds.scm
diff --git a/runtime/queries/dart/highlights.scm b/queries/dart/highlights.scm
similarity index 100%
rename from runtime/queries/dart/highlights.scm
rename to queries/dart/highlights.scm
diff --git a/runtime/queries/dart/indents.scm b/queries/dart/indents.scm
similarity index 100%
rename from runtime/queries/dart/indents.scm
rename to queries/dart/indents.scm
diff --git a/runtime/queries/css/injections.scm b/queries/dart/injections.scm
similarity index 100%
rename from runtime/queries/css/injections.scm
rename to queries/dart/injections.scm
diff --git a/runtime/queries/dart/locals.scm b/queries/dart/locals.scm
similarity index 100%
rename from runtime/queries/dart/locals.scm
rename to queries/dart/locals.scm
diff --git a/runtime/queries/devicetree/folds.scm b/queries/devicetree/folds.scm
similarity index 100%
rename from runtime/queries/devicetree/folds.scm
rename to queries/devicetree/folds.scm
diff --git a/runtime/queries/devicetree/highlights.scm b/queries/devicetree/highlights.scm
similarity index 100%
rename from runtime/queries/devicetree/highlights.scm
rename to queries/devicetree/highlights.scm
diff --git a/runtime/queries/devicetree/indents.scm b/queries/devicetree/indents.scm
similarity index 100%
rename from runtime/queries/devicetree/indents.scm
rename to queries/devicetree/indents.scm
diff --git a/runtime/queries/cue/injections.scm b/queries/devicetree/injections.scm
similarity index 100%
rename from runtime/queries/cue/injections.scm
rename to queries/devicetree/injections.scm
diff --git a/runtime/queries/devicetree/locals.scm b/queries/devicetree/locals.scm
similarity index 100%
rename from runtime/queries/devicetree/locals.scm
rename to queries/devicetree/locals.scm
diff --git a/runtime/queries/dhall/folds.scm b/queries/dhall/folds.scm
similarity index 100%
rename from runtime/queries/dhall/folds.scm
rename to queries/dhall/folds.scm
diff --git a/runtime/queries/dhall/highlights.scm b/queries/dhall/highlights.scm
similarity index 95%
rename from runtime/queries/dhall/highlights.scm
rename to queries/dhall/highlights.scm
index d7a5d0006..efd7fedf2 100644
--- a/runtime/queries/dhall/highlights.scm
+++ b/queries/dhall/highlights.scm
@@ -1,3 +1,4 @@
+; Text
; Imports
(missing_import) @keyword.import
@@ -11,7 +12,6 @@
] @string.special
[
- (import_as_bytes)
(import_as_location)
(import_as_text)
] @type
@@ -92,7 +92,6 @@
(builtin
[
- "Bool"
"Natural"
"Natural/build"
"Natural/fold"
@@ -122,11 +121,8 @@
"Text/replace"
"Optional"
"Date"
- "Date/show"
"Time"
- "Time/show"
"TimeZone"
- "TimeZone/show"
"Type"
"Kind"
"Sort"
@@ -168,10 +164,7 @@
] @keyword.conditional
; Literals
-[
- (text_literal)
- (bytes_literal)
-] @string
+(text_literal) @string
(interpolation
"}" @string)
diff --git a/runtime/queries/dhall/injections.scm b/queries/dhall/injections.scm
similarity index 100%
rename from runtime/queries/dhall/injections.scm
rename to queries/dhall/injections.scm
diff --git a/runtime/queries/diff/folds.scm b/queries/diff/folds.scm
similarity index 100%
rename from runtime/queries/diff/folds.scm
rename to queries/diff/folds.scm
diff --git a/runtime/queries/diff/highlights.scm b/queries/diff/highlights.scm
similarity index 100%
rename from runtime/queries/diff/highlights.scm
rename to queries/diff/highlights.scm
diff --git a/runtime/queries/dart/injections.scm b/queries/diff/injections.scm
similarity index 100%
rename from runtime/queries/dart/injections.scm
rename to queries/diff/injections.scm
diff --git a/runtime/queries/disassembly/highlights.scm b/queries/disassembly/highlights.scm
similarity index 100%
rename from runtime/queries/disassembly/highlights.scm
rename to queries/disassembly/highlights.scm
diff --git a/runtime/queries/disassembly/injections.scm b/queries/disassembly/injections.scm
similarity index 100%
rename from runtime/queries/disassembly/injections.scm
rename to queries/disassembly/injections.scm
diff --git a/runtime/queries/djot/folds.scm b/queries/djot/folds.scm
similarity index 100%
rename from runtime/queries/djot/folds.scm
rename to queries/djot/folds.scm
diff --git a/runtime/queries/djot/highlights.scm b/queries/djot/highlights.scm
similarity index 85%
rename from runtime/queries/djot/highlights.scm
rename to queries/djot/highlights.scm
index 73dd66057..8df7c9269 100644
--- a/runtime/queries/djot/highlights.scm
+++ b/queries/djot/highlights.scm
@@ -1,28 +1,14 @@
-(heading) @markup.heading
+(heading1) @markup.heading.1
-((heading
- (marker) @_heading.marker) @markup.heading.1
- (#eq? @_heading.marker "# "))
+(heading2) @markup.heading.2
-((heading
- (marker) @_heading.marker) @markup.heading.2
- (#eq? @_heading.marker "## "))
+(heading3) @markup.heading.3
-((heading
- (marker) @_heading.marker) @markup.heading.3
- (#eq? @_heading.marker "### "))
+(heading4) @markup.heading.4
-((heading
- (marker) @_heading.marker) @markup.heading.4
- (#eq? @_heading.marker "##### "))
+(heading5) @markup.heading.5
-((heading
- (marker) @_heading.marker) @markup.heading.5
- (#eq? @_heading.marker "###### "))
-
-((heading
- (marker) @_heading.marker) @markup.heading.6
- (#eq? @_heading.marker "####### "))
+(heading6) @markup.heading.6
(thematic_break) @string.special
@@ -162,21 +148,50 @@
(subscript)
] @string.special
+; We need to target tokens specifically because `{=` etc can exist as fallback symbols in
+; regular text, which we don't want to highlight or conceal.
+(highlighted
+ [
+ "{="
+ "=}"
+ ] @punctuation.delimiter
+ (#set! conceal ""))
+
+(insert
+ [
+ "{+"
+ "+}"
+ ] @punctuation.delimiter
+ (#set! conceal ""))
+
+(delete
+ [
+ "{-"
+ "-}"
+ ] @punctuation.delimiter
+ (#set! conceal ""))
+
+(superscript
+ [
+ "^"
+ "{^"
+ "^}"
+ ] @punctuation.delimiter
+ (#set! conceal ""))
+
+(subscript
+ [
+ "~"
+ "{~"
+ "~}"
+ ] @punctuation.delimiter
+ (#set! conceal ""))
+
([
(emphasis_begin)
(emphasis_end)
(strong_begin)
(strong_end)
- (superscript_begin)
- (superscript_end)
- (subscript_begin)
- (subscript_end)
- (highlighted_begin)
- (highlighted_end)
- (insert_begin)
- (insert_end)
- (delete_begin)
- (delete_end)
(verbatim_marker_begin)
(verbatim_marker_end)
(math_marker)
@@ -196,10 +211,9 @@
((raw_inline) @markup.raw
(#set! priority 90))
-[
- (comment)
- (inline_comment)
-] @comment
+(comment
+ "%" @comment
+ (#set! conceal ""))
(span
[
@@ -288,14 +302,18 @@
(full_reference_image
[
+ "!["
"["
"]"
] @punctuation.bracket)
(collapsed_reference_image
- "[]" @punctuation.bracket)
+ [
+ "!["
+ "]"
+ ] @punctuation.bracket)
-(image_description
+(inline_image
[
"!["
"]"
@@ -303,6 +321,12 @@
(image_description) @markup.italic
+(image_description
+ [
+ "["
+ "]"
+ ] @punctuation.bracket)
+
(link_reference_definition
[
"["
diff --git a/runtime/queries/djot/indents.scm b/queries/djot/indents.scm
similarity index 100%
rename from runtime/queries/djot/indents.scm
rename to queries/djot/indents.scm
diff --git a/runtime/queries/djot/injections.scm b/queries/djot/injections.scm
similarity index 85%
rename from runtime/queries/djot/injections.scm
rename to queries/djot/injections.scm
index 0e4141046..078b40366 100644
--- a/runtime/queries/djot/injections.scm
+++ b/queries/djot/injections.scm
@@ -1,10 +1,6 @@
((comment) @injection.content
(#set! injection.language "comment"))
-(math
- (content) @injection.content
- (#set! injection.language "latex"))
-
(code_block
(language) @injection.language
(code) @injection.content)
diff --git a/runtime/queries/djot/locals.scm b/queries/djot/locals.scm
similarity index 100%
rename from runtime/queries/djot/locals.scm
rename to queries/djot/locals.scm
diff --git a/runtime/queries/dockerfile/highlights.scm b/queries/dockerfile/highlights.scm
similarity index 100%
rename from runtime/queries/dockerfile/highlights.scm
rename to queries/dockerfile/highlights.scm
diff --git a/runtime/queries/dockerfile/injections.scm b/queries/dockerfile/injections.scm
similarity index 100%
rename from runtime/queries/dockerfile/injections.scm
rename to queries/dockerfile/injections.scm
diff --git a/runtime/queries/dot/highlights.scm b/queries/dot/highlights.scm
similarity index 100%
rename from runtime/queries/dot/highlights.scm
rename to queries/dot/highlights.scm
diff --git a/runtime/queries/dot/indents.scm b/queries/dot/indents.scm
similarity index 100%
rename from runtime/queries/dot/indents.scm
rename to queries/dot/indents.scm
diff --git a/runtime/queries/dot/injections.scm b/queries/dot/injections.scm
similarity index 100%
rename from runtime/queries/dot/injections.scm
rename to queries/dot/injections.scm
diff --git a/runtime/queries/doxygen/highlights.scm b/queries/doxygen/highlights.scm
similarity index 100%
rename from runtime/queries/doxygen/highlights.scm
rename to queries/doxygen/highlights.scm
diff --git a/runtime/queries/doxygen/indents.scm b/queries/doxygen/indents.scm
similarity index 100%
rename from runtime/queries/doxygen/indents.scm
rename to queries/doxygen/indents.scm
diff --git a/runtime/queries/doxygen/injections.scm b/queries/doxygen/injections.scm
similarity index 100%
rename from runtime/queries/doxygen/injections.scm
rename to queries/doxygen/injections.scm
diff --git a/runtime/queries/dtd/folds.scm b/queries/dtd/folds.scm
similarity index 100%
rename from runtime/queries/dtd/folds.scm
rename to queries/dtd/folds.scm
diff --git a/runtime/queries/dtd/highlights.scm b/queries/dtd/highlights.scm
similarity index 100%
rename from runtime/queries/dtd/highlights.scm
rename to queries/dtd/highlights.scm
diff --git a/queries/dtd/injections.scm b/queries/dtd/injections.scm
new file mode 100644
index 000000000..ed5557a05
--- /dev/null
+++ b/queries/dtd/injections.scm
@@ -0,0 +1 @@
+(Comment) @comment
diff --git a/runtime/queries/dtd/locals.scm b/queries/dtd/locals.scm
similarity index 100%
rename from runtime/queries/dtd/locals.scm
rename to queries/dtd/locals.scm
diff --git a/runtime/queries/earthfile/highlights.scm b/queries/earthfile/highlights.scm
similarity index 97%
rename from runtime/queries/earthfile/highlights.scm
rename to queries/earthfile/highlights.scm
index ee0e300b5..cc7dce298 100644
--- a/runtime/queries/earthfile/highlights.scm
+++ b/queries/earthfile/highlights.scm
@@ -126,4 +126,4 @@
"=" @operator
-(line_continuation) @punctuation.special
+(line_continuation) @operator
diff --git a/runtime/queries/earthfile/injections.scm b/queries/earthfile/injections.scm
similarity index 100%
rename from runtime/queries/earthfile/injections.scm
rename to queries/earthfile/injections.scm
diff --git a/runtime/queries/ebnf/highlights.scm b/queries/ebnf/highlights.scm
similarity index 100%
rename from runtime/queries/ebnf/highlights.scm
rename to queries/ebnf/highlights.scm
diff --git a/runtime/queries/devicetree/injections.scm b/queries/ebnf/injections.scm
similarity index 100%
rename from runtime/queries/devicetree/injections.scm
rename to queries/ebnf/injections.scm
diff --git a/runtime/queries/ecma/folds.scm b/queries/ecma/folds.scm
similarity index 100%
rename from runtime/queries/ecma/folds.scm
rename to queries/ecma/folds.scm
diff --git a/runtime/queries/ecma/highlights.scm b/queries/ecma/highlights.scm
similarity index 95%
rename from runtime/queries/ecma/highlights.scm
rename to queries/ecma/highlights.scm
index cec2f4e3e..038df5619 100644
--- a/runtime/queries/ecma/highlights.scm
+++ b/queries/ecma/highlights.scm
@@ -113,18 +113,6 @@
(private_property_identifier)
] @function.method.call))
-(call_expression
- function: (await_expression
- (identifier) @function.call))
-
-(call_expression
- function: (await_expression
- (member_expression
- property: [
- (property_identifier)
- (private_property_identifier)
- ] @function.method.call)))
-
; Builtins
;---------
((identifier) @module.builtin
diff --git a/runtime/queries/ecma/indents.scm b/queries/ecma/indents.scm
similarity index 88%
rename from runtime/queries/ecma/indents.scm
rename to queries/ecma/indents.scm
index b613426ee..d56741670 100644
--- a/runtime/queries/ecma/indents.scm
+++ b/queries/ecma/indents.scm
@@ -33,11 +33,11 @@
(assignment_expression
right: (_) @_right
- (#not-kind-eq? @_right "arrow_function")) @indent.begin
+ (#not-kind-eq? @_right "arrow_function" "function")) @indent.begin
(variable_declarator
value: (_) @_value
- (#not-kind-eq? @_value "arrow_function" "call_expression")) @indent.begin
+ (#not-kind-eq? @_value "arrow_function" "call_expression" "function")) @indent.begin
(arguments
")" @indent.end)
diff --git a/runtime/queries/ecma/injections.scm b/queries/ecma/injections.scm
similarity index 93%
rename from runtime/queries/ecma/injections.scm
rename to queries/ecma/injections.scm
index 69afb6d41..04abafcde 100644
--- a/runtime/queries/ecma/injections.scm
+++ b/queries/ecma/injections.scm
@@ -48,26 +48,10 @@
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children))
-; Sanity CMS GROQ query
-; defineQuery(`...`)
-(call_expression
- function: (identifier) @_name
- (#eq? @_name "defineQuery")
- arguments: (arguments
- (template_string) @injection.content)
- (#offset! @injection.content 0 1 0 -1)
- (#set! injection.include-children)
- (#set! injection.language "groq"))
-
-; gql`...` or gql(`...`)
(call_expression
function: (identifier) @_name
(#eq? @_name "gql")
- arguments: [
- (arguments
- (template_string) @injection.content)
- (template_string) @injection.content
- ]
+ arguments: (template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "graphql"))
diff --git a/runtime/queries/ecma/locals.scm b/queries/ecma/locals.scm
similarity index 79%
rename from runtime/queries/ecma/locals.scm
rename to queries/ecma/locals.scm
index 97570e44a..24ea7c0a8 100644
--- a/runtime/queries/ecma/locals.scm
+++ b/queries/ecma/locals.scm
@@ -21,15 +21,6 @@
(variable_declarator
name: (identifier) @local.definition.var)
-(variable_declarator
- name: (object_pattern
- (shorthand_property_identifier_pattern) @local.definition.var))
-
-(variable_declarator
- (object_pattern
- (pair_pattern
- (identifier) @local.definition.var)))
-
(import_specifier
(identifier) @local.definition.import)
diff --git a/runtime/queries/editorconfig/folds.scm b/queries/editorconfig/folds.scm
similarity index 100%
rename from runtime/queries/editorconfig/folds.scm
rename to queries/editorconfig/folds.scm
diff --git a/queries/editorconfig/highlights.scm b/queries/editorconfig/highlights.scm
new file mode 100644
index 000000000..feb0a524c
--- /dev/null
+++ b/queries/editorconfig/highlights.scm
@@ -0,0 +1,55 @@
+(comment) @comment @spell
+
+(section
+ (section_name) @string.special.path)
+
+(character_choice
+ (character) @constant)
+
+(character_range
+ start: (character) @constant
+ end: (character) @constant)
+
+[
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ ","
+ ".."
+ (path_separator)
+] @punctuation.delimiter
+
+[
+ "-"
+ "="
+ (negation)
+] @operator
+
+[
+ (wildcard_characters)
+ (wildcard_any_characters)
+ (wildcard_single_character)
+] @character.special
+
+(escaped_character) @string.escape
+
+(pair
+ key: (identifier) @property
+ value: (_) @string)
+
+(boolean) @boolean
+
+(integer) @number
+
+(unset) @constant.builtin
+
+[
+ (spelling_language)
+ (indent_style)
+ (end_of_line)
+ (charset)
+] @string.special
diff --git a/runtime/queries/diff/injections.scm b/queries/editorconfig/injections.scm
similarity index 100%
rename from runtime/queries/diff/injections.scm
rename to queries/editorconfig/injections.scm
diff --git a/runtime/queries/eds/folds.scm b/queries/eds/folds.scm
similarity index 100%
rename from runtime/queries/eds/folds.scm
rename to queries/eds/folds.scm
diff --git a/runtime/queries/eds/highlights.scm b/queries/eds/highlights.scm
similarity index 100%
rename from runtime/queries/eds/highlights.scm
rename to queries/eds/highlights.scm
diff --git a/runtime/queries/eex/highlights.scm b/queries/eex/highlights.scm
similarity index 100%
rename from runtime/queries/eex/highlights.scm
rename to queries/eex/highlights.scm
diff --git a/runtime/queries/eex/injections.scm b/queries/eex/injections.scm
similarity index 100%
rename from runtime/queries/eex/injections.scm
rename to queries/eex/injections.scm
diff --git a/runtime/queries/elixir/folds.scm b/queries/elixir/folds.scm
similarity index 100%
rename from runtime/queries/elixir/folds.scm
rename to queries/elixir/folds.scm
diff --git a/runtime/queries/elixir/highlights.scm b/queries/elixir/highlights.scm
similarity index 100%
rename from runtime/queries/elixir/highlights.scm
rename to queries/elixir/highlights.scm
diff --git a/runtime/queries/elixir/indents.scm b/queries/elixir/indents.scm
similarity index 100%
rename from runtime/queries/elixir/indents.scm
rename to queries/elixir/indents.scm
diff --git a/runtime/queries/elixir/injections.scm b/queries/elixir/injections.scm
similarity index 97%
rename from runtime/queries/elixir/injections.scm
rename to queries/elixir/injections.scm
index f70fd984c..cc74f792a 100644
--- a/runtime/queries/elixir/injections.scm
+++ b/queries/elixir/injections.scm
@@ -21,7 +21,7 @@
(sigil
(sigil_name) @_sigil_name
(quoted_content) @injection.content
- (#any-of? @_sigil_name "H" "LVN")
+ (#eq? @_sigil_name "H")
(#set! injection.language "heex"))
; Surface
diff --git a/runtime/queries/elixir/locals.scm b/queries/elixir/locals.scm
similarity index 100%
rename from runtime/queries/elixir/locals.scm
rename to queries/elixir/locals.scm
diff --git a/runtime/queries/elm/folds.scm b/queries/elm/folds.scm
similarity index 100%
rename from runtime/queries/elm/folds.scm
rename to queries/elm/folds.scm
diff --git a/runtime/queries/elm/highlights.scm b/queries/elm/highlights.scm
similarity index 100%
rename from runtime/queries/elm/highlights.scm
rename to queries/elm/highlights.scm
diff --git a/runtime/queries/elm/injections.scm b/queries/elm/injections.scm
similarity index 100%
rename from runtime/queries/elm/injections.scm
rename to queries/elm/injections.scm
diff --git a/runtime/queries/elsa/folds.scm b/queries/elsa/folds.scm
similarity index 100%
rename from runtime/queries/elsa/folds.scm
rename to queries/elsa/folds.scm
diff --git a/runtime/queries/elsa/highlights.scm b/queries/elsa/highlights.scm
similarity index 100%
rename from runtime/queries/elsa/highlights.scm
rename to queries/elsa/highlights.scm
diff --git a/runtime/queries/elsa/indents.scm b/queries/elsa/indents.scm
similarity index 100%
rename from runtime/queries/elsa/indents.scm
rename to queries/elsa/indents.scm
diff --git a/runtime/queries/ebnf/injections.scm b/queries/elsa/injections.scm
similarity index 100%
rename from runtime/queries/ebnf/injections.scm
rename to queries/elsa/injections.scm
diff --git a/runtime/queries/elsa/locals.scm b/queries/elsa/locals.scm
similarity index 100%
rename from runtime/queries/elsa/locals.scm
rename to queries/elsa/locals.scm
diff --git a/runtime/queries/elvish/highlights.scm b/queries/elvish/highlights.scm
similarity index 100%
rename from runtime/queries/elvish/highlights.scm
rename to queries/elvish/highlights.scm
diff --git a/runtime/queries/editorconfig/injections.scm b/queries/elvish/injections.scm
similarity index 100%
rename from runtime/queries/editorconfig/injections.scm
rename to queries/elvish/injections.scm
diff --git a/runtime/queries/embedded_template/highlights.scm b/queries/embedded_template/highlights.scm
similarity index 100%
rename from runtime/queries/embedded_template/highlights.scm
rename to queries/embedded_template/highlights.scm
diff --git a/runtime/queries/embedded_template/injections.scm b/queries/embedded_template/injections.scm
similarity index 100%
rename from runtime/queries/embedded_template/injections.scm
rename to queries/embedded_template/injections.scm
diff --git a/runtime/queries/erlang/folds.scm b/queries/erlang/folds.scm
similarity index 100%
rename from runtime/queries/erlang/folds.scm
rename to queries/erlang/folds.scm
diff --git a/runtime/queries/erlang/highlights.scm b/queries/erlang/highlights.scm
similarity index 97%
rename from runtime/queries/erlang/highlights.scm
rename to queries/erlang/highlights.scm
index 4b5b8ee78..8bba348d9 100644
--- a/runtime/queries/erlang/highlights.scm
+++ b/queries/erlang/highlights.scm
@@ -93,8 +93,8 @@
lhs: _ @constant.macro
(#set! priority 101))
-((_preprocessor_directive) @keyword.directive
- (#set! priority 99))
+(_preprocessor_directive) @keyword.directive
+(#set! priority 99)
; Attributes
(pp_include) @keyword.import
diff --git a/runtime/queries/elsa/injections.scm b/queries/erlang/injections.scm
similarity index 100%
rename from runtime/queries/elsa/injections.scm
rename to queries/erlang/injections.scm
diff --git a/runtime/queries/facility/folds.scm b/queries/facility/folds.scm
similarity index 100%
rename from runtime/queries/facility/folds.scm
rename to queries/facility/folds.scm
diff --git a/runtime/queries/facility/highlights.scm b/queries/facility/highlights.scm
similarity index 100%
rename from runtime/queries/facility/highlights.scm
rename to queries/facility/highlights.scm
diff --git a/runtime/queries/facility/indents.scm b/queries/facility/indents.scm
similarity index 100%
rename from runtime/queries/facility/indents.scm
rename to queries/facility/indents.scm
diff --git a/runtime/queries/facility/injections.scm b/queries/facility/injections.scm
similarity index 100%
rename from runtime/queries/facility/injections.scm
rename to queries/facility/injections.scm
diff --git a/runtime/queries/faust/highlights.scm b/queries/faust/highlights.scm
similarity index 100%
rename from runtime/queries/faust/highlights.scm
rename to queries/faust/highlights.scm
diff --git a/runtime/queries/elvish/injections.scm b/queries/faust/injections.scm
similarity index 100%
rename from runtime/queries/elvish/injections.scm
rename to queries/faust/injections.scm
diff --git a/runtime/queries/fennel/folds.scm b/queries/fennel/folds.scm
similarity index 100%
rename from runtime/queries/fennel/folds.scm
rename to queries/fennel/folds.scm
diff --git a/runtime/queries/fennel/highlights.scm b/queries/fennel/highlights.scm
similarity index 95%
rename from runtime/queries/fennel/highlights.scm
rename to queries/fennel/highlights.scm
index a70f200dc..2f0b5f738 100644
--- a/runtime/queries/fennel/highlights.scm
+++ b/queries/fennel/highlights.scm
@@ -102,13 +102,10 @@
])
((symbol) @variable.parameter
- (#lua-match? @variable.parameter "^%$[1-9]?$"))
-
-((symbol_fragment) @variable.parameter
- (#lua-match? @variable.parameter "^%$[1-9]?$"))
+ (#any-of? @variable.parameter "$" "$..."))
((symbol) @variable.parameter
- (#eq? @variable.parameter "$..."))
+ (#lua-match? @variable.parameter "^%$[1-9]$"))
((symbol) @operator
(#any-of? @operator
diff --git a/runtime/queries/fennel/injections.scm b/queries/fennel/injections.scm
similarity index 100%
rename from runtime/queries/fennel/injections.scm
rename to queries/fennel/injections.scm
diff --git a/runtime/queries/fennel/locals.scm b/queries/fennel/locals.scm
similarity index 98%
rename from runtime/queries/fennel/locals.scm
rename to queries/fennel/locals.scm
index 320c93bb9..be63e728f 100644
--- a/runtime/queries/fennel/locals.scm
+++ b/queries/fennel/locals.scm
@@ -11,6 +11,7 @@
(collect_form)
(icollect_form)
(accumulate_form)
+ (for_form)
(fcollect_form)
(faccumulate_form)
(case_form)
diff --git a/runtime/queries/fidl/folds.scm b/queries/fidl/folds.scm
similarity index 100%
rename from runtime/queries/fidl/folds.scm
rename to queries/fidl/folds.scm
diff --git a/runtime/queries/fidl/highlights.scm b/queries/fidl/highlights.scm
similarity index 100%
rename from runtime/queries/fidl/highlights.scm
rename to queries/fidl/highlights.scm
diff --git a/runtime/queries/erlang/injections.scm b/queries/fidl/injections.scm
similarity index 100%
rename from runtime/queries/erlang/injections.scm
rename to queries/fidl/injections.scm
diff --git a/runtime/queries/firrtl/folds.scm b/queries/firrtl/folds.scm
similarity index 100%
rename from runtime/queries/firrtl/folds.scm
rename to queries/firrtl/folds.scm
diff --git a/runtime/queries/firrtl/highlights.scm b/queries/firrtl/highlights.scm
similarity index 100%
rename from runtime/queries/firrtl/highlights.scm
rename to queries/firrtl/highlights.scm
diff --git a/runtime/queries/firrtl/indents.scm b/queries/firrtl/indents.scm
similarity index 100%
rename from runtime/queries/firrtl/indents.scm
rename to queries/firrtl/indents.scm
diff --git a/runtime/queries/faust/injections.scm b/queries/firrtl/injections.scm
similarity index 100%
rename from runtime/queries/faust/injections.scm
rename to queries/firrtl/injections.scm
diff --git a/runtime/queries/firrtl/locals.scm b/queries/firrtl/locals.scm
similarity index 100%
rename from runtime/queries/firrtl/locals.scm
rename to queries/firrtl/locals.scm
diff --git a/runtime/queries/fish/folds.scm b/queries/fish/folds.scm
similarity index 100%
rename from runtime/queries/fish/folds.scm
rename to queries/fish/folds.scm
diff --git a/queries/fish/highlights.scm b/queries/fish/highlights.scm
new file mode 100644
index 000000000..10ed533d3
--- /dev/null
+++ b/queries/fish/highlights.scm
@@ -0,0 +1,176 @@
+; Fish highlighting
+; Operators
+[
+ "&&"
+ "||"
+ "|"
+ "&|"
+ "2>|"
+ "&"
+ ".."
+ "!"
+ (direction)
+ (stream_redirect)
+] @operator
+
+; match operators of test command
+(command
+ name: (word) @function.builtin
+ (#eq? @function.builtin "test")
+ argument: (word) @operator
+ (#match? @operator "^(!?\\=|-[a-zA-Z]+)$"))
+
+; match operators of [ command
+(command
+ name: (word) @punctuation.bracket
+ (#eq? @punctuation.bracket "[")
+ argument: (word) @operator
+ (#match? @operator "^(!?\\=|-[a-zA-Z]+)$"))
+
+[
+ "not"
+ "and"
+ "or"
+] @keyword.operator
+
+; Conditionals
+(if_statement
+ [
+ "if"
+ "end"
+ ] @keyword.conditional)
+
+(switch_statement
+ [
+ "switch"
+ "end"
+ ] @keyword.conditional)
+
+(case_clause
+ "case" @keyword.conditional)
+
+(else_clause
+ "else" @keyword.conditional)
+
+(else_if_clause
+ [
+ "else"
+ "if"
+ ] @keyword.conditional)
+
+; Loops/Blocks
+(while_statement
+ [
+ "while"
+ "end"
+ ] @keyword.repeat)
+
+(for_statement
+ [
+ "for"
+ "end"
+ ] @keyword.repeat)
+
+(begin_statement
+ [
+ "begin"
+ "end"
+ ] @keyword.repeat)
+
+; Keywords
+[
+ "in"
+ (break)
+ (continue)
+] @keyword
+
+"return" @keyword.return
+
+; Punctuation
+[
+ "["
+ "]"
+ "{"
+ "}"
+ "("
+ ")"
+] @punctuation.bracket
+
+"," @punctuation.delimiter
+
+; Commands
+(command
+ argument: [
+ (word) @variable.parameter
+ (#lua-match? @variable.parameter "^[-]")
+ ])
+
+(command_substitution
+ "$" @punctuation.bracket)
+
+; non-builtin command names
+(command
+ name: (word) @function.call)
+
+; derived from builtin -n (fish 3.2.2)
+(command
+ name: [
+ (word) @function.builtin
+ (#any-of? @function.builtin
+ "." ":" "_" "alias" "argparse" "bg" "bind" "block" "breakpoint" "builtin" "cd" "command"
+ "commandline" "complete" "contains" "count" "disown" "echo" "emit" "eval" "exec" "exit" "fg"
+ "functions" "history" "isatty" "jobs" "math" "printf" "pwd" "random" "read" "realpath" "set"
+ "set_color" "source" "status" "string" "test" "time" "type" "ulimit" "wait")
+ ])
+
+; Functions
+(function_definition
+ [
+ "function"
+ "end"
+ ] @keyword.function)
+
+(function_definition
+ name: [
+ (word)
+ (concatenation)
+ ] @function)
+
+(function_definition
+ option: [
+ (word)
+ (concatenation
+ (word))
+ ] @variable.parameter
+ (#lua-match? @variable.parameter "^[-]"))
+
+; Strings
+[
+ (double_quote_string)
+ (single_quote_string)
+] @string
+
+(escape_sequence) @string.escape
+
+; Variables
+(variable_name) @variable
+
+(variable_expansion) @constant
+
+; Nodes
+[
+ (integer)
+ (float)
+] @number
+
+(comment) @comment
+
+(comment) @spell
+
+((word) @boolean
+ (#any-of? @boolean "true" "false"))
+
+((program
+ .
+ (comment) @keyword.directive @nospell)
+ (#lua-match? @keyword.directive "^#!/"))
diff --git a/runtime/queries/fish/indents.scm b/queries/fish/indents.scm
similarity index 100%
rename from runtime/queries/fish/indents.scm
rename to queries/fish/indents.scm
diff --git a/runtime/queries/fidl/injections.scm b/queries/fish/injections.scm
similarity index 100%
rename from runtime/queries/fidl/injections.scm
rename to queries/fish/injections.scm
diff --git a/runtime/queries/fish/locals.scm b/queries/fish/locals.scm
similarity index 100%
rename from runtime/queries/fish/locals.scm
rename to queries/fish/locals.scm
diff --git a/runtime/queries/foam/folds.scm b/queries/foam/folds.scm
similarity index 100%
rename from runtime/queries/foam/folds.scm
rename to queries/foam/folds.scm
diff --git a/runtime/queries/foam/highlights.scm b/queries/foam/highlights.scm
similarity index 100%
rename from runtime/queries/foam/highlights.scm
rename to queries/foam/highlights.scm
diff --git a/runtime/queries/foam/indents.scm b/queries/foam/indents.scm
similarity index 100%
rename from runtime/queries/foam/indents.scm
rename to queries/foam/indents.scm
diff --git a/runtime/queries/foam/injections.scm b/queries/foam/injections.scm
similarity index 100%
rename from runtime/queries/foam/injections.scm
rename to queries/foam/injections.scm
diff --git a/runtime/queries/foam/locals.scm b/queries/foam/locals.scm
similarity index 100%
rename from runtime/queries/foam/locals.scm
rename to queries/foam/locals.scm
diff --git a/runtime/queries/forth/folds.scm b/queries/forth/folds.scm
similarity index 100%
rename from runtime/queries/forth/folds.scm
rename to queries/forth/folds.scm
diff --git a/runtime/queries/forth/highlights.scm b/queries/forth/highlights.scm
similarity index 100%
rename from runtime/queries/forth/highlights.scm
rename to queries/forth/highlights.scm
diff --git a/runtime/queries/forth/indents.scm b/queries/forth/indents.scm
similarity index 100%
rename from runtime/queries/forth/indents.scm
rename to queries/forth/indents.scm
diff --git a/runtime/queries/firrtl/injections.scm b/queries/forth/injections.scm
similarity index 100%
rename from runtime/queries/firrtl/injections.scm
rename to queries/forth/injections.scm
diff --git a/runtime/queries/forth/locals.scm b/queries/forth/locals.scm
similarity index 100%
rename from runtime/queries/forth/locals.scm
rename to queries/forth/locals.scm
diff --git a/runtime/queries/fortran/folds.scm b/queries/fortran/folds.scm
similarity index 87%
rename from runtime/queries/fortran/folds.scm
rename to queries/fortran/folds.scm
index 7b06b1719..cedbdb635 100644
--- a/runtime/queries/fortran/folds.scm
+++ b/queries/fortran/folds.scm
@@ -3,7 +3,7 @@
(if_statement)
(where_statement)
(enum_statement)
- (do_loop)
+ (do_loop_statement)
(derived_type_definition)
(function)
(subroutine)
diff --git a/runtime/queries/fortran/highlights.scm b/queries/fortran/highlights.scm
similarity index 100%
rename from runtime/queries/fortran/highlights.scm
rename to queries/fortran/highlights.scm
diff --git a/runtime/queries/fortran/indents.scm b/queries/fortran/indents.scm
similarity index 95%
rename from runtime/queries/fortran/indents.scm
rename to queries/fortran/indents.scm
index 0f9ba3d7e..86704c4f4 100644
--- a/runtime/queries/fortran/indents.scm
+++ b/queries/fortran/indents.scm
@@ -5,7 +5,7 @@
(function)
; (interface)
(if_statement)
- (do_loop)
+ (do_loop_statement)
(where_statement)
(derived_type_definition)
(enum)
diff --git a/runtime/queries/fish/injections.scm b/queries/fortran/injections.scm
similarity index 100%
rename from runtime/queries/fish/injections.scm
rename to queries/fortran/injections.scm
diff --git a/runtime/queries/fsh/highlights.scm b/queries/fsh/highlights.scm
similarity index 100%
rename from runtime/queries/fsh/highlights.scm
rename to queries/fsh/highlights.scm
diff --git a/runtime/queries/fsh/injections.scm b/queries/fsh/injections.scm
similarity index 100%
rename from runtime/queries/fsh/injections.scm
rename to queries/fsh/injections.scm
diff --git a/runtime/queries/fsharp/highlights.scm b/queries/fsharp/highlights.scm
similarity index 96%
rename from runtime/queries/fsharp/highlights.scm
rename to queries/fsharp/highlights.scm
index ba70ea5c6..e400e3522 100644
--- a/runtime/queries/fsharp/highlights.scm
+++ b/queries/fsharp/highlights.scm
@@ -123,7 +123,7 @@
((argument_patterns
(long_identifier
(identifier) @character.special))
- (#lua-match? @character.special "^_.*"))
+ (#lua-match? @character.special "^\_.*"))
(member_defn
(method_or_prop_defn
@@ -246,6 +246,7 @@
"<-"
"&"
"&&"
+ "|"
"||"
":>"
":?>"
@@ -376,9 +377,8 @@
(unit) @function.call)
((_type
- (simple_type
- (long_identifier
- (identifier) @type.builtin)))
+ (long_identifier
+ (identifier) @type.builtin))
(#any-of? @type.builtin
"bool" "byte" "sbyte" "int16" "uint16" "int" "uint" "int64" "uint64" "nativeint" "unativeint"
"decimal" "float" "double" "float32" "single" "char" "string" "unit"))
@@ -402,9 +402,8 @@
(attributes
(attribute
(_type
- (simple_type
- (long_identifier
- (identifier) @attribute)))))
+ (long_identifier
+ (identifier) @attribute))))
(function_or_value_defn
(value_declaration_left
.
diff --git a/runtime/queries/fsharp/injections.scm b/queries/fsharp/injections.scm
similarity index 100%
rename from runtime/queries/fsharp/injections.scm
rename to queries/fsharp/injections.scm
diff --git a/runtime/queries/func/highlights.scm b/queries/func/highlights.scm
similarity index 100%
rename from runtime/queries/func/highlights.scm
rename to queries/func/highlights.scm
diff --git a/runtime/queries/forth/injections.scm b/queries/func/injections.scm
similarity index 100%
rename from runtime/queries/forth/injections.scm
rename to queries/func/injections.scm
diff --git a/queries/fusion/folds.scm b/queries/fusion/folds.scm
new file mode 100644
index 000000000..179fc160b
--- /dev/null
+++ b/queries/fusion/folds.scm
@@ -0,0 +1,6 @@
+[
+ (comment)
+ (block)
+ (afx_comment)
+ (afx_element)
+] @fold
diff --git a/queries/fusion/highlights.scm b/queries/fusion/highlights.scm
new file mode 100644
index 000000000..7108e5705
--- /dev/null
+++ b/queries/fusion/highlights.scm
@@ -0,0 +1,132 @@
+(comment) @comment @spell
+
+(afx_comment) @comment @spell
+
+; identifiers afx
+(afx_opening_element
+ (afx_identifier) @tag)
+
+(afx_closing_element
+ (afx_identifier) @tag)
+
+(afx_element_self_closing
+ (afx_identifier) @tag)
+
+(afx_attribute
+ (afx_property_identifier) @tag.attribute)
+
+(afx_text) @spell
+
+; identifiers eel
+(eel_object_path
+ (eel_path_identifier) @variable.builtin
+ (#any-of? @variable.builtin "this" "props"))
+
+(eel_object_path
+ (eel_path_identifier) @variable)
+
+(eel_object_pair
+ key: (eel_property_name) @property)
+
+(eel_method_name) @function
+
+(eel_parameter) @variable
+
+; identifiers fusion
+; -----------
+(path_part) @property
+
+(meta_property) @attribute
+
+(prototype_signature
+ "prototype" @keyword)
+
+(include_statement
+ "include" @keyword.import
+ (source_file) @string.special.url)
+
+(namespace_declaration
+ "namespace" @keyword.type
+ (alias_namespace) @module)
+
+(type
+ name: (type_name) @type)
+
+; tokens
+; ------
+(afx_opening_element
+ [
+ "<"
+ ">"
+ ] @punctuation.bracket)
+
+(afx_closing_element
+ [
+ "<"
+ ">"
+ "/"
+ ] @punctuation.bracket)
+
+(afx_element_self_closing
+ [
+ "<"
+ "/>"
+ ] @punctuation.bracket)
+
+[
+ (package_name)
+ (alias_namespace)
+] @module
+
+(namespace_declaration
+ "=" @operator)
+
+(assignment
+ "=" @operator)
+
+(copy
+ "<" @operator)
+
+(deletion) @operator
+
+(eel_binary_expression
+ operator: _ @operator)
+
+(eel_not_expression
+ [
+ "!"
+ "not"
+ ] @operator)
+
+(string) @string
+
+(number) @number
+
+(boolean) @boolean
+
+(null) @constant.builtin
+
+(value_expression
+ start: _ @punctuation.special
+ end: _ @punctuation.special)
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+ "["
+ "]"
+] @punctuation.bracket
+
+[
+ ":"
+ "."
+ "?"
+] @punctuation.delimiter
+
+(eel_ternary_expression
+ [
+ "?"
+ ":"
+ ] @keyword.conditional.ternary)
diff --git a/queries/fusion/indents.scm b/queries/fusion/indents.scm
new file mode 100644
index 000000000..0ba6cf758
--- /dev/null
+++ b/queries/fusion/indents.scm
@@ -0,0 +1,24 @@
+[
+ (block)
+ (value_dsl)
+ (afx_element)
+ (afx_element_self_closing)
+ (eel_array)
+ (eel_object)
+] @indent.begin
+
+(block
+ end: _ @indent.branch)
+
+(value_dsl
+ end: _ @indent.branch)
+
+(eel_array
+ end: _ @indent.branch)
+
+(eel_object
+ end: _ @indent.branch)
+
+(afx_closing_element) @indent.branch
+
+(comment) @indent.ignore
diff --git a/runtime/queries/wgsl/injections.scm b/queries/fusion/injections.scm
similarity index 64%
rename from runtime/queries/wgsl/injections.scm
rename to queries/fusion/injections.scm
index 3cd6aac8e..085cdb458 100644
--- a/runtime/queries/wgsl/injections.scm
+++ b/queries/fusion/injections.scm
@@ -1,5 +1,5 @@
([
- (line_comment)
- (block_comment)
+ (comment)
+ (afx_comment)
] @injection.content
(#set! injection.language "comment"))
diff --git a/queries/fusion/locals.scm b/queries/fusion/locals.scm
new file mode 100644
index 000000000..d23e0ab46
--- /dev/null
+++ b/queries/fusion/locals.scm
@@ -0,0 +1,23 @@
+; Fusion base
+(block) @local.scope
+
+(namespace_declaration
+ (alias_namespace) @local.definition.namespace)
+
+(property
+ (path
+ (path_part) @local.definition.field))
+
+(type
+ namespace: (package_name)? @local.definition.namespace
+ name: (type_name) @local.definition.type)
+
+; Eel Expressions
+(eel_arrow_function) @local.scope
+
+(eel_object) @local.scope
+
+(eel_parameter) @local.definition.parameter
+
+(eel_object_pair
+ key: (eel_property_name) @local.definition.field)
diff --git a/runtime/queries/gap/folds.scm b/queries/gap/folds.scm
similarity index 100%
rename from runtime/queries/gap/folds.scm
rename to queries/gap/folds.scm
diff --git a/runtime/queries/gap/highlights.scm b/queries/gap/highlights.scm
similarity index 100%
rename from runtime/queries/gap/highlights.scm
rename to queries/gap/highlights.scm
diff --git a/runtime/queries/fortran/injections.scm b/queries/gap/injections.scm
similarity index 100%
rename from runtime/queries/fortran/injections.scm
rename to queries/gap/injections.scm
diff --git a/runtime/queries/gap/locals.scm b/queries/gap/locals.scm
similarity index 100%
rename from runtime/queries/gap/locals.scm
rename to queries/gap/locals.scm
diff --git a/runtime/queries/gaptst/folds.scm b/queries/gaptst/folds.scm
similarity index 100%
rename from runtime/queries/gaptst/folds.scm
rename to queries/gaptst/folds.scm
diff --git a/runtime/queries/gaptst/highlights.scm b/queries/gaptst/highlights.scm
similarity index 100%
rename from runtime/queries/gaptst/highlights.scm
rename to queries/gaptst/highlights.scm
diff --git a/runtime/queries/gaptst/injections.scm b/queries/gaptst/injections.scm
similarity index 100%
rename from runtime/queries/gaptst/injections.scm
rename to queries/gaptst/injections.scm
diff --git a/runtime/queries/gdscript/folds.scm b/queries/gdscript/folds.scm
similarity index 100%
rename from runtime/queries/gdscript/folds.scm
rename to queries/gdscript/folds.scm
diff --git a/queries/gdscript/highlights.scm b/queries/gdscript/highlights.scm
new file mode 100644
index 000000000..bc62bc2f5
--- /dev/null
+++ b/queries/gdscript/highlights.scm
@@ -0,0 +1,422 @@
+; Basic
+(identifier) @variable
+
+(name) @variable
+
+(type
+ (identifier) @type)
+
+(comment) @comment @spell
+
+(string_name) @string
+
+(string) @string
+
+(float) @number.float
+
+(integer) @number
+
+(null) @constant
+
+(setter) @function
+
+(getter) @function
+
+(set_body
+ "set" @keyword.function)
+
+(get_body
+ "get" @keyword.function)
+
+(static_keyword) @keyword.modifier
+
+(tool_statement) @keyword
+
+(breakpoint_statement) @keyword.debug
+
+(inferred_type) @operator
+
+[
+ (true)
+ (false)
+] @boolean
+
+[
+ (get_node)
+ (node_path)
+] @string.special.url
+
+(class_name_statement
+ (name) @type) @keyword
+
+(const_statement
+ "const" @keyword.modifier
+ (name) @constant)
+
+(expression_statement
+ (string) @comment @spell)
+
+; Functions
+(constructor_definition
+ "_init" @constructor)
+
+(function_definition
+ (name) @function)
+
+(parameters
+ (identifier) @variable.parameter)
+
+(typed_parameter
+ (identifier) @variable.parameter)
+
+(default_parameter
+ (identifier) @variable.parameter)
+
+(typed_default_parameter
+ (identifier) @variable.parameter)
+
+(call
+ (identifier) @function.call)
+
+(call
+ (identifier) @keyword.import
+ (#any-of? @keyword.import "preload" "load"))
+
+; Properties and Methods
+; We'll use @property since that's the term Godot uses.
+; But, should (source (variable_statement (name))) be @property, too? Since a
+; script file is a class in gdscript.
+(class_definition
+ (body
+ (variable_statement
+ (name) @property)))
+
+; Same question but for methods?
+(class_definition
+ (body
+ (function_definition
+ (name) @function.method)))
+
+(attribute_call
+ (identifier) @function.method.call)
+
+(attribute_subscript
+ (identifier) @property)
+
+(attribute
+ (_)
+ (identifier) @property)
+
+; Identifier naming conventions
+; - Make sure the following query is below the attribute queries so that it
+; takes precedence on a `(type (attribute (identifier)))`
+((identifier) @type
+ (#lua-match? @type "^[A-Z]"))
+
+((identifier) @constant
+ (#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
+
+; Enums
+(enumerator
+ left: (identifier) @constant)
+
+; Special Builtins
+((identifier) @variable.builtin
+ (#any-of? @variable.builtin "self" "super"))
+
+(attribute_call
+ (identifier) @keyword.operator
+ (#eq? @keyword.operator "new"))
+
+; Match Pattern
+[
+ (underscore)
+ (pattern_open_ending)
+] @character.special
+
+; Alternations
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ ","
+ "."
+ ":"
+] @punctuation.delimiter
+
+[
+ "if"
+ "elif"
+ "else"
+ "match"
+] @keyword.conditional
+
+(pattern_guard
+ "when" @keyword.conditional)
+
+[
+ "for"
+ "while"
+ "break"
+ "continue"
+] @keyword.repeat
+
+[
+ "~"
+ "-"
+ "*"
+ "/"
+ "%"
+ "+"
+ "-"
+ "<<"
+ ">>"
+ "&"
+ "^"
+ "|"
+ "<"
+ ">"
+ "=="
+ "!="
+ ">="
+ "<="
+ "!"
+ "&&"
+ "||"
+ "="
+ "+="
+ "-="
+ "*="
+ "/="
+ "%="
+ "&="
+ "|="
+ "->"
+] @operator
+
+[
+ "and"
+ "as"
+ "in"
+ "is"
+ "not"
+ "or"
+] @keyword.operator
+
+[
+ "pass"
+ "class_name"
+ "extends"
+ "signal"
+ "var"
+ "onready"
+ "setget"
+ "remote"
+ "master"
+ "puppet"
+ "remotesync"
+ "mastersync"
+ "puppetsync"
+] @keyword
+
+"export" @keyword.import
+
+[
+ "enum"
+ "class"
+] @keyword.type
+
+"func" @keyword.function
+
+"return" @keyword.return
+
+"await" @keyword.coroutine
+
+(call
+ (identifier) @keyword.coroutine
+ (#eq? @keyword.coroutine "yield"))
+
+; Builtins
+; generated from
+; - godot commit: fb10e67fef
+; - https://github.com/godotengine/godot/blob/fb10e67fef/doc/classes
+; - https://github.com/godotengine/godot/blob/fb10e67fef/doc/classes/@GlobalScope.xml
+; - https://github.com/godotengine/godot/blob/fb10e67fef/modules/gdscript/doc_classes/@GDScript.xml
+; Built-in Annotations
+((annotation
+ "@" @attribute
+ (identifier) @attribute)
+ (#any-of? @attribute
+ ; from modules/gdscript/doc_classes/@GDScript.xml
+ "export" "export_category" "export_color_no_alpha" "export_dir" "export_enum"
+ "export_exp_easing" "export_file" "export_flags" "export_flags_2d_navigation"
+ "export_flags_2d_physics" "export_flags_2d_render" "export_flags_3d_navigation"
+ "export_flags_3d_physics" "export_flags_3d_render" "export_flags_avoidance" "export_global_dir"
+ "export_global_file" "export_group" "export_multiline" "export_node_path" "export_placeholder"
+ "export_range" "export_subgroup" "icon" "onready" "rpc" "static_unload" "tool" "warning_ignore"))
+
+; Builtin Types
+((identifier) @type.builtin
+ (#any-of? @type.builtin
+ ; from doc/classes/*.xml
+ "AABB" "Array" "Basis" "Callable" "Color" "Dictionary" "NodePath" "PackedByteArray"
+ "PackedColorArray" "PackedFloat32Array" "PackedFloat64Array" "PackedInt32Array"
+ "PackedInt64Array" "PackedStringArray" "PackedVector2Array" "PackedVector3Array" "Plane"
+ "Projection" "Quaternion" "RID" "Rect2" "Rect2i" "Signal" "String" "StringName" "Transform2D"
+ "Transform3D" "Vector2" "Vector2i" "Vector3" "Vector3i" "Vector4" "Vector4i" "bool" "float"
+ "int"
+ ; from doc/classes/@GlobalScope.xml
+ "AudioServer" "CameraServer" "ClassDB" "DisplayServer" "EditorInterface" "Engine"
+ "EngineDebugger" "GDExtensionManager" "Geometry2D" "Geometry3D" "GodotSharp" "IP" "Input"
+ "InputMap" "JavaClassWrapper" "JavaScriptBridge" "Marshalls" "NavigationMeshGenerator"
+ "NavigationServer2D" "NavigationServer3D" "OS" "Performance" "PhysicsServer2D"
+ "PhysicsServer2DManager" "PhysicsServer3D" "PhysicsServer3DManager" "ProjectSettings"
+ "RenderingServer" "ResourceLoader" "ResourceSaver" "ResourceUID" "TextServerManager" "ThemeDB"
+ "Time" "TranslationServer" "WorkerThreadPool" "XRServer"))
+
+; Builtin Funcs
+(call
+ (identifier) @function.builtin
+ (#any-of? @function.builtin
+ ; from doc/classes/@GlobalScope.xml
+ "abs" "absf" "absi" "acos" "acosh" "angle_difference" "asin" "asinh" "atan" "atan2" "atanh"
+ "bezier_derivative" "bezier_interpolate" "bytes_to_var" "bytes_to_var_with_objects" "ceil"
+ "ceilf" "ceili" "clamp" "clampf" "clampi" "cos" "cosh" "cubic_interpolate"
+ "cubic_interpolate_angle" "cubic_interpolate_angle_in_time" "cubic_interpolate_in_time"
+ "db_to_linear" "deg_to_rad" "ease" "error_string" "exp" "floor" "floorf" "floori" "fmod"
+ "fposmod" "hash" "instance_from_id" "inverse_lerp" "is_equal_approx" "is_finite" "is_inf"
+ "is_instance_id_valid" "is_instance_valid" "is_nan" "is_same" "is_zero_approx" "lerp"
+ "lerp_angle" "lerpf" "linear_to_db" "log" "max" "maxf" "maxi" "min" "minf" "mini" "move_toward"
+ "nearest_po2" "pingpong" "posmod" "pow" "print" "print_rich" "print_verbose" "printerr"
+ "printraw" "prints" "printt" "push_error" "push_warning" "rad_to_deg" "rand_from_seed" "randf"
+ "randf_range" "randfn" "randi" "randi_range" "randomize" "remap" "rid_allocate_id"
+ "rid_from_int64" "rotate_toward" "round" "roundf" "roundi" "seed" "sign" "signf" "signi" "sin"
+ "sinh" "smoothstep" "snapped" "snappedf" "snappedi" "sqrt" "step_decimals" "str" "str_to_var"
+ "tan" "tanh" "type_convert" "type_string" "typeof" "var_to_bytes" "var_to_bytes_with_objects"
+ "var_to_str" "weakref" "wrap" "wrapf" "wrapi"
+ ; from modules/gdscript/doc_classes/@GDScript.xml
+ "Color8" "assert" "char" "convert" "dict_to_inst" "get_stack" "inst_to_dict" "is_instance_of"
+ "len" "load" "preload" "print_debug" "print_stack" "range" "type_exists")
+ )
+
+; Builtin Constants
+((identifier) @constant.builtin
+ (#any-of? @constant.builtin
+ ; from modules/gdscript/doc_classes/@GDScript.xml
+ "INF" "NAN" "PI" "TAU"
+ ; from doc/classes/@GlobalScope.xml
+ "CLOCKWISE" "CORNER_BOTTOM_LEFT" "CORNER_BOTTOM_RIGHT" "CORNER_TOP_LEFT" "CORNER_TOP_RIGHT"
+ "COUNTERCLOCKWISE" "ERR_ALREADY_EXISTS" "ERR_ALREADY_IN_USE" "ERR_BUG" "ERR_BUSY"
+ "ERR_CANT_ACQUIRE_RESOURCE" "ERR_CANT_CONNECT" "ERR_CANT_CREATE" "ERR_CANT_FORK" "ERR_CANT_OPEN"
+ "ERR_CANT_RESOLVE" "ERR_COMPILATION_FAILED" "ERR_CONNECTION_ERROR" "ERR_CYCLIC_LINK"
+ "ERR_DATABASE_CANT_READ" "ERR_DATABASE_CANT_WRITE" "ERR_DOES_NOT_EXIST" "ERR_DUPLICATE_SYMBOL"
+ "ERR_FILE_ALREADY_IN_USE" "ERR_FILE_BAD_DRIVE" "ERR_FILE_BAD_PATH" "ERR_FILE_CANT_OPEN"
+ "ERR_FILE_CANT_READ" "ERR_FILE_CANT_WRITE" "ERR_FILE_CORRUPT" "ERR_FILE_EOF"
+ "ERR_FILE_MISSING_DEPENDENCIES" "ERR_FILE_NOT_FOUND" "ERR_FILE_NO_PERMISSION"
+ "ERR_FILE_UNRECOGNIZED" "ERR_HELP" "ERR_INVALID_DATA" "ERR_INVALID_DECLARATION"
+ "ERR_INVALID_PARAMETER" "ERR_LINK_FAILED" "ERR_LOCKED" "ERR_METHOD_NOT_FOUND"
+ "ERR_OUT_OF_MEMORY" "ERR_PARAMETER_RANGE_ERROR" "ERR_PARSE_ERROR" "ERR_PRINTER_ON_FIRE"
+ "ERR_QUERY_FAILED" "ERR_SCRIPT_FAILED" "ERR_SKIP" "ERR_TIMEOUT" "ERR_UNAUTHORIZED"
+ "ERR_UNAVAILABLE" "ERR_UNCONFIGURED" "EULER_ORDER_XYZ" "EULER_ORDER_XZY" "EULER_ORDER_YXZ"
+ "EULER_ORDER_YZX" "EULER_ORDER_ZXY" "EULER_ORDER_ZYX" "FAILED" "HORIZONTAL"
+ "HORIZONTAL_ALIGNMENT_CENTER" "HORIZONTAL_ALIGNMENT_FILL" "HORIZONTAL_ALIGNMENT_LEFT"
+ "HORIZONTAL_ALIGNMENT_RIGHT" "INLINE_ALIGNMENT_BASELINE_TO" "INLINE_ALIGNMENT_BOTTOM"
+ "INLINE_ALIGNMENT_BOTTOM_TO" "INLINE_ALIGNMENT_CENTER" "INLINE_ALIGNMENT_CENTER_TO"
+ "INLINE_ALIGNMENT_IMAGE_MASK" "INLINE_ALIGNMENT_TEXT_MASK" "INLINE_ALIGNMENT_TOP"
+ "INLINE_ALIGNMENT_TOP_TO" "INLINE_ALIGNMENT_TO_BASELINE" "INLINE_ALIGNMENT_TO_BOTTOM"
+ "INLINE_ALIGNMENT_TO_CENTER" "INLINE_ALIGNMENT_TO_TOP" "JOY_AXIS_INVALID" "JOY_AXIS_LEFT_X"
+ "JOY_AXIS_LEFT_Y" "JOY_AXIS_MAX" "JOY_AXIS_RIGHT_X" "JOY_AXIS_RIGHT_Y" "JOY_AXIS_SDL_MAX"
+ "JOY_AXIS_TRIGGER_LEFT" "JOY_AXIS_TRIGGER_RIGHT" "JOY_BUTTON_A" "JOY_BUTTON_B" "JOY_BUTTON_BACK"
+ "JOY_BUTTON_DPAD_DOWN" "JOY_BUTTON_DPAD_LEFT" "JOY_BUTTON_DPAD_RIGHT" "JOY_BUTTON_DPAD_UP"
+ "JOY_BUTTON_GUIDE" "JOY_BUTTON_INVALID" "JOY_BUTTON_LEFT_SHOULDER" "JOY_BUTTON_LEFT_STICK"
+ "JOY_BUTTON_MAX" "JOY_BUTTON_MISC1" "JOY_BUTTON_PADDLE1" "JOY_BUTTON_PADDLE2"
+ "JOY_BUTTON_PADDLE3" "JOY_BUTTON_PADDLE4" "JOY_BUTTON_RIGHT_SHOULDER" "JOY_BUTTON_RIGHT_STICK"
+ "JOY_BUTTON_SDL_MAX" "JOY_BUTTON_START" "JOY_BUTTON_TOUCHPAD" "JOY_BUTTON_X" "JOY_BUTTON_Y"
+ "KEY_0" "KEY_1" "KEY_2" "KEY_3" "KEY_4" "KEY_5" "KEY_6" "KEY_7" "KEY_8" "KEY_9" "KEY_A"
+ "KEY_ALT" "KEY_AMPERSAND" "KEY_APOSTROPHE" "KEY_ASCIICIRCUM" "KEY_ASCIITILDE" "KEY_ASTERISK"
+ "KEY_AT" "KEY_B" "KEY_BACK" "KEY_BACKSLASH" "KEY_BACKSPACE" "KEY_BACKTAB" "KEY_BAR"
+ "KEY_BRACELEFT" "KEY_BRACERIGHT" "KEY_BRACKETLEFT" "KEY_BRACKETRIGHT" "KEY_C" "KEY_CAPSLOCK"
+ "KEY_CLEAR" "KEY_CODE_MASK" "KEY_COLON" "KEY_COMMA" "KEY_CTRL" "KEY_D" "KEY_DELETE" "KEY_DOLLAR"
+ "KEY_DOWN" "KEY_E" "KEY_END" "KEY_ENTER" "KEY_EQUAL" "KEY_ESCAPE" "KEY_EXCLAM" "KEY_F" "KEY_F1"
+ "KEY_F10" "KEY_F11" "KEY_F12" "KEY_F13" "KEY_F14" "KEY_F15" "KEY_F16" "KEY_F17" "KEY_F18"
+ "KEY_F19" "KEY_F2" "KEY_F20" "KEY_F21" "KEY_F22" "KEY_F23" "KEY_F24" "KEY_F25" "KEY_F26"
+ "KEY_F27" "KEY_F28" "KEY_F29" "KEY_F3" "KEY_F30" "KEY_F31" "KEY_F32" "KEY_F33" "KEY_F34"
+ "KEY_F35" "KEY_F4" "KEY_F5" "KEY_F6" "KEY_F7" "KEY_F8" "KEY_F9" "KEY_FAVORITES" "KEY_FORWARD"
+ "KEY_G" "KEY_GLOBE" "KEY_GREATER" "KEY_H" "KEY_HELP" "KEY_HOME" "KEY_HOMEPAGE" "KEY_HYPER"
+ "KEY_I" "KEY_INSERT" "KEY_J" "KEY_JIS_EISU" "KEY_JIS_KANA" "KEY_K" "KEY_KEYBOARD" "KEY_KP_0"
+ "KEY_KP_1" "KEY_KP_2" "KEY_KP_3" "KEY_KP_4" "KEY_KP_5" "KEY_KP_6" "KEY_KP_7" "KEY_KP_8"
+ "KEY_KP_9" "KEY_KP_ADD" "KEY_KP_DIVIDE" "KEY_KP_ENTER" "KEY_KP_MULTIPLY" "KEY_KP_PERIOD"
+ "KEY_KP_SUBTRACT" "KEY_L" "KEY_LAUNCH0" "KEY_LAUNCH1" "KEY_LAUNCH2" "KEY_LAUNCH3" "KEY_LAUNCH4"
+ "KEY_LAUNCH5" "KEY_LAUNCH6" "KEY_LAUNCH7" "KEY_LAUNCH8" "KEY_LAUNCH9" "KEY_LAUNCHA"
+ "KEY_LAUNCHB" "KEY_LAUNCHC" "KEY_LAUNCHD" "KEY_LAUNCHE" "KEY_LAUNCHF" "KEY_LAUNCHMAIL"
+ "KEY_LAUNCHMEDIA" "KEY_LEFT" "KEY_LESS" "KEY_LOCATION_LEFT" "KEY_LOCATION_RIGHT"
+ "KEY_LOCATION_UNSPECIFIED" "KEY_M" "KEY_MASK_ALT" "KEY_MASK_CMD_OR_CTRL" "KEY_MASK_CTRL"
+ "KEY_MASK_GROUP_SWITCH" "KEY_MASK_KPAD" "KEY_MASK_META" "KEY_MASK_SHIFT" "KEY_MEDIANEXT"
+ "KEY_MEDIAPLAY" "KEY_MEDIAPREVIOUS" "KEY_MEDIARECORD" "KEY_MEDIASTOP" "KEY_MENU" "KEY_META"
+ "KEY_MINUS" "KEY_MODIFIER_MASK" "KEY_N" "KEY_NONE" "KEY_NUMBERSIGN" "KEY_NUMLOCK" "KEY_O"
+ "KEY_OPENURL" "KEY_P" "KEY_PAGEDOWN" "KEY_PAGEUP" "KEY_PARENLEFT" "KEY_PARENRIGHT" "KEY_PAUSE"
+ "KEY_PERCENT" "KEY_PERIOD" "KEY_PLUS" "KEY_PRINT" "KEY_Q" "KEY_QUESTION" "KEY_QUOTEDBL"
+ "KEY_QUOTELEFT" "KEY_R" "KEY_REFRESH" "KEY_RIGHT" "KEY_S" "KEY_SCROLLLOCK" "KEY_SEARCH"
+ "KEY_SECTION" "KEY_SEMICOLON" "KEY_SHIFT" "KEY_SLASH" "KEY_SPACE" "KEY_SPECIAL" "KEY_STANDBY"
+ "KEY_STOP" "KEY_SYSREQ" "KEY_T" "KEY_TAB" "KEY_U" "KEY_UNDERSCORE" "KEY_UNKNOWN" "KEY_UP"
+ "KEY_V" "KEY_VOLUMEDOWN" "KEY_VOLUMEMUTE" "KEY_VOLUMEUP" "KEY_W" "KEY_X" "KEY_Y" "KEY_YEN"
+ "KEY_Z" "METHOD_FLAGS_DEFAULT" "METHOD_FLAG_CONST" "METHOD_FLAG_EDITOR" "METHOD_FLAG_NORMAL"
+ "METHOD_FLAG_OBJECT_CORE" "METHOD_FLAG_STATIC" "METHOD_FLAG_VARARG" "METHOD_FLAG_VIRTUAL"
+ "MIDI_MESSAGE_ACTIVE_SENSING" "MIDI_MESSAGE_AFTERTOUCH" "MIDI_MESSAGE_CHANNEL_PRESSURE"
+ "MIDI_MESSAGE_CONTINUE" "MIDI_MESSAGE_CONTROL_CHANGE" "MIDI_MESSAGE_NONE"
+ "MIDI_MESSAGE_NOTE_OFF" "MIDI_MESSAGE_NOTE_ON" "MIDI_MESSAGE_PITCH_BEND"
+ "MIDI_MESSAGE_PROGRAM_CHANGE" "MIDI_MESSAGE_QUARTER_FRAME" "MIDI_MESSAGE_SONG_POSITION_POINTER"
+ "MIDI_MESSAGE_SONG_SELECT" "MIDI_MESSAGE_START" "MIDI_MESSAGE_STOP"
+ "MIDI_MESSAGE_SYSTEM_EXCLUSIVE" "MIDI_MESSAGE_SYSTEM_RESET" "MIDI_MESSAGE_TIMING_CLOCK"
+ "MIDI_MESSAGE_TUNE_REQUEST" "MOUSE_BUTTON_LEFT" "MOUSE_BUTTON_MASK_LEFT"
+ "MOUSE_BUTTON_MASK_MB_XBUTTON1" "MOUSE_BUTTON_MASK_MB_XBUTTON2" "MOUSE_BUTTON_MASK_MIDDLE"
+ "MOUSE_BUTTON_MASK_RIGHT" "MOUSE_BUTTON_MIDDLE" "MOUSE_BUTTON_NONE" "MOUSE_BUTTON_RIGHT"
+ "MOUSE_BUTTON_WHEEL_DOWN" "MOUSE_BUTTON_WHEEL_LEFT" "MOUSE_BUTTON_WHEEL_RIGHT"
+ "MOUSE_BUTTON_WHEEL_UP" "MOUSE_BUTTON_XBUTTON1" "MOUSE_BUTTON_XBUTTON2" "OK" "OP_ADD" "OP_AND"
+ "OP_BIT_AND" "OP_BIT_NEGATE" "OP_BIT_OR" "OP_BIT_XOR" "OP_DIVIDE" "OP_EQUAL" "OP_GREATER"
+ "OP_GREATER_EQUAL" "OP_IN" "OP_LESS" "OP_LESS_EQUAL" "OP_MAX" "OP_MODULE" "OP_MULTIPLY"
+ "OP_NEGATE" "OP_NOT" "OP_NOT_EQUAL" "OP_OR" "OP_POSITIVE" "OP_POWER" "OP_SHIFT_LEFT"
+ "OP_SHIFT_RIGHT" "OP_SUBTRACT" "OP_XOR" "PROPERTY_HINT_ARRAY_TYPE"
+ "PROPERTY_HINT_COLOR_NO_ALPHA" "PROPERTY_HINT_DIR" "PROPERTY_HINT_ENUM"
+ "PROPERTY_HINT_ENUM_SUGGESTION" "PROPERTY_HINT_EXPRESSION" "PROPERTY_HINT_EXP_EASING"
+ "PROPERTY_HINT_FILE" "PROPERTY_HINT_FLAGS" "PROPERTY_HINT_GLOBAL_DIR"
+ "PROPERTY_HINT_GLOBAL_FILE" "PROPERTY_HINT_GLOBAL_SAVE_FILE"
+ "PROPERTY_HINT_HIDE_QUATERNION_EDIT" "PROPERTY_HINT_INT_IS_OBJECTID"
+ "PROPERTY_HINT_INT_IS_POINTER" "PROPERTY_HINT_LAYERS_2D_NAVIGATION"
+ "PROPERTY_HINT_LAYERS_2D_PHYSICS" "PROPERTY_HINT_LAYERS_2D_RENDER"
+ "PROPERTY_HINT_LAYERS_3D_NAVIGATION" "PROPERTY_HINT_LAYERS_3D_PHYSICS"
+ "PROPERTY_HINT_LAYERS_3D_RENDER" "PROPERTY_HINT_LAYERS_AVOIDANCE" "PROPERTY_HINT_LINK"
+ "PROPERTY_HINT_LOCALE_ID" "PROPERTY_HINT_LOCALIZABLE_STRING" "PROPERTY_HINT_MAX"
+ "PROPERTY_HINT_MULTILINE_TEXT" "PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE"
+ "PROPERTY_HINT_NODE_PATH_VALID_TYPES" "PROPERTY_HINT_NODE_TYPE" "PROPERTY_HINT_NONE"
+ "PROPERTY_HINT_OBJECT_ID" "PROPERTY_HINT_OBJECT_TOO_BIG" "PROPERTY_HINT_PASSWORD"
+ "PROPERTY_HINT_PLACEHOLDER_TEXT" "PROPERTY_HINT_RANGE" "PROPERTY_HINT_RESOURCE_TYPE"
+ "PROPERTY_HINT_SAVE_FILE" "PROPERTY_HINT_TYPE_STRING" "PROPERTY_USAGE_ALWAYS_DUPLICATE"
+ "PROPERTY_USAGE_ARRAY" "PROPERTY_USAGE_CATEGORY" "PROPERTY_USAGE_CHECKABLE"
+ "PROPERTY_USAGE_CHECKED" "PROPERTY_USAGE_CLASS_IS_BITFIELD" "PROPERTY_USAGE_CLASS_IS_ENUM"
+ "PROPERTY_USAGE_DEFAULT" "PROPERTY_USAGE_DEFERRED_SET_RESOURCE" "PROPERTY_USAGE_EDITOR"
+ "PROPERTY_USAGE_EDITOR_BASIC_SETTING" "PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT"
+ "PROPERTY_USAGE_GROUP" "PROPERTY_USAGE_HIGH_END_GFX" "PROPERTY_USAGE_INTERNAL"
+ "PROPERTY_USAGE_KEYING_INCREMENTS" "PROPERTY_USAGE_NEVER_DUPLICATE"
+ "PROPERTY_USAGE_NIL_IS_VARIANT" "PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" "PROPERTY_USAGE_NONE"
+ "PROPERTY_USAGE_NO_EDITOR" "PROPERTY_USAGE_NO_INSTANCE_STATE" "PROPERTY_USAGE_READ_ONLY"
+ "PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" "PROPERTY_USAGE_RESTART_IF_CHANGED"
+ "PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" "PROPERTY_USAGE_SCRIPT_VARIABLE" "PROPERTY_USAGE_SECRET"
+ "PROPERTY_USAGE_STORAGE" "PROPERTY_USAGE_STORE_IF_NULL" "PROPERTY_USAGE_SUBGROUP"
+ "PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" "SIDE_BOTTOM" "SIDE_LEFT" "SIDE_RIGHT" "SIDE_TOP"
+ "TYPE_AABB" "TYPE_ARRAY" "TYPE_BASIS" "TYPE_BOOL" "TYPE_CALLABLE" "TYPE_COLOR" "TYPE_DICTIONARY"
+ "TYPE_FLOAT" "TYPE_INT" "TYPE_MAX" "TYPE_NIL" "TYPE_NODE_PATH" "TYPE_OBJECT"
+ "TYPE_PACKED_BYTE_ARRAY" "TYPE_PACKED_COLOR_ARRAY" "TYPE_PACKED_FLOAT32_ARRAY"
+ "TYPE_PACKED_FLOAT64_ARRAY" "TYPE_PACKED_INT32_ARRAY" "TYPE_PACKED_INT64_ARRAY"
+ "TYPE_PACKED_STRING_ARRAY" "TYPE_PACKED_VECTOR2_ARRAY" "TYPE_PACKED_VECTOR3_ARRAY" "TYPE_PLANE"
+ "TYPE_PROJECTION" "TYPE_QUATERNION" "TYPE_RECT2" "TYPE_RECT2I" "TYPE_RID" "TYPE_SIGNAL"
+ "TYPE_STRING" "TYPE_STRING_NAME" "TYPE_TRANSFORM2D" "TYPE_TRANSFORM3D" "TYPE_VECTOR2"
+ "TYPE_VECTOR2I" "TYPE_VECTOR3" "TYPE_VECTOR3I" "TYPE_VECTOR4" "TYPE_VECTOR4I" "VERTICAL"
+ "VERTICAL_ALIGNMENT_BOTTOM" "VERTICAL_ALIGNMENT_CENTER" "VERTICAL_ALIGNMENT_FILL"
+ "VERTICAL_ALIGNMENT_TOP"))
diff --git a/runtime/queries/gdscript/indents.scm b/queries/gdscript/indents.scm
similarity index 100%
rename from runtime/queries/gdscript/indents.scm
rename to queries/gdscript/indents.scm
diff --git a/runtime/queries/func/injections.scm b/queries/gdscript/injections.scm
similarity index 100%
rename from runtime/queries/func/injections.scm
rename to queries/gdscript/injections.scm
diff --git a/runtime/queries/gdscript/locals.scm b/queries/gdscript/locals.scm
similarity index 100%
rename from runtime/queries/gdscript/locals.scm
rename to queries/gdscript/locals.scm
diff --git a/queries/gdshader/highlights.scm b/queries/gdshader/highlights.scm
new file mode 100644
index 000000000..c93fd4721
--- /dev/null
+++ b/queries/gdshader/highlights.scm
@@ -0,0 +1,142 @@
+[
+ "render_mode"
+ "shader_type"
+ "group_uniforms"
+ "global"
+ "instance"
+ "const"
+ "varying"
+ "uniform"
+] @keyword
+
+"struct" @keyword.type
+
+[
+ (precision_qualifier)
+ (interpolation_qualifier)
+] @keyword.modifier
+
+[
+ "in"
+ "out"
+ "inout"
+] @keyword.modifier
+
+[
+ "while"
+ "for"
+] @keyword.repeat
+
+[
+ "continue"
+ "break"
+ "return"
+] @keyword.return
+
+[
+ "if"
+ "else"
+ "switch"
+ "case"
+ "default"
+] @keyword.conditional
+
+[
+ "#"
+ "include"
+] @keyword.directive
+
+(string) @string
+
+[
+ "="
+ "+="
+ "-="
+ "!"
+ "~"
+ "+"
+ "-"
+ "*"
+ "/"
+ "%"
+ "||"
+ "&&"
+ "|"
+ "^"
+ "&"
+ "=="
+ "!="
+ ">"
+ ">="
+ "<="
+ "<"
+ "<<"
+ ">>"
+ "++"
+ "--"
+] @operator
+
+(boolean) @boolean
+
+(integer) @number
+
+(float) @number.float
+
+[
+ "."
+ ","
+ ";"
+] @punctuation.delimiter
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+(builtin_type) @type.builtin
+
+(ident_type) @type.definition
+
+[
+ (shader_type)
+ (render_mode)
+ (hint_name)
+] @attribute
+
+(builtin_variable) @constant.builtin
+
+(builtin_function) @function.builtin
+
+(group_uniforms_declaration
+ group_name: (ident) @property
+ subgroup_name: (ident) @property)
+
+(struct_declaration
+ name: (ident) @type)
+
+(struct_member
+ name: (ident) @property)
+
+(function_declaration
+ name: (ident) @function)
+
+(parameter
+ name: (ident) @variable.parameter)
+
+(member_expr
+ member: (ident) @property)
+
+(call_expr
+ function: [
+ (ident)
+ (builtin_type)
+ ] @function)
+
+(call_expr
+ function: (builtin_type) @function.call)
+
+(comment) @comment @spell
diff --git a/runtime/queries/gap/injections.scm b/queries/gdshader/injections.scm
similarity index 100%
rename from runtime/queries/gap/injections.scm
rename to queries/gdshader/injections.scm
diff --git a/runtime/queries/git_config/folds.scm b/queries/git_config/folds.scm
similarity index 100%
rename from runtime/queries/git_config/folds.scm
rename to queries/git_config/folds.scm
diff --git a/runtime/queries/git_config/highlights.scm b/queries/git_config/highlights.scm
similarity index 89%
rename from runtime/queries/git_config/highlights.scm
rename to queries/git_config/highlights.scm
index 557ac60ec..6b37e9090 100644
--- a/runtime/queries/git_config/highlights.scm
+++ b/queries/git_config/highlights.scm
@@ -7,7 +7,7 @@
((section_header
(section_name) @keyword.import
(subsection_name))
- (#any-of? @keyword.import "includeIf" "includeif"))
+ (#eq? @keyword.import "includeIf"))
(variable
(name) @property)
@@ -47,7 +47,7 @@
((variable
(name) @_name
value: (string) @string.special.url)
- (#any-of? @_name "insteadOf" "insteadof"))
+ (#eq? @_name "insteadOf"))
; Punctuation
[
diff --git a/runtime/queries/git_config/injections.scm b/queries/git_config/injections.scm
similarity index 92%
rename from runtime/queries/git_config/injections.scm
rename to queries/git_config/injections.scm
index 8b4d69282..7bda6979c 100644
--- a/runtime/queries/git_config/injections.scm
+++ b/queries/git_config/injections.scm
@@ -4,7 +4,7 @@
((variable
(name) @_name
value: (string) @injection.content)
- (#any-of? @_name "cmd" "command" "textconv" "sendmailCmd" "sendmailcmd")
+ (#any-of? @_name "cmd" "command" "textconv" "sendmailCmd")
(#set! injection.language "bash"))
(section
@@ -29,7 +29,7 @@
(name) @_name
value: (string) @injection.content)
(#eq? @_interactive "interactive")
- (#any-of? @_name "diffFilter" "difffilter")
+ (#eq? @_name "diffFilter")
(#set! injection.language "bash"))
; https://github.com/git-lfs/git-lfs
diff --git a/runtime/queries/git_rebase/highlights.scm b/queries/git_rebase/highlights.scm
similarity index 100%
rename from runtime/queries/git_rebase/highlights.scm
rename to queries/git_rebase/highlights.scm
diff --git a/runtime/queries/git_rebase/injections.scm b/queries/git_rebase/injections.scm
similarity index 100%
rename from runtime/queries/git_rebase/injections.scm
rename to queries/git_rebase/injections.scm
diff --git a/runtime/queries/gitattributes/highlights.scm b/queries/gitattributes/highlights.scm
similarity index 100%
rename from runtime/queries/gitattributes/highlights.scm
rename to queries/gitattributes/highlights.scm
diff --git a/runtime/queries/gdscript/injections.scm b/queries/gitattributes/injections.scm
similarity index 100%
rename from runtime/queries/gdscript/injections.scm
rename to queries/gitattributes/injections.scm
diff --git a/runtime/queries/gitattributes/locals.scm b/queries/gitattributes/locals.scm
similarity index 100%
rename from runtime/queries/gitattributes/locals.scm
rename to queries/gitattributes/locals.scm
diff --git a/runtime/queries/gitcommit/highlights.scm b/queries/gitcommit/highlights.scm
similarity index 100%
rename from runtime/queries/gitcommit/highlights.scm
rename to queries/gitcommit/highlights.scm
diff --git a/runtime/queries/gitcommit/injections.scm b/queries/gitcommit/injections.scm
similarity index 100%
rename from runtime/queries/gitcommit/injections.scm
rename to queries/gitcommit/injections.scm
diff --git a/runtime/queries/gitignore/highlights.scm b/queries/gitignore/highlights.scm
similarity index 100%
rename from runtime/queries/gitignore/highlights.scm
rename to queries/gitignore/highlights.scm
diff --git a/runtime/queries/gdshader/injections.scm b/queries/gitignore/injections.scm
similarity index 100%
rename from runtime/queries/gdshader/injections.scm
rename to queries/gitignore/injections.scm
diff --git a/runtime/queries/gleam/folds.scm b/queries/gleam/folds.scm
similarity index 100%
rename from runtime/queries/gleam/folds.scm
rename to queries/gleam/folds.scm
diff --git a/runtime/queries/gleam/highlights.scm b/queries/gleam/highlights.scm
similarity index 98%
rename from runtime/queries/gleam/highlights.scm
rename to queries/gleam/highlights.scm
index f25926f92..5238c601b 100644
--- a/runtime/queries/gleam/highlights.scm
+++ b/queries/gleam/highlights.scm
@@ -5,7 +5,6 @@
"panic"
"todo"
"use"
- "echo"
] @keyword
"type" @keyword.type
@@ -106,7 +105,7 @@
(string) @string
; Bit Strings
-(bit_array_segment) @string.special
+(bit_string_segment) @string.special
; Numbers
(integer) @number
diff --git a/runtime/queries/gleam/indents.scm b/queries/gleam/indents.scm
similarity index 92%
rename from runtime/queries/gleam/indents.scm
rename to queries/gleam/indents.scm
index a8fa961d5..c79854508 100644
--- a/runtime/queries/gleam/indents.scm
+++ b/queries/gleam/indents.scm
@@ -7,13 +7,15 @@
(constant)
(external_function)
(function)
+ (import)
(let)
(list)
+ (constant)
+ (function)
(type_definition)
(type_alias)
(todo)
(tuple)
- (unqualified_imports)
] @indent.begin
[
diff --git a/runtime/queries/gleam/injections.scm b/queries/gleam/injections.scm
similarity index 100%
rename from runtime/queries/gleam/injections.scm
rename to queries/gleam/injections.scm
diff --git a/runtime/queries/gleam/locals.scm b/queries/gleam/locals.scm
similarity index 91%
rename from runtime/queries/gleam/locals.scm
rename to queries/gleam/locals.scm
index 0058b660e..39909a4aa 100644
--- a/runtime/queries/gleam/locals.scm
+++ b/queries/gleam/locals.scm
@@ -27,5 +27,8 @@
; Block Scope
(block) @local.scope
+; Function Body Scope
+(function_body) @local.scope
+
; Case Scope
(case_clause) @local.scope
diff --git a/runtime/queries/glimmer/folds.scm b/queries/glimmer/folds.scm
similarity index 100%
rename from runtime/queries/glimmer/folds.scm
rename to queries/glimmer/folds.scm
diff --git a/runtime/queries/glimmer/highlights.scm b/queries/glimmer/highlights.scm
similarity index 100%
rename from runtime/queries/glimmer/highlights.scm
rename to queries/glimmer/highlights.scm
diff --git a/runtime/queries/glimmer/indents.scm b/queries/glimmer/indents.scm
similarity index 100%
rename from runtime/queries/glimmer/indents.scm
rename to queries/glimmer/indents.scm
diff --git a/queries/glimmer/injections.scm b/queries/glimmer/injections.scm
new file mode 100644
index 000000000..30b438682
--- /dev/null
+++ b/queries/glimmer/injections.scm
@@ -0,0 +1,21 @@
+; comments
+((comment_statement) @injection.content
+ (#set! injection.language "comment"))
+
+;