GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cursorless-dev/vscode-parse-tree: Syntax trees for VSCode using tree-sitter

BranchesTags
Open more actions menu

Latest commit

 

History

373 Commits
373 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
images
images
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.nvmrc
.nvmrc
 
 
.oxfmtrc.json
.oxfmtrc.json
 
 
.vscodeignore
.vscodeignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
copy-assets.sh
copy-assets.sh
 
 
oxlint.config.mts
oxlint.config.mts
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tree-sitter-small.png
tree-sitter-small.png
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Parse tree

Exposes an api function that can be used to get a parse tree for a given file.

Usage

Can be used as follows:

const parseTreeExtension = vscode.extensions.getExtension("pokey.parse-tree");

if (parseTreeExtension == null) {
  throw new Error("Depends on pokey.parse-tree extension");
}

const { loadLanguage } = await parseTreeExtension.activate();

Don't forget to add an extensionDependencies-entry to package.json as described in https://code.visualstudio.com/api/references/vscode-api#extensions.

Contributing

Setup

  1. npm install

Adding a new language

It's straightforward to add any language with a tree-sitter grammar.

  1. Add a dependency on the npm package for that language in tree-sitter-wasms
  2. Add a language to the map in languages.ts
  3. Add a reference to onLanguage:yourlang to the activationEvents section of package.json. yourlang must be a VSCode language identifier.
  4. Run npm install and npm run build, then hit F5 in VSCode, with this project open, to test your changes.
  5. Submit a PR!

Developing on WSL2

When working with WSL, the host vscode instance connects to a vscode server on the WSL vm. This happens automatically when you run "code" in WSL, as long as you have the "Remote - WSL" extension installed on the host. From there you need to:

  • Install the pokey.command-server extension on the host vscode
  • Clone the extension in the WSL side.
  • If you're adding language support to vscode-parse-tree, you need to clone that as well, build it, and link it into the vscode-server extension folder: ln -s ~/your/code/vscode-parse-tree ~/.vscode-server/extensions/parse-tree for instance.
  • If you get errors about needing to install the Remote-WSL extension, you might need to manually delete the extension from the host side and try again.

Change Log

See CHANGELOG.md.

Credits

Forked from https://github.com/georgewfraser/vscode-tree-sitter.

About

Syntax trees for VSCode using tree-sitter

Topics

parservscode-extension

Resources

Readme
MIT license

Code of conduct

Code of conduct
Activity
Custom properties

Stars

56 stars

Watchers

3 watching

Forks

43 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.