Skip to main content
Back to Extensions Directory
coc-tsserver icon

javascript and typescript language features extension of coc.nvim

Installation CommandVim prompt
:CocInstall coc-tsserver
GitHub owner
Neoclide
Version
v2.4.1
npm package
coc-tsserver
Requirements
coc ^0.0.82
License
MIT
Repository
GitHub
npm latest published 2026-08-07Registry checked 2026-08-23Registry summary

Published Package Summary

coc-tsserver

Actions

coc-tsserver

Tsserver language server extension for coc.nvim.

Tsserver is part of TypeScript which provide rich language features for javascript and typescript.

This extension is a fork of typescript-language-features extension which is bundled with VSCode. File type detect and syntax highlight are not supported by this extension, use other vim plugin instead.

Important note: from v2.0.0, tsserver module resolved first from global configuration tsserver.tsdk and use bundled module when not found, if tsserver.useLocalTsdk is enabled, workspace folder configured tsserver.tsdk or typescript module inside current workspace folder would be used when exists.

Install

In your vim/neovim, run command:

:CocInstall coc-tsserver

For yarn2 ( >= v2.0.0-rc.36) user want to use local typescript module:

  • Run command yarn dlx @yarnpkg/sdks vim, which will generate .vim/coc-settings.json, with content:

    {
      "eslint.packageManager": "yarn",
      "eslint.nodePath": ".yarn/sdks",
      "workspace.workspaceFolderCheckCwd": false,
      "tsserver.tsdk": ".yarn/sdks/typescript/lib"
    }
    

Features

