Skip to content

Commit 754f0d1

Browse files
authored
fix(docs): Update lspconfig setup snippet (#728)
1 parent 3cf8edf commit 754f0d1

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

website/guide/tools/editors.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,13 @@ After reloading the VSCode window, you should see red underlines for any errors
9696
The recommended setup is using [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig).
9797

9898
```lua
99-
local configs = require 'lspconfig.configs'
100-
configs.ast_grep = {
101-
default_config = {
102-
cmd = {'ast-grep', 'lsp'};
103-
single_file_support = false;
104-
root_dir = nvim_lsp.util.root_pattern('sgconfig.yml');
105-
};
106-
}
99+
require('lspconfig').ast_grep.setup({
100+
-- these are the default options, you only need to specify
101+
-- options you'd like to change from the default
102+
cmd = { 'ast-grep', 'lsp' },
103+
filetypes = { "c", "cpp", "rust", "go", "java", "python", "javascript", "typescript", "html", "css", "kotlin", "dart", "lua" },
104+
root_dir = require('lspconfig.util').root_pattern('sgconfig.yaml', 'sgconfig.yml')
105+
})
107106
```
108107

109108
### coc.nvim

0 commit comments

Comments
 (0)