diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-10-25 17:15:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-25 17:15:50 -0700 |
| commit | 71b5ca5ef1d716803c2e2fddeec0da11737f5699 (patch) | |
| tree | 6c4b269d5da4e040dd247a3ee15243ae8d1e86f1 /lua | |
| parent | fix(health): "root directory" not reported #3402 (diff) | |
| download | nvim-lspconfig-71b5ca5ef1d716803c2e2fddeec0da11737f5699.tar nvim-lspconfig-71b5ca5ef1d716803c2e2fddeec0da11737f5699.tar.gz nvim-lspconfig-71b5ca5ef1d716803c2e2fddeec0da11737f5699.tar.bz2 nvim-lspconfig-71b5ca5ef1d716803c2e2fddeec0da11737f5699.tar.lz nvim-lspconfig-71b5ca5ef1d716803c2e2fddeec0da11737f5699.tar.xz nvim-lspconfig-71b5ca5ef1d716803c2e2fddeec0da11737f5699.tar.zst nvim-lspconfig-71b5ca5ef1d716803c2e2fddeec0da11737f5699.zip | |
feat: ts_query_ls (for tree-sitter query files) #3404
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/configs/ts_query_ls.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lua/lspconfig/configs/ts_query_ls.lua b/lua/lspconfig/configs/ts_query_ls.lua new file mode 100644 index 00000000..5a50e07c --- /dev/null +++ b/lua/lspconfig/configs/ts_query_ls.lua @@ -0,0 +1,45 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ts_query_ls' }, + filetypes = { 'query' }, + root_dir = util.root_pattern('queries', '.git'), + settings = { + parser_aliases = { + ecma = 'javascript', + jsx = 'javascript', + php_only = 'php', + }, + }, + }, + docs = { + description = [[ +https://github.com/ribru17/ts_query_ls +Can be configured by passing a "settings" object to `ts_query_ls.setup{}`: +```lua +require('lspconfig').ts_query_ls.setup{ + settings = { + parser_install_directories = { + -- If using nvim-treesitter with lazy.nvim + vim.fs.joinpath( + vim.fn.stdpath('data'), + '/lazy/nvim-treesitter/parser/' + ), + }, + -- This setting is provided by default + parser_aliases = { + ecma = 'javascript', + jsx = 'javascript', + php_only = 'php', + }, + -- E.g. zed support + language_retrieval_patterns = { + 'languages/src/([^/]+)/[^/]+\\.scm$', + }, + }, +} +``` +]], + }, +} |
