[[language]]
name = "go"
extensions = ["go"]
repo = "https://github.com/tree-sitter/tree-sitter-go"
branch = "master"
symbol = "tree_sitter_go"
color = "#00ADD8"
definition_query = """
(
(comment)* @doc
.
(function_declaration
name: (identifier) @name
body: (block) @body) @function.definition
)
(
(comment)* @doc
.
(method_declaration
name: (field_identifier) @name
body: (block) @body) @method.definition
)
"""
call_query = """
(call_expression
function: [
(identifier) @name
(parenthesized_expression (identifier) @name)
(selector_expression
operand: (_) @qualifier
field: (field_identifier) @name)
(parenthesized_expression (selector_expression
operand: (_) @qualifier
field: (field_identifier) @name))
]) @reference.call
"""
import_query = """
(import_spec
name: [
(package_identifier) @alias
(dot) @dot_import
(blank_identifier) @side_effect
]?
path: [
(interpreted_string_literal) @path
(raw_string_literal) @path
])
"""
[language.lsp]
binary = "gopls"
args = ["serve"]
go_package = "golang.org/x/tools/gopls@latest"
[[language]]
name = "zig"
extensions = ["zig"]
repo = "https://github.com/tree-sitter-grammars/tree-sitter-zig"
branch = "master"
symbol = "tree_sitter_zig"
color = "#F7A41D"
definition_query = """
(
(comment)* @doc
.
(function_declaration
name: (identifier) @name
body: (block) @body) @function.definition
)
"""
call_query = """
(call_expression
function: (identifier) @name) @reference.call
(call_expression
function: (field_expression
object: (_) @qualifier
member: (identifier) @name)) @reference.call
"""
import_query = """
(variable_declaration
(identifier) @name
(builtin_function
(builtin_identifier) @_builtin
(arguments
(string (string_content) @path)))
(#eq? @_builtin "@import")) @import
"""
[language.lsp]
binary = "zls"
args = []
url_template = "https://github.com/zigtools/zls/releases/download/{version}/zls-{target}.tar.xz"
archive = "tar.xz"
[language.lsp.targets]
"x86_64-unknown-linux-gnu" = "x86_64-linux"
"aarch64-unknown-linux-gnu" = "aarch64-linux"
"x86_64-apple-darwin" = "x86_64-macos"
"aarch64-apple-darwin" = "aarch64-macos"
[[language]]
name = "c"
extensions = ["c", "h"]
repo = "https://github.com/tree-sitter/tree-sitter-c"
branch = "master"
symbol = "tree_sitter_c"
color = "#555555"
definition_query = """
(
(comment)* @doc
.
(function_definition
declarator: [
(function_declarator
declarator: (identifier) @name)
(pointer_declarator
declarator: (function_declarator
declarator: (identifier) @name))
]
body: (compound_statement) @body) @function.definition
)
"""
call_query = """
(call_expression
function: [
(identifier) @name
(field_expression
argument: (_) @qualifier
field: (field_identifier) @name)
(parenthesized_expression (identifier) @name)
]) @reference.call
"""
import_query = """
(preproc_include
path: [
(system_lib_string) @system_path
(string_literal) @local_path
]) @include
"""
[language.lsp]
binary = "clangd"
args = []
version = "21.1.0"
url_template = "https://github.com/clangd/clangd/releases/download/{version}/clangd-{target}-{version}.zip"
archive = "zip"
binary_path = "clangd_{version}/bin/clangd"
[language.lsp.targets]
"x86_64-unknown-linux-gnu" = "linux-x86_64"
"x86_64-apple-darwin" = "mac-x86_64"
"aarch64-apple-darwin" = "mac-arm64"
"x86_64-pc-windows-msvc" = "windows-x86_64"
[[language]]
name = "cpp"
extensions = ["cpp", "cc", "cxx", "hpp", "hxx"]
repo = "https://github.com/tree-sitter/tree-sitter-cpp"
branch = "master"
symbol = "tree_sitter_cpp"
color = "#f34b7d"
definition_query = """
(
(comment)* @doc
.
(function_definition
declarator: (function_declarator
declarator: (identifier) @name)
body: (compound_statement) @body) @function.definition
)
(
(comment)* @doc
.
(function_definition
declarator: (function_declarator
declarator: (qualified_identifier
name: (identifier) @name))
body: (compound_statement) @body) @method.definition
)
(
(comment)* @doc
.
(function_definition
declarator: (pointer_declarator
declarator: (function_declarator
declarator: (identifier) @name))
body: (compound_statement) @body) @function.definition
)
(
(comment)* @doc
.
(function_definition
declarator: (reference_declarator
(function_declarator
declarator: (qualified_identifier
name: [(identifier) (operator_name) (destructor_name)] @name)))
body: (compound_statement) @body) @method.definition
)
(
(comment)* @doc
.
(function_definition
declarator: (function_declarator
declarator: (qualified_identifier
name: (destructor_name) @name))
body: (compound_statement) @body) @method.definition
)
(
(comment)* @doc
.
(template_declaration
(function_definition
declarator: (function_declarator
declarator: (qualified_identifier
name: (identifier) @name))
body: (compound_statement) @body)) @function.definition
)
"""
call_query = """
(call_expression
function: [
(identifier) @name
(qualified_identifier
scope: (_) @qualifier
name: (identifier) @name)
(template_function name: (identifier) @name)
(field_expression
argument: (_) @qualifier
field: (field_identifier) @name)
]) @reference.call
"""
import_query = """
(preproc_include
path: [
(system_lib_string) @system_path
(string_literal) @local_path
]) @include
"""
[language.lsp]
binary = "clangd"
args = []
version = "21.1.0"
url_template = "https://github.com/clangd/clangd/releases/download/{version}/clangd-{target}-{version}.zip"
archive = "zip"
binary_path = "clangd_{version}/bin/clangd"
[language.lsp.targets]
"x86_64-unknown-linux-gnu" = "linux-x86_64"
"x86_64-apple-darwin" = "mac-x86_64"
"aarch64-apple-darwin" = "mac-arm64"
"x86_64-pc-windows-msvc" = "windows-x86_64"
[[language]]
name = "python"
extensions = ["py"]
repo = "https://github.com/tree-sitter/tree-sitter-python"
branch = "master"
symbol = "tree_sitter_python"
color = "#3572A5"
definition_query = """
(
(comment)* @doc
.
(function_definition
name: (identifier) @name
body: (block) @body) @function.definition
)
(
(comment)* @doc
.
(class_definition
name: (identifier) @name
body: (block) @body) @class.definition
)
"""
call_query = """
(call
function: [
(identifier) @name
(attribute
object: (_) @qualifier
attribute: (identifier) @name)
]) @reference.call
"""
import_query = """
(import_statement
name: [
(dotted_name) @path
(aliased_import
name: (dotted_name) @path
alias: (identifier) @alias)
]) @import
(import_from_statement
module_name: [
(dotted_name) @module
(relative_import) @module
]
name: [
(dotted_name) @name
(aliased_import
name: (dotted_name) @name
alias: (identifier) @alias)
]?
(wildcard_import)? @wildcard) @import
"""
[language.lsp]
binary = "pyright-langserver"
args = ["--stdio"]
npm_package = "pyright"
[[language]]
name = "typescript"
extensions = ["ts", "mts", "cts"]
repo = "https://github.com/tree-sitter/tree-sitter-typescript"
branch = "master"
subpath = "typescript"
symbol = "tree_sitter_typescript"
color = "#3178c6"
definition_query = """
(
(comment)* @doc
.
(function_declaration
name: (identifier) @name
body: (statement_block) @body) @function.definition
)
(
(comment)* @doc
.
(lexical_declaration
(variable_declarator
name: (identifier) @name
value: (arrow_function
body: (_) @body))) @function.definition
)
(
(comment)* @doc
.
(method_definition
name: (property_identifier) @name
body: (statement_block) @body) @method.definition
)
"""
call_query = """
(call_expression
function: [
(identifier) @name
(member_expression
object: (_) @qualifier
property: (property_identifier) @name)
]) @reference.call
"""
import_query = """
(import_statement
(import_clause
[
(identifier) @default_import
(named_imports
(import_specifier
name: (identifier) @name
alias: (identifier)? @alias))
(namespace_import (identifier) @namespace)
])
source: (string (string_fragment) @source)) @import
"""
[language.lsp]
binary = "typescript-language-server"
args = ["--stdio"]
npm_package = "typescript-language-server typescript"
[[language]]
name = "rust"
extensions = ["rs"]
repo = "https://github.com/tree-sitter/tree-sitter-rust"
branch = "master"
symbol = "tree_sitter_rust"
color = "#dea584"
definition_query = """
(
(line_comment)* @doc
.
(function_item
name: (identifier) @name
body: (block) @body) @function.definition
)
"""
call_query = """
(call_expression
function: [
(identifier) @name
(scoped_identifier
path: (_) @qualifier
name: (identifier) @name)
(field_expression
value: (_) @qualifier
field: (field_identifier) @name)
]) @reference.call
"""
import_query = """
(use_declaration
argument: [
(identifier) @path
(scoped_identifier) @path
(use_as_clause
path: [
(identifier) @path
(scoped_identifier) @path
]
alias: (identifier) @alias)
(use_list) @list
(scoped_use_list
path: [
(identifier) @path
(scoped_identifier) @path
])
(use_wildcard) @wildcard
]) @import
(mod_item
name: (identifier) @mod_name) @mod_decl
"""
[language.lsp]
binary = "rust-analyzer"
args = []
version = "2024-12-23"
url_template = "https://github.com/rust-lang/rust-analyzer/releases/download/{version}/rust-analyzer-{target}.gz"
archive = "gz"
[language.lsp.targets]
"x86_64-unknown-linux-gnu" = "x86_64-unknown-linux-gnu"
"x86_64-unknown-linux-musl" = "x86_64-unknown-linux-musl"
"aarch64-unknown-linux-gnu" = "aarch64-unknown-linux-gnu"
"x86_64-apple-darwin" = "x86_64-apple-darwin"
"aarch64-apple-darwin" = "aarch64-apple-darwin"
"x86_64-pc-windows-msvc" = "x86_64-pc-windows-msvc"
[[language]]
name = "javascript"
extensions = ["js", "mjs", "cjs"]
repo = "https://github.com/tree-sitter/tree-sitter-javascript"
branch = "master"
symbol = "tree_sitter_javascript"
color = "#f1e05a"
definition_query = """
(
(comment)* @doc
.
(function_declaration
name: (identifier) @name
body: (statement_block) @body) @function.definition
)
(
(comment)* @doc
.
(lexical_declaration
(variable_declarator
name: (identifier) @name
value: (arrow_function
body: (_) @body))) @function.definition
)
(
(comment)* @doc
.
(method_definition
name: (property_identifier) @name
body: (statement_block) @body) @method.definition
)
"""
call_query = """
(call_expression
function: [
(identifier) @name
(member_expression
object: (_) @qualifier
property: (property_identifier) @name)
]) @reference.call
"""
import_query = """
(import_statement
(import_clause
[
(identifier) @default_import
(named_imports
(import_specifier
name: (identifier) @name
alias: (identifier)? @alias))
(namespace_import (identifier) @namespace)
])
source: (string (string_fragment) @source)) @import
(call_expression
function: (identifier) @_require
arguments: (arguments (string (string_fragment) @source))
(#eq? @_require "require")) @require
"""
[language.lsp]
binary = "typescript-language-server"
args = ["--stdio"]
npm_package = "typescript-language-server typescript"
[[language]]
name = "java"
extensions = ["java"]
repo = "https://github.com/tree-sitter/tree-sitter-java"
branch = "master"
symbol = "tree_sitter_java"
color = "#b07219"
definition_query = """
(class_body
(block_comment) @doc
.
(method_declaration
name: (identifier) @name
body: (_) @body) @method.definition
)
(class_body
(block_comment) @doc
.
(constructor_declaration
name: (identifier) @name
body: (_) @body) @method.definition
)
(method_declaration
name: (identifier) @name
body: (_) @body) @method.definition
(constructor_declaration
name: (identifier) @name
body: (_) @body) @method.definition
"""
call_query = """
(method_invocation
object: (_)? @qualifier
name: (identifier) @name) @reference.call
(object_creation_expression
type: (type_identifier) @name) @reference.call
"""
import_query = """
(import_declaration
[
(scoped_identifier) @path
(identifier) @path
]
(asterisk)? @wildcard) @import
"""
[language.lsp]
binary = "jdtls"
args = ["-data", "/tmp/jdtls-workspace"]
version = "1.54.0"
url_template = "https://download.eclipse.org/jdtls/milestones/{version}/{filename}"
latest_txt_url = "https://download.eclipse.org/jdtls/milestones/{version}/latest.txt"
archive = "tar.gz"
binary_path = "bin/jdtls"
[[language]]
name = "scala"
extensions = ["scala", "sc"]
repo = "https://github.com/tree-sitter/tree-sitter-scala"
branch = "master"
symbol = "tree_sitter_scala"
color = "#c22d40"
definition_query = """
(
(block_comment)* @doc
.
(function_definition
name: (identifier) @name
body: (_) @body) @function.definition
)
(
(block_comment)* @doc
.
(function_declaration
name: (identifier) @name) @function.definition
)
(
(block_comment)* @doc
.
(class_definition
name: (identifier) @name
body: (template_body) @body) @class.definition
)
(
(block_comment)* @doc
.
(object_definition
name: (identifier) @name
body: (template_body) @body) @object.definition
)
(
(block_comment)* @doc
.
(trait_definition
name: (identifier) @name
body: (template_body) @body) @trait.definition
)
"""
call_query = """
(call_expression
function: [
(identifier) @name
(field_expression
value: (_) @qualifier
field: (identifier) @name)
]) @reference.call
"""
import_query = """
(import_declaration
path: (_)+ @path
[
(namespace_wildcard) @wildcard
(namespace_selectors) @selectors
(as_renamed_identifier) @alias
]?) @import
"""
[language.lsp]
binary = "metals"
args = []
[[language]]
name = "nix"
extensions = ["nix"]
repo = "https://github.com/nix-community/tree-sitter-nix"
branch = "master"
symbol = "tree_sitter_nix"
color = "#7e7eff"
definition_query = """
(
(comment)* @doc
.
(binding
attrpath: (attrpath
attr: (identifier) @name)
expression: (function_expression
body: (_) @body)) @function.definition
)
"""
call_query = """
(apply_expression
function: [
(variable_expression
name: (identifier) @name)
(select_expression
expression: (_) @qualifier
attrpath: (attrpath
attr: (identifier) @name))
(apply_expression
function: (variable_expression
name: (identifier) @name))
]) @reference.call
"""
import_query = """
(apply_expression
function: (variable_expression
name: (identifier) @_import)
argument: [
(path_expression) @path
(spath_expression) @path
(string_expression) @path
(variable_expression
name: (identifier) @path)
]
(#eq? @_import "import")) @import
(apply_expression
function: (select_expression
attrpath: (attrpath
attr: (identifier) @_fetch))
(#match? @_fetch "^fetch.*")) @import
"""
[language.lsp]
binary = "nil"
args = []
cargo_crate = "nil"
[[language]]
name = "lua"
extensions = ["lua"]
repo = "https://github.com/tree-sitter-grammars/tree-sitter-lua"
branch = "master"
symbol = "tree_sitter_lua"
color = "#000080"
definition_query = """
(
(comment)* @doc
.
(function_declaration
name: [
(identifier) @name
(dot_index_expression
field: (identifier) @name)
(method_index_expression
method: (identifier) @name)
]
body: (block) @body) @function.definition
)
(variable_declaration
(assignment_statement
(variable_list
name: (identifier) @name)
(expression_list
value: (function_definition
body: (block) @body)))) @function.definition
(table_constructor
(field
name: (identifier) @name
value: (function_definition
body: (block) @body))) @function.definition
"""
call_query = """
(function_call
name: [
(identifier) @name
(dot_index_expression
table: (_) @qualifier
field: (identifier) @name)
(method_index_expression
table: (_) @qualifier
method: (identifier) @name)
]) @reference.call
"""
import_query = """
(function_call
name: (identifier) @_fn
arguments: (arguments
(string
content: (string_content) @path))
(#any-of? @_fn "require" "dofile" "loadfile")) @import
"""
[language.lsp]
binary = "lua-language-server"
args = []
version = "3.16.4"
url_template = "https://github.com/LuaLS/lua-language-server/releases/download/{version}/lua-language-server-{version}-{target}.tar.gz"
archive = "tar.gz"
binary_path = "bin/lua-language-server"
[language.lsp.targets]
"x86_64-unknown-linux-gnu" = "linux-x64"
"aarch64-unknown-linux-gnu" = "linux-arm64"
"x86_64-apple-darwin" = "darwin-x64"
"aarch64-apple-darwin" = "darwin-arm64"
[[language]]
name = "ruby"
extensions = ["rb", "rake", "gemspec", "ru"]
repo = "https://github.com/tree-sitter/tree-sitter-ruby"
branch = "master"
symbol = "tree_sitter_ruby"
color = "#701516"
definition_query = """
(
(comment)* @doc
.
(method
name: (_) @name
body: (_)? @body) @function.definition
)
(
(comment)* @doc
.
(singleton_method
name: (_) @name
body: (_)? @body) @function.definition
)
(
(comment)* @doc
.
(class
name: [
(constant) @name
(scope_resolution name: (_) @name)
]
body: (_)? @body) @class.definition
)
(
(comment)* @doc
.
(module
name: [
(constant) @name
(scope_resolution name: (_) @name)
]
body: (_)? @body) @module.definition
)
"""
call_query = """
(call
receiver: (_)? @qualifier
method: (identifier) @name) @reference.call
"""
import_query = """
(call
method: (identifier) @_method
arguments: (argument_list
(string (string_content) @path))
(#any-of? @_method "require" "require_relative" "load")) @import
"""
[language.lsp]
binary = "ruby-lsp"
args = []
[[language]]
name = "csharp"
extensions = ["cs", "csx"]
repo = "https://github.com/tree-sitter/tree-sitter-c-sharp"
branch = "master"
symbol = "tree_sitter_c_sharp"
color = "#178600"
definition_query = """
(
(comment)* @doc
.
(method_declaration
name: (identifier) @name
body: (block) @body) @method.definition
)
(
(comment)* @doc
.
(local_function_statement
name: (identifier) @name
body: (block) @body) @function.definition
)
(
(comment)* @doc
.
(constructor_declaration
name: (identifier) @name
body: (block) @body) @method.definition
)
(
(comment)* @doc
.
(class_declaration
name: (identifier) @name
body: (declaration_list) @body) @class.definition
)
(
(comment)* @doc
.
(interface_declaration
name: (identifier) @name
body: (declaration_list) @body) @interface.definition
)
"""
call_query = """
(invocation_expression
function: [
(identifier) @name
(member_access_expression
expression: (_) @qualifier
name: (identifier) @name)
]) @reference.call
(object_creation_expression
type: [
(identifier) @name
(qualified_name
qualifier: (_) @qualifier
name: (identifier) @name)
(generic_name
(identifier) @name)
]) @reference.call
"""
import_query = """
(using_directive
[
(identifier) @path
(qualified_name) @path
]) @import
"""
[language.lsp]
binary = "OmniSharp"
args = ["-lsp"]
version = "v1.39.13"
url_template = "https://github.com/OmniSharp/omnisharp-roslyn/releases/download/{version}/omnisharp-{target}.zip"
archive = "zip"
[language.lsp.targets]
"x86_64-unknown-linux-gnu" = "linux-x64-net6.0"
"aarch64-unknown-linux-gnu" = "linux-arm64-net6.0"
"x86_64-apple-darwin" = "osx-x64-net6.0"
"aarch64-apple-darwin" = "osx-arm64-net6.0"
[[language]]
name = "kotlin"
extensions = ["kt", "kts"]
repo = "https://github.com/fwcd/tree-sitter-kotlin"
branch = "main"
symbol = "tree_sitter_kotlin"
color = "#A97BFF"
definition_query = """
(
(multiline_comment)* @doc
.
(function_declaration
(simple_identifier) @name
(function_body)? @body) @function.definition
)
(
(multiline_comment)* @doc
.
(class_declaration
(type_identifier) @name
(class_body)? @body) @class.definition
)
"""
call_query = """
(call_expression
(simple_identifier) @name) @reference.call
(call_expression
(navigation_expression
(navigation_suffix
(simple_identifier) @name))) @reference.call
"""
import_query = """
(import_header
(identifier) @path) @import
"""
[language.lsp]
binary = "kotlin-language-server"
args = []
version = "1.3.13"
url_template = "https://github.com/fwcd/kotlin-language-server/releases/download/{version}/server.zip"
archive = "zip"
binary_path = "server/bin/kotlin-language-server"
[[language]]
name = "swift"
extensions = ["swift"]
repo = "https://github.com/alex-pinkus/tree-sitter-swift"
branch = "main"
symbol = "tree_sitter_swift"
color = "#F05138"
definition_query = """
(function_declaration
name: (simple_identifier) @name) @function.definition
(class_declaration
name: (type_identifier) @name) @class.definition
(protocol_declaration
name: (type_identifier) @name) @interface.definition
"""
call_query = """
(call_expression
(simple_identifier) @name) @reference.call
(call_expression
(navigation_expression
(navigation_suffix
(simple_identifier) @name))) @reference.call
"""
import_query = """
(import_declaration
(identifier) @path) @import
"""
[language.lsp]
binary = "sourcekit-lsp"
args = []
[[language]]
name = "haskell"
extensions = ["hs"]
repo = "https://github.com/tree-sitter/tree-sitter-haskell"
branch = "master"
symbol = "tree_sitter_haskell"
color = "#5e5086"
definition_query = """
(function
name: (variable) @name) @function.definition
(bind
name: (variable) @name) @function.definition
"""
call_query = """
(apply
function: (variable) @name) @reference.call
(apply
function: (qualified
(variable) @name)) @reference.call
"""
import_query = """
(import
module: (module) @path) @import
"""
[language.lsp]
binary = "haskell-language-server-wrapper"
args = ["--lsp"]
version = "2.9.0.1"
url_template = "https://github.com/haskell/haskell-language-server/releases/download/{version}/haskell-language-server-{version}-{target}.tar.xz"
archive = "tar.xz"
[language.lsp.targets]
"x86_64-unknown-linux-gnu" = "x86_64-linux-unknown"
"aarch64-unknown-linux-gnu" = "aarch64-linux-ubuntu2004"
"x86_64-apple-darwin" = "x86_64-apple-darwin"
"aarch64-apple-darwin" = "aarch64-apple-darwin"