/ast-grep-vscode

VSCode extension package for ast-grep language server

Primary LanguageTypeScriptMIT LicenseMIT

ast-grep-vscode

VSCode extension package for ast-grep language server

Features

  • Code search
  • Code linting(*)
  • Code actions(*)

Note, code linting and code actions requires setting up sgconfig.yml in your workspace root.

Requirements

# 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:

You can also use the command line tool to set it up.

ast-grep new

Commands

  • ast-grep.restartLanguageServer Restart ast-grep langauge server. Useful to reload rule or configuration changes.

Extension Settings

This extension contributes the following settings:

  • astGrep.serverPath: Specify the language server binary path.