aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/server_configurations/ast_grep.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/lua/lspconfig/server_configurations/ast_grep.lua b/lua/lspconfig/server_configurations/ast_grep.lua
new file mode 100644
index 00000000..eba37d6b
--- /dev/null
+++ b/lua/lspconfig/server_configurations/ast_grep.lua
@@ -0,0 +1,38 @@
+local util = require 'lspconfig.util'
+
+return {
+ default_config = {
+ cmd = { 'ast-grep', 'lsp' },
+ filetypes = { -- https://ast-grep.github.io/reference/languages.html
+ 'c',
+ 'cpp',
+ 'rust',
+ 'go',
+ 'java',
+ 'python',
+ 'javascript',
+ 'typescript',
+ 'html',
+ 'css',
+ 'kotlin',
+ 'dart',
+ 'lua',
+ },
+ root_dir = util.root_pattern 'sgconfig.yaml',
+ single_file_support = true,
+ },
+ docs = {
+ description = [[
+https://ast-grep.github.io/
+
+ast-grep(sg) is a fast and polyglot tool for code structural search, lint, rewriting at large scale.
+
+```sh
+npm install [-g] @ast-grep/cli
+```
+]],
+ default_config = {
+ root_dir = [[root_pattern('sgconfig.yaml')]],
+ },
+ },
+}