Work in progress VSCode extension for a DSL based on TypeScript. See microsoft/vscode#85788.
Provide all IntelliSense features that VSCode provides for TypeScript, but for custom file extension (e.g. *.sts
). This is needed to support "internal" DSLs: custom languages that use a subset of TypeScript.
This is a VSCode extension that configures a language (*.sts
files) and activates a TS server plugin that enables TypeScript language service for the new file extension. tsconfig.json
are virtual: they are generated on the fly based on stsconfig.json
by redirecting filesystem calls.
- Autocomplete and hover tips
- Providing custom declarations
- Go to defintion for
*.ts
and*.sts
- Auto-import
- Virtual
tsconfig.json
: custom settings are read fromstsconfig.json
npm install
npm run build
code .
# In VSCode press 'F5' (Use fn on Mac), new VSCode instance will open, open ./example directory with it
# Follow https://github.com/microsoft/vscode/wiki/How-to-Contribute to build local VSCode
# Use `yarn watch` to build VSCode
# enable TSS_LOG (see https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29#logging)
export TSS_LOG="-level verbose -file ~/vscode-sts/tss.log"
# inside VSCode directory
./scripts/code.sh --extensionDevelopmentPath=$ABSOLUTE_PATH_TO_VSCODE_STS_DIRECTORY ~/vscode-sts/example
VSCode uses built-in typescript-language-features extension that spawns TS server (TypeScript Language Service). TS server supports plugin system. VSCode extension can provide a plugin to a TS server.
TypeScript is not using LSP, however 2 third-party solutions exists:
- https://github.com/theia-ide/typescript-language-server (wraps TS server)
- https://github.com/sourcegraph/javascript-typescript-langserver
- https://github.com/Quramy/typescript-eslint-language-service
- https://github.com/justjavac/typescript-deno-plugin
- https://github.com/mrmckeb/typescript-plugin-css-modules
- https://github.com/runem/lit-analyzer/tree/master/packages/ts-lit-plugin
- https://github.com/angular/vscode-ng-language-service
- https://github.com/Microsoft/typescript-tslint-plugin