Skip to content

Latest commit

 

History

History
70 lines (50 loc) · 1.93 KB

File metadata and controls

70 lines (50 loc) · 1.93 KB

Developing scip-typescript

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.

References

  • 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.

Running tests

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

Debugging

Print debugging

For 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

Skipping files/test for local development

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.

Snapshotting arbitrary projects

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-java

Publishing a release

First, 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