{"id":13469490,"url":"https://github.com/yioneko/vtsls","last_synced_at":"2026-01-12T06:55:04.349Z","repository":{"id":63671319,"uuid":"568338654","full_name":"yioneko/vtsls","owner":"yioneko","description":"LSP wrapper for typescript extension of vscode","archived":false,"fork":false,"pushed_at":"2025-03-25T16:39:55.000Z","size":1261,"stargazers_count":645,"open_issues_count":25,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-25T17:44:33.104Z","etag":null,"topics":["language-server-protocol","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yioneko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-20T07:54:54.000Z","updated_at":"2025-03-25T04:04:28.000Z","dependencies_parsed_at":"2023-10-21T03:22:44.213Z","dependency_job_id":"679b1639-683c-4946-a403-c66b69f67fde","html_url":"https://github.com/yioneko/vtsls","commit_stats":{"total_commits":329,"total_committers":7,"mean_commits":47.0,"dds":0.4072948328267477,"last_synced_commit":"541b52a341a740b1b2d1b4ae85f168dbb3ac6d25"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yioneko%2Fvtsls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yioneko%2Fvtsls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yioneko%2Fvtsls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yioneko%2Fvtsls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yioneko","download_url":"https://codeload.github.com/yioneko/vtsls/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245604230,"owners_count":20642966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language-server-protocol","typescript"],"created_at":"2024-07-31T15:01:42.081Z","updated_at":"2026-01-12T06:55:04.298Z","avatar_url":"https://github.com/yioneko.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# vtsls\n\nThis is an LSP wrapper around [TypeScript extension bundled with VSCode](https://github.com/microsoft/vscode/tree/838b48504cd9a2338e2ca9e854da9cec990c4d57/extensions/typescript-language-features). All features and performance are nearly the same.\n\nUnlike other similar projects, this is implemented by filling VSCode APIs and applying **minimal patches** onto the extension to make it possible to **keep up with the upstream updates** and drastically reduce the burden of maintenance.\n\n**Notice:** Though the server is suitable for regular use scenarios at the current stage, there is no absolute guarantee for its robustness as the behavior of the wrapped VSCode extension doesn't always keep 100% clear to me. Users can view this server as a best-effort product but possbily not as reliable as other functionally identical alternatives.\n\n## Usage\n\nInstall by `npm install -g @vtsls/language-server`, then run `vtsls --stdio`. Requires `node \u003e= 16`.\n\n## TypeScript version\n\nSimilar to VSCode, the server is bundled with the latest TypeScript and the bundled version is used by default. To switch to the workspace version, use command `typescript.selectTypeScriptVersion` or set configuration option `vtsls.autoUseWorkspaceTsdk` to `true`. To ignore the bundled version set configuration option `vtsls.typescript.globalTsdk` to the alternative path.\n\n## LSP Features\n\nSee [available server capabilities](./packages/server/src/capabilities.ts). Here are also [references from VSCode](https://code.visualstudio.com/docs/typescript/typescript-editing).\n\n### Code Lens\n\nThe code lens command `editor.action.showReferences` should be executed by client, [relevant LSP issue here](https://github.com/microsoft/language-server-protocol/issues/1148). Command arguments:\n\n```\n[uri: DocumentUri, codeLensStart: Position, locations: Location[]]\n```\n\n### Commands\n\nSome other commands are undocumented because either it is private for server or not tested.\n\n`command`: `(arguments =\u003e result)`\n\n- `typescript.openTsServerLog`\n- `typescript.restartTsServer`\n- `typescript.reloadProjects`\n- `javascript.reloadProjects`\n- `typescript.selectTypeScriptVersion`\n- `typescript.goToSourceDefinition`: `[DocumentUri, Position] =\u003e Location[]`\n- `typescript.findAllFileReferences`: `[DocumentUri] =\u003e Location[]`\n- `typescript.goToProjectConfig`: `[DocumentUri] =\u003e null`\n- `javascript.goToProjectConfig`: `[DocumentUri] =\u003e null`\n- `_typescript.configurePlugin`: `[pluginName: string, config: any] =\u003e any`\n- `typescript.tsserverRequest`: `[RequestType, args: any, config: any] =\u003e any`\n\n  See [CommandTypes](https://github.com/microsoft/TypeScript/blob/ed15865eb065006da26a233d07c7899103b67c08/src/server/protocol.ts) for available tsserver commands.\n\n- `typescript.organizeImports`: `[filePath: string] =\u003e any`\n- `typescript.sortImports`: `[filePath: string] =\u003e any`\n- `javascript.sortImports`: `[filePath: string] =\u003e any`\n- `typescript.removeUnusedImports`: `[filePath: string] =\u003e any`\n- `javascript.removeUnusedImports`: `[filePath: string] =\u003e any`\n\n### Code Actions\n\nSame as VSCode. The list below may be outdated.\n\n#### Source Actions\n\n- `source.organizeImports`\n- `source.sortImports`\n- `source.removeUnusedImports`\n- `source.fixAll.ts`\n- `source.removeUnused.ts`\n- `source.addMissingImports.ts`\n\n#### Refactor\n\n- `refactor.extract.function`\n- `refactor.extract.constant`\n- `refactor.extract.type`\n- `refactor.extract.interface`\n- `refactor.move.newFile`\n- `refactor.move.file`\n- `refactor.rewrite.import`\n- `refactor.rewrite.export`\n- `refactor.rewrite.arrow.braces`\n- `refactor.rewrite.property.generateAccessors`\n\nInline refactor action can carry an additional `editor.action.rename` command for immediate renaming of new extracted symbol. The command should be executed on the client side. Command arguments:\n\n```\n[uri: DocumentUri, position: Position][]\n```\n\n##### Move to file refactor\n\nThis action is disabled by default because its correct functioning requires special handling on the client side. Set `vtsls.enableMoveToFileCodeAction` to `true` to let the server expose this code action with a `_typescript.moveToFileRefactoring` command. Command arguments:\n\n\n```\n[action: any, uri: DocumentUri, range: Range]\n```\n\nOn the client side, the client should firstly ask user to select a target move file, and append the path of file to the command arguments:\n\n\n```\n[action: any, uri: DocumentUri, range: Range, targetFile: string]\n```\n\nThen send the `workspace/executeCommand` request to server with the original command while the command arguments is modified as above.\n\n### Update paths on rename\n\nRequire client to send [`workspace/didRenameFiles`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didRenameFiles) notification on rename of file/folder.\n\n## Configuration\n\nAlmost the same as the original VSCode extension, with a few additional settings excluded for this server (prefixed with `vtsls.`).\n\nSee the configuration schema [here](./packages/service/configuration.schema.json).\n\n## Troubleshooting\n\nPlease see [Known issues](https://github.com/yioneko/vtsls/issues/26) first.\n\n### Server stuck or crashed on large repo\n\nIf any typescript plugins have been activated, try to disable all of them first. The plugins could be specified in either `tsconfig.json` or `vtsls.tsserver.globalPlugins` setting.\n\nSet `typescript.tsserver.maxTsServerMemory` to a higher value, such as 8192. The memory usage of `tsserver` increases in propotion to the scale of project it handles. To prevent `tsserver` from quickly exhausting the host RAM and making everything unusable, there is a default setting `typescript.tsserver.maxTsServerMemory` which is passed as `--max-old-space-size` to the `tsserver` node process. VSCode defaults the limit to 3072 (3GB), which may be insufficient for some really large projects. In such cases, frequent GC might be triggered, and `tsserver` could become stuck or crash due to memory allocation failures.\n\n### Bad performance of completion\n\n`tsserver` could throw out plenty of completion entries, most of them are globally accessible variables, modules or namespaces. Some LSP clients have poor performance for fuzzy matching or filtering, and cause noticeable delay of completion.\n\nInstead of switching client, some server configuration options could also make partial optimizations:\n\n- `vtsls.experimental.completion.enableServerSideFuzzyMatch`: before returning all the completion candidates from `tsserver`, the server will do fuzzy matching and filter out entries with no match. This can reduce the number of invalid entries in the response.\n- `vtsls.experimental.completion.entriesLimit`: set the maximum number of completion entries to return.\n- `typescript.preferences.includePackageJsonAutoImports = 'off'`\n- `typescript.preferences.autoImportFileExcludePatterns`\n\n### TypeScript plugin not activated\n\nIf the plugin is specified in project `package.json` and installed locally:\n\n- Ensure the plugin is also specified in `compilerOptions.plugins` field of `tsconfig.json`.\n- Switch to workspace version of tsserver by command `typescript.selectTypeScriptVersion` or config option `vtsls.autoUseWorkspaceTsdk`.\n- Alternatively, set `typescript.tsserver.pluginPaths = [\"./node_modules\"]` to tell the bundled tsserver to search plugins in project local `node_modules` folder.\n\nOr if the plugin resides elsewhere, typically when you want to test a plugin without locally installing it to your package or modifying `tsconfig.json`: use config option `vtsls.tsserver.globalPlugins`. An example for [`styled-components`](https://github.com/styled-components/typescript-styled-plugin) support:\n\n```json\n[\n  {\n    \"name\": \"@styled/typescript-styled-plugin\",\n    \"location\": \"/usr/local/lib/node_modules\",\n    \"enableForWorkspaceTypeScriptVersions\": true,\n  }\n]\n```\n\n### Log\n\n- Set `typescript.tsserver.log` in configuration\n- Execute command `typescript.openTsServerLog`\n\n## Editor Integration\n\nNeovim | [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#vtsls) [nvim-vtsls](https://github.com/yioneko/nvim-vtsls)\n\n## Not Planned\n\nSome not editor-agnostic features in VSCode:\n\n- Read TypeScript plugin from VSCode extensions\n- Running in browser, the server only targets on Node environment\n- Copilot integration namely AI code actions in VSCode\n\nPlus any features not supported in VSCode.\n\n## Develop\n\n### Build\n\n```sh\ngit submodule update --init\npnpm install\npnpm build # or pnpm build:watch\n```\n\nThe server executable is at [packages/server/bin](https://github.com/yioneko/vtsls/blob/main/packages/server/bin/vtsls.js). To test it globally, run `cd packages/server \u0026\u0026 sudo npm install -g .`, then `vtsls` should be available in `$PATH`.\n\n## Similar Projects\n\n- [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server)\n- [coc-tsserver](https://github.com/neoclide/coc-tsserver)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyioneko%2Fvtsls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyioneko%2Fvtsls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyioneko%2Fvtsls/lists"}