VSCode extension package for ast-grep language server
- Code search
- Code linting(*)
- Code actions(*)
Note, code linting and code actions requires setting up sgconfig.yml
in your workspace root.
- ast-grep binary in your path.
# install via npm
npm i @ast-grep/cli -g
# install via cargo
cargo install ast-grep
# install via homebrew
brew install ast-grep
-
setting up ast-grep project.
This is an optional step to enable code linting and code actions. It requires at least one file and one folder to work:
sgconfig.yml
, the project configuration file- a directory storing rule files, conventionally
rules/
You can also use the command line tool to set it up.
ast-grep new
ast-grep.restartLanguageServer
Restart ast-grep langauge server. Useful to reload rule or configuration changes.
This extension contributes the following settings:
astGrep.serverPath
: Specify the language server binary path.