Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ast-grep language server #2880

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions lua/lspconfig/server_configurations/ast_grep.lua
Original file line number Diff line number Diff line change
@@ -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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chrisgrieser, thanks for helping ast-grep! I wonder if we can also add sgconfig.yml here? It is also a popular yaml file extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Not at my desk the next couple of days - probably quicker when you make a PR?

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')]],
},
},
}
Loading