From 2e324cc4aafd13ff27b407166b56d46d6a880180 Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Thu, 10 Apr 2025 12:05:34 -0400 Subject: [PATCH] fix(docs): Update `lspconfig` setup snippet --- website/guide/tools/editors.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/website/guide/tools/editors.md b/website/guide/tools/editors.md index aaefeffb..5f79833c 100644 --- a/website/guide/tools/editors.md +++ b/website/guide/tools/editors.md @@ -96,14 +96,13 @@ After reloading the VSCode window, you should see red underlines for any errors The recommended setup is using [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). ```lua -local configs = require 'lspconfig.configs' -configs.ast_grep = { - default_config = { - cmd = {'ast-grep', 'lsp'}; - single_file_support = false; - root_dir = nvim_lsp.util.root_pattern('sgconfig.yml'); - }; -} +require('lspconfig').ast_grep.setup({ + -- these are the default options, you only need to specify + -- options you'd like to change from the default + cmd = { 'ast-grep', 'lsp' }, + filetypes = { "c", "cpp", "rust", "go", "java", "python", "javascript", "typescript", "html", "css", "kotlin", "dart", "lua" }, + root_dir = require('lspconfig.util').root_pattern('sgconfig.yaml', 'sgconfig.yml') +}) ``` ### coc.nvim