Development requires Node.js 22 or 24 and Yarn v1.22.22. The versions used by
the project are recorded in .tool-versions and package.json.
- VS Code is a good reference point for the "correct" behavior for code navigation functionality.
- Keep a local checkout of Microsoft/TypeScript for checking out code examples. Most TypeScript APIs are lacking in documentation, so reading the code is the best way to understand how things work.
# Type-check and compile the project
npm run build
# Run snapshot tests
npm run test
# Run formatting and lint checks
npm run prettier-check
npm run eslint
# Update snapshot test outputs
npm run update-snapshotsFor print debugging, you can print types using:
checker.typeToString(type)TODO: Document how to print the AST for a file
TODO: Document how to print an individual AST node
Search for the query "Uncomment below if you want to skip to find places where
you can uncomment code to skip tests/files for a faster edit/test/debug feedback
loop during local development.
cd /path/to/dir
DIR=/path/to/scip-typescript "$DIR/node_modules/.bin/tsx" "$DIR/src/main.ts" index # add --yarn-workspaces if applicable
lsif-typed index.scip > dump.lsif # from github.com/sourcegraph/sourcegraph/lib/codeintel/tools/lsif-typed
lsif-java snapshot-lsif # from github.com/sourcegraph/lsif-javaFirst, make sure you are on the main branch and have no dirty changes.
Next, run the dev/bump-version script to bump the version in package.json and
push a git tag to trigger a CI job.
./dev/bump-version VERSION_TO_RELEASE
# example: ./dev/bump-version 2.3.1
Once the release job has finished, create a GitHub release https://github.com/sourcegraph/scip-typescript/releases/new