Almost the same as VSCode.

  • Supports javascript & typescript and jsx/tsx (make sure the buffer filetype is typescriptreact or javascriptreact).
  • Installs typings automatically.
  • Commands to work with tsserver, including:
    • tsserver.reloadProjects
    • tsserver.openTsServerLog
    • tsserver.goToProjectConfig
    • tsserver.restart
    • tsserver.watchBuild
    • tsserver.findAllFileReferences
  • Code completion support.
  • Go to definition (more info in microsoft/TypeScript#37777)
  • Code validation.
  • Document highlight.
  • Document symbols of current buffer.
  • Folding and folding range of current buffer.
  • Format current buffer, range format and format on type.
  • Hover for documentation.
  • Implementations codeLens and references codeLens.
  • Organize imports command.
  • Quickfix using code actions.
  • Code refactor using code actions.
  • Source code action, including:
    • Fix all fixable JS/TS issues.
    • Remove all unused code.
    • Add all missing imports.
    • Organize Imports.
    • Sort Imports.
    • Remove Unused Imports
  • Find references.
  • Signature help.
  • Call hierarchy.
  • Selection range.
  • Semantic tokens.
  • Rename symbols support.
  • Automatic tag closing.
  • Rename imports on file rename, require watchman installed in your $PATH.
  • Search for workspace symbols.
  • Inlay hints support using virtual text feature of neovim, which requires:
    • TypeScript >= 4.4.0
    • Neovim >= 0.4.0
    • Enabled by options starts with typescript.inlayHints or javascript.inlayHints.

Tsserver module first resolved from your local workspace. If it's not found, use tsserver from tsserver.tsdk configuration or use bundled tsserver with this extension.

Related extensions

Troubleshooting

  • Add "tsserver.log": "verbose" to your coc-settings.json (opened by command :CocConfig)
  • To trace LSP communication, add "tsserver.trace.server": "verbose" to your coc-settings.json
  • Restart coc server by command :CocRestart
  • Make the issue happen.
  • Open tsserver log file by command CocCommand tsserver.openTsServerLog
  • Open tsserver output channel by command CocCommand workspace.showOutput tsserver

If you find any issues, please create an issue.

Q & A

Q: React syntax not recognized by tsserver.

A: Make sure to use javascriptreact and typescriptreact for buffer filetype.

autocmd BufNewFile,BufRead *.tsx setlocal filetype=typescriptreact
autocmd BufNewFile,BufRead *.jsx setlocal filetype=javascriptreact

Add those autocmds to your vimrc.

Q: Automatic type acquisition not work.

A: configure tsserver.npm to your global npm path or configure "tsserver.disableAutomaticTypeAcquisition": false to disable automatic typings installation.

Q: The extension needs some time to work.

A: The initialize of tsserver requires some time, you can add g:coc_status to your status line, see :h coc-status. If your tsserver get slow, try exclude unnecessary files in your jsconfig.json/tsconfig.json, make sure typescript version > 4.9 and disable logging (disabled by default).

Q: Update import on file rename not work.

A: Make sure install watchman in your $PATH. Use command :CocCommand workspace.showOutput watchman to check watchman output.

Q: Not work with buffer just created.

A: Tsserver treat buffer without a disk file belongs to implicit project, VSCode could work because VSCode create empty file first for buffer, save the buffer to disk to make tsserver work.

Q: Not work with my javascript project.

A: Configure jsconfig.json to make tsserver understand your code. Some features may still not work well, it's recommended to use typescript.

Q: Not work on WSL.

A: Copy you project files from mounted dirs to linux home otherwise tsserver may not work properly.

Sponsoring

If you like coc-tsserver, consider supporting me on Patreon or PayPal:

Patreon donate button PayPal donate button

License

MIT

Read the complete README
  • javascript and typescript language features extension of coc.nvim
Activation Events
  • onLanguage:javascript
  • onLanguage:javascriptreact
  • onLanguage:javascript.jsx
  • onLanguage:typescript
  • onLanguage:typescript.tsx
  • onLanguage:typescript.jsx
  • onLanguage:typescriptreact
  • onLanguage:jsx-tags
  • onLanguage:jsonc
  • onCommand:_typescript.configurePlugin
  • onCommand:tsserver.reloadProjects
  • onCommand:tsserver.goToProjectConfig
  • onCommand:tsserver.openTsServerLog
  • onCommand:tsserver.goToSourceDefinition
  • onCommand:tsserver.watchBuild
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version History

Published with coc-tsserver@2.4.1 as history.md.

Open source file

2.4.1

  • Fix tsserver.reloadProjects blocking all subsequent requests: tsserver never sends a response for reloadProjects, so coc-tsserver no longer waits for one.

2.4.0

  • Sync upstream commits from vscode typescript-language-features, see migrate.md.
  • Added configuration typescript.showConvertToAsync to skip TS80006 "convert to async" suggestion in diagnostics.
  • Added command typescript.tsserverRequest for plugins that need to forward commands to tsserver (e.g. Volar).
  • Load typescriptServerPlugins contributed plugins automatically by sending globalPlugins and pluginPaths in the configure request.
  • Added configuration typescript.format.indentSwitchCase and javascript.format.indentSwitchCase.
  • Added configuration typescript.preferences.autoImportSpecifierExcludeRegexes and javascript.preferences.autoImportSpecifierExcludeRegexes.
  • Added configuration typescript.preferences.organizeImports and javascript.preferences.organizeImports with unicodeCollation, caseSensitivity, typeOrder, caseFirst, accentCollation, locale and numericCollation options.
  • Added configuration typescript.implementationsCodeLens.showOnInterfaceMethods, typescript.implementationsCodeLens.showOnAllClassMethods and the javascript equivalents.
  • Added configuration typescript.workspaceSymbols.excludeLibrarySymbols, sent to tsserver as excludeLibrarySymbolsInNavTo preference.
  • Added configuration tsserver.implicitProjectConfig.strict for implicit project.
  • Default of tsserver.implicitProjectConfig.target changed to ES2024, support ES2023 and ES2024.
  • tsserver.log supports requestTime log level.
  • Added configuration typescript.hover.maximumLength and javascript.hover.maximumLength.
  • Fix signature help active overload not updating when arguments narrow the overload set.
  • Fix user preferences not sent to tsserver when no visible editor.
  • Fix stale tsserver events from old server process being dispatched.
  • Implicit project uses react-jsx jsx transform and explicit compiler option defaults.

2.3.1

  • Added configuration tsserver.socketPath for standalone tsserver (not recommended).
  • Fix tsserver.watchBuild not work on windows.

2.3.0

  • Added configuration tsserver.disabledSchemes.
  • Use in memory prefix for none file buffer, avoid server error.

2.2.5

  • Add configuration typescript.preferences.preferTypeOnlyAutoImports.

2.2.4

  • Improve file select on refactor.

2.2.3

  • Remove unnecessary selection on refactor.

2.2.2

  • Support module target of tsconfig.json.

2.2.1

  • Show warning message when insert closing tag which can be disabled.

2.2.0

2.1.0

  • Support "Remove Unused Imports" source action.

2.0.9

  • Support tsserver.tsdk as workspace folder value (should be path relative to workspace folder), only used when tsserver.useLocalTsdk is true.

2.0.8

  • Upgrade typescript to 4.9.3.
  • Support tsserver.useLocalTsdk as user configuration, not recommended since the local typescript module could be outdated.
  • Fix range of completionItem when triggered by #
  • Avoid cache cancelled response for code lens.

2.0.3

  • Pass triggerReason and kind for refactor request.

2.0.0

  • Global tsserver.tsdk would be used when exists by default.
  • Fix action with notApplicableReason not disabled.
  • Added TypeScriptAutoFixProvider for provide source actions.
  • Added configurations:
    • tsserver.useLocalTsdk
    • tsserver.useSyntaxServer
    • tsserver.experimental.enableProjectDiagnostics very experimental state
    • typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName
    • javascript.inlayHints.variableTypes.suppressWhenTypeMatchesName
    • typescript.preferences.autoImportFileExcludePatterns
    • javascript.preferences.autoImportFileExcludePatterns
    • tsserver.implicitProjectConfig.module
    • tsserver.implicitProjectConfig.target
    • tsserver.implicitProjectConfig.strictNullChecks
    • tsserver.implicitProjectConfig.strictFunctionTypes
  • Renamed configurations:
    • javascript.updateImportsOnFileMove.enable => javascript.updateImportsOnFileMove.enabled
    • typescript.updateImportsOnFileMove.enable => typescript.updateImportsOnFileMove.enabled
    • javascript.referencesCodeLens.enable => javascript.referencesCodeLens.enabled
    • typescript.referencesCodeLens.enable => typescript.referencesCodeLens.enabled
    • javascript.implementationsCodeLens.enable => javascript.implementationsCodeLens.enabled
    • typescript.format.enabled => typescript.format.enable
    • javascript.format.enabled => javascript.format.enable
    • typescript.implementationsCodeLens.enable => typescript.implementationsCodeLens.enabled
  • referencesCodeLens and implementationsCodeLens changed to disabled by default.
  • Remove configuration typescript.suggest.importStatements, always true.
  • Remove configuration tsserver.ignoreLocalTsserver, local tsserver not used by default, use tsserver.useLocalTsdk to enable tsserver from workspace folder.
  • watchBuild use resolved config file returned from tsserver by default.
  • Add command tsserver.chooseVersion

1.12.0

  • Disable snippet function completion when following character is (.
  • Remove configuration tsserver.typingsCacheLocation.
  • Remove configuration tsserver.formatOnType.
  • Remove configuration tsserver.enableJavascript.
  • Remove configuration tsserver.useBatchedBufferSync.
  • Support preference tsserver provideRefactorNotApplicableReason.
  • Added scope for configurations, support some language-overridable configurations.

1.11.0

  • Add command tsserver.goToSourceDefinition.

1.10.5

  • Fix a fold issue #380

1.10.2

  • Fix snippet completion not work for optional complete item.

1.10.1

  • Avoid unnecessary fetch of format option.
  • Add typescript.suggest.objectLiteralMethodSnippets.enabled

1.10.0

  • Support jsdoc completion.
  • Add configurations javascript.suggest.completeJSDocs and typescript.suggest.completeJSDocs.

1.9.15

  • Fix uri for zipfile.

1.9.14

  • Add javascript snippets
  • Fix command tsserver.restart not work

1.9.11

  • Resued resolved tsserver path after :CocRestart

1.9.10

  • Watch for tsserver.enable configuration to change service state.
  • Fix tsserver not work well with :CocList services

1.9.9

  • Use documentChanges for workspaceEdit.

1.9.8

  • Log to output when document content exceed limit of semantic tokens.

1.9.7

  • Change default of javascript.autoClosingTags and typescript.autoClosingTags to true.

1.9.6

  • Rework codeLens related.

1.9.5

  • Change 'allImportsAreUnused' diagnostic kind to warning.

1.9.4

  • Improve file pattern for config file.

1.9.2

  • Inlay hints support (#335)

1.9.1

  • use TSS_DEBUG & TSS_DEBUG_BRK for debug port

1.9.0

  • Add semanticTokens support #313
  • Add jsxAttributeCompletionStyle settings #319
  • Add command tsserver.sortImports #322
  • Add suggest.classMemberSnippets.enabled configuration cd16da8
  • Add suggest.jsdoc.generateReturns configuration 5a8c68f
  • Add typescript.preferences.includePackageJsonAutoImports configuration 4d78b61
  • Add tsserver.enableTracing configuration 43e6f62
  • Add typescript.check.npmIsInstalled configuration 3bd84b1

1.8.3

  • Support deprecated tag for document symbols, diagnostic, workspace symbols.

1.8.2

  • Support call hierarchy.
  • Support tags and access modifier for document symbols.
  • Support return DefinitionLink[] for definition provider.

1.8.1

  • Support tsserver.tsconfigPath configuration.

1.8.0

1.7.0

  • Support tag closing for JSX

1.6.4

  • Support typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces and ypescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces

1.6.2

  • Support languages from plugins.

1.5.5

  • Support typescript.preferences.useAliasesForRenames and javascript.preferences.useAliasesForRenames

1.5.3

  • Support the new path of Yarn v2 pnpify SDK.
  • Us tsserver.pluginPaths replace tsserver.pluginRoot.

1.5.0

  • Support @ts-expect-error directive on tsserver v390.
  • Support tsserver.watchOptions configuration.

1.4.13

  • Add preferences.importModuleSpecifierEnding configuration.
  • Change preferences.importModuleSpecifier default to auto.

1.4.12

  • Support tsserver.maxTsServerMemory configuration.

1.4.9

  • Support semicolons format option.

1.4.8

  • support format.enabled configuration

1.4.3

  • Use global tsc when local tsc not foun

1.4.0

  • remove noSemicolons preferences

1.3.15

  • Add missing option "auto" to importModuleSpecifier

1.3.11

  • Add tsserver.ignoreLocalTsserver configuration.

1.3.6

  • Support b:coc_tsserver_disable

1.3.2

  • fix suggestionActions.enabled configuration not working

1.3.1

  • fix validate.enable not work sometimes

1.3.0

  • Loading status.
  • Batched buffer synchronize.
  • Configuration for showUnused variable.
  • Smart selection support.
  • Support 'auto' as quoteStyle.
  • Support 'validateDefaultNpmLocation'.

1.1.30

  • rework of typescriptService, support interuptGetErr

1.1.29

  • Support plugin feature.

1.1.28

  • add codeAction provider for import missing node builtin modules.

1.1.26

  • Add install module codeAction for module not found diagnostic.
  • Rework tsserver.watchBuild, use background process, support statusline.

1.1.25

  • Support autofix of node modules import

1.1.23

  • Add command tsserver.executeAutofix

1.1.13

  • Add triggerCharacters for SignatureHelp

1.1.12

  • Add typescript snippets from VSCode

1.1.11

  • Fix throw error of "No content available" on completion.

1.1.10

  • Support projectRootPath for document

1.1.9

  • Support commitCharacters of completion items

1.1.8

  • Add status bar support.

1.1.7

  • Add settings javascript.validate.enable and typescript.validate.enable

1.1.6

  • Fix suggestionActions.enabled not works

1.1.5

  • Use quickfix list for watchBuild errors

1.1.4

  • Fix organizeImports not working sometimes

1.1.3

  • Remove settings with commaAfterImport, use typescript.preferences.noSemicolons and javasscript.preferences.noSemicolons instead.

1.1.2

  • Support diagnostic of config file.

1.1.1

  • Remove unnecessary use of workspace terminal.

1.1.0