neoclide/coc-tsserver

neoclide/coc-tsserver là dự án TypeScript với 1.1k sao trong nhóm Developer Tools. Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Snapshot
Cộng tác viên hàng đầu
Xem cộng tác viên hàng đầu
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.reloadProjectstsserver.openTsServerLogtsserver.goToProjectConfigtsserver.restarttsserver.watchBuildtsserver.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.inlayHintsorjavascript.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.
Commands
Commands contributed to :CocList commands
tsserver.reloadProjectsReload current projecttsserver.openTsServerLogOpen log file of tsserver.tsserver.goToProjectConfigOpen project config file.tsserver.restartRestart tsservertsserver.findAllFileReferencesFind File Referencestsserver.goToSourceDefinitionGo to Source Definitiontsserver.watchBuildRuntsc --watchfor current project by use vim's job feature.tsserver.executeAutofixFix autofixable problems of current document.tsserver.chooseVersionChoose different typescript version for current project.
Configuration options
Checkout :h coc-configuration for guide of coc.nvim's configuration.
tsserver.enable: Enable running of tsserver. Default:truetsserver.tsconfigPath: Path to tsconfig file for thetsserver.watchBuildcommand. Default:"tsconfig.json"tsserver.socketPath: Socket path used to connect to tsserver, the socket should be opened already (use tools like socat to start server and pipe messages to sdtio of tsserver), when exists, command line arguments related configurations wont' works. Configure the path like "127.0.0.1:7070", Default:null.tsserver.locale: Sets the locale used to report JavaScript and TypeScript errors. Defaults to use VS Code's locale. Default:"auto"Valid options: ["auto","de","es","en","fr","it","ja","ko","ru","zh-CN","zh-TW"]tsserver.useLocalTsdk: Use tsserver from typescript module in workspace folder, ignore tsserver.tsdk configuration. Default:falsetsserver.maxTsServerMemory: Set the maximum amount of memory to allocate to the TypeScript server process Default:3072tsserver.watchOptions: Configure which watching strategies should be used to keep track of files and directories. Requires using TypeScript 3.8+ in the workspace.tsserver.tsdk: Specifies the folder path to the tsserver andlib*.d.tsfiles under a TypeScript install to use for IntelliSense, for example:./node_modules/typescript/lib. - When specified as a user setting, the TypeScript version fromtsserver.tsdkautomatically replaces the built-in TypeScript version. - When specified as a workspace setting, the tsserver is used whentsserver.useLocalTsdkis true. Use command:CocCommand tsserver.chooseVersionto choose different typescript version. Default:""tsserver.npm: Specifies the path to the npm executable used for Automatic Type Acquisition. Default:""tsserver.log: Log level of tsserver Default:"off"Valid options: ["normal","terse","verbose","requestTime","off"]tsserver.trace.server: Trace level of tsserver Default:"off"Valid options: ["off","messages","verbose"]tsserver.enableTracing: Enables tracing TS server performance to a directory. These trace files can be used to diagnose TS Server performance issues. The log may contain file paths, source code, and other potentially sensitive information from your project. Default:falsetsserver.pluginPaths: Additional paths to discover TypeScript Language Service plugins. Default:[]tsserver.reportStyleChecksAsWarnings: Report style checks as warnings. Default:truetsserver.implicitProjectConfig.checkJs: Enable checkJs for implicit project Default:falsetsserver.implicitProjectConfig.module: Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module. Default:"ESNext"Valid options: ["CommonJS","AMD","System","UMD","ES6","ES2015","ES2020","ESNext","None","ES2022","Node12","NodeNext"]tsserver.implicitProjectConfig.target: Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target. Default:"ES2024"Valid options: ["ES3","ES5","ES6","ES2015","ES2016","ES2017","ES2018","ES2019","ES2020","ES2021","ES2022","ES2023","ES2024","ESNext"]tsserver.implicitProjectConfig.strictNullChecks: Enable/disable strict null checks in JavaScript and TypeScript files that are not part of a project. Existingjsconfig.jsonortsconfig.jsonfiles override this setting. Default:truetsserver.implicitProjectConfig.strictFunctionTypes: Enable/disable strict function types in JavaScript and TypeScript files that are not part of a project. Existingjsconfig.jsonortsconfig.jsonfiles override this setting. Default:truetsserver.implicitProjectConfig.strict: Enable/disable strict mode in JavaScript and TypeScript files that are not part of a project. Existingjsconfig.jsonortsconfig.jsonfiles override this setting. Default:truetsserver.implicitProjectConfig.experimentalDecorators: Enable experimentalDecorators for implicit project Default:falsetsserver.disableAutomaticTypeAcquisition: Disables automatic type acquisition. Automatic type acquisition fetches@typespackages from npm to improve IntelliSense for external libraries. Default:falsetsserver.useSyntaxServer: Controls if TypeScript launches a dedicated server to more quickly handle syntax related operations, such as computing code folding. Default:"auto"Valid options: ["always","never","auto"]tsserver.experimental.enableProjectDiagnostics: (Experimental) Enables project wide error reporting. Default:falsetypescript.check.npmIsInstalled: Check if npm is installed for Automatic Type Acquisition. Default:truetsserver.disabledSchemes: Document schemes that should be disabled for tsserver to avoid tsserver error. Default:["git", "fugitive", "vsls", "diffview", "github", "azurerepos"]typescript.showUnused: Show unused variable hint. Default:truetypescript.showDeprecated: Show deprecated variable hint. Default:truetypescript.updateImportsOnFileMove.enabled: Enable/disable automatic updating of import paths when you rename or move a file in VS Code. Default:"prompt"Valid options: ["prompt","always","never"]typescript.implementationsCodeLens.enabled: Enable codeLens for implementations Default:falsetypescript.implementationsCodeLens.showOnInterfaceMethods: Show implementations CodeLens on interface methods. Default:falsetypescript.implementationsCodeLens.showOnAllClassMethods: Show implementations CodeLens on all class methods. Default:falsetypescript.referencesCodeLens.enabled: Enable codeLens for references Default:falsetypescript.referencesCodeLens.showOnAllFunctions: Enable/disable references CodeLens on all functions in typescript files. Default:falsetypescript.preferences.importModuleSpecifier: Preferred path style for auto imports. Default:"shortest"Valid options: ["shortest","relative","non-relative","project-relative"]typescript.preferences.importModuleSpecifierEnding: Preferred path ending for auto imports. Default:"auto"Valid options: ["auto","minimal","index","js"]typescript.preferences.jsxAttributeCompletionStyle: Preferred style for JSX attribute completions. Default:"auto"Valid options: ["auto","braces","none"]typescript.preferences.includePackageJsonAutoImports: Enable/disable searchingpackage.jsondependencies for available auto imports. Default:"auto"Valid options: ["auto","on","off"]typescript.preferences.quoteStyle: Preferred quote style to use for quick fixes. Default:"auto"Valid options: ["auto","single","double"]typescript.preferences.useAliasesForRenames: Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace. Default:truetypescript.preferences.autoImportFileExcludePatterns: Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.typescript.preferences.autoImportSpecifierExcludeRegexes: Specify regular expressions for restricting auto imports. Requires using TypeScript 5.9+ in the workspace.typescript.preferences.organizeImports: Controls how Organize Imports sorts imports (unicodeCollation,caseSensitivity,typeOrder,caseFirst,accentCollation,locale,numericCollation).typescript.preferences.preferTypeOnlyAutoImports: Include thetypekeyword in auto-imports whenever possible. Requires using TypeScript 5.3+ in the workspace.typescript.preferences.renameShorthandProperties: Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace. Default:truetypescript.suggestionActions.enabled: Enable/disable suggestion diagnostics for TypeScript files in the editor. Requires using TypeScript 2.8 or newer in the workspace. Default:truetypescript.validate.enable: Enable/disable TypeScript validation. Default:truetypescript.suggest.enabled: Enabled/disable autocomplete suggestions. Default:truetypescript.suggest.paths: Enable/disable suggest paths in import statement and require calls Default:truetypescript.suggest.autoImports: Enable/disable auto import suggests. Default:truetypescript.suggest.completeFunctionCalls: Enable snippet for method suggestion Default:truetypescript.suggest.includeCompletionsForImportStatements: Enable/disable auto-import-style completions on partially-typed import statements. Requires using TypeScript 4.3+ in the workspace. Default:truetypescript.suggest.includeCompletionsWithSnippetText: Enable/disable snippet completions from TS Server. Requires using TypeScript 4.3+ in the workspace. Default:truetypescript.suggest.classMemberSnippets.enabled: Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace Default:truetypescript.suggest.jsdoc.generateReturns: Enable/disable generating@returnannotations for JSDoc templates. Requires using TypeScript 4.2+ in the workspace. Default:truetypescript.format.enable: Enable format for typescript. Default:truetypescript.format.insertSpaceAfterCommaDelimiter: Defines space handling after a comma delimiter. Default:truetypescript.format.insertSpaceAfterConstructor: Defines space handling after the constructor keyword. Default:falsetypescript.format.insertSpaceAfterSemicolonInForStatements: Defines space handling after a semicolon in a for statement. Default:truetypescript.format.insertSpaceBeforeAndAfterBinaryOperators: Defines space handling after a binary operator. Default:truetypescript.format.insertSpaceAfterKeywordsInControlFlowStatements: Defines space handling after keywords in a control flow statement. Default:truetypescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions: Defines space handling after function keyword for anonymous functions. Default:truetypescript.format.insertSpaceBeforeFunctionParenthesis: Defines space handling before function argument parentheses. Default:falsetypescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: Defines space handling after opening and before closing non-empty parenthesis. Default:falsetypescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: Defines space handling after opening and before closing non-empty brackets. Default:falsetypescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces: Defines space handling after opening and before closing empty braces. Default:falsetypescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: Defines space handling after opening and before closing non-empty braces. Default:falsetypescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: Defines space handling after opening and before closing template string braces. Default:falsetypescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: Defines space handling after opening and before closing JSX expression braces. Default:falsetypescript.format.insertSpaceAfterTypeAssertion: Defines space handling after type assertions in TypeScript. Default:falsetypescript.format.placeOpenBraceOnNewLineForFunctions: Defines whether an open brace is put onto a new line for functions or not. Default:falsetypescript.format.placeOpenBraceOnNewLineForControlBlocks: Defines whether an open brace is put onto a new line for control blocks or not. Default:falsetypescript.format.semicolons: Defines handling of optional semicolons. Requires using TypeScript 3.7 or newer in the workspace. Default:"ignore"Valid options: ["ignore","insert","remove"]typescript.format.indentSwitchCase: Defines whether an indent is inserted when acaseordefaultclause is inside aswitchstatement. Default:truetypescript.suggest.includeAutomaticOptionalChainCompletions: Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires TS 3.7+ and strict null checks to be enabled. Default:truetypescript.workspaceSymbols.scope: Controls which files are searched by go to symbol in workspace. Default:"allOpenProjects"Valid options: ["allOpenProjects","currentProject"]typescript.workspaceSymbols.excludeLibrarySymbols: Exclude symbols from library files (e.g.node_modules) when searching for symbols in the workspace. Default:truetypescript.autoClosingTags: Enable/disable automatic closing of JSX tags. Default:truetypescript.preferGoToSourceDefinition: Makes Go to Definition avoid type declaration files when possible by triggering Go to Source Definition instead. Requires using TypeScript 4.7+ in the workspace. Default:falsetypescript.hover.maximumLength: The maximum number of characters in a hover. If the hover is longer than this, it will be truncated. Requires using TypeScript 5.9+ in the workspace. Default:500javascript.showUnused: Show unused variable hint. Default:truejavascript.showDeprecated: Show deprecated variable hint. Default:truejavascript.updateImportsOnFileMove.enabled: Enable/disable automatic updating of import paths when you rename or move a file in VS Code. Default:"prompt"Valid options: ["prompt","always","never"]javascript.implementationsCodeLens.enabled: Enable/disable implementations CodeLens. This CodeLens shows the implementers of an interface. Default:falsejavascript.implementationsCodeLens.showOnInterfaceMethods: Show implementations CodeLens on interface methods. Default:falsejavascript.implementationsCodeLens.showOnAllClassMethods: Show implementations CodeLens on all class methods. Default:falsejavascript.referencesCodeLens.enabled: Enable/disable references CodeLens in JavaScript files. Default:falsejavascript.referencesCodeLens.showOnAllFunctions: Enable/disable references CodeLens on all functions in JavaScript files. Default:falsejavascript.preferences.importModuleSpecifier: Preferred path style for auto imports. Default:"shortest"Valid options: ["shortest","relative","non-relative","project-relative"]javascript.preferences.importModuleSpecifierEnding: Preferred path ending for auto imports. Default:"auto"Valid options: ["auto","minimal","index","js"]javascript.preferences.jsxAttributeCompletionStyle: Preferred style for JSX attribute completions. Default:"auto"Valid options: ["auto","braces","none"]javascript.preferences.quoteStyle: Preferred quote style to use for quick fixes. Default:"auto"Valid options: ["auto","single","double"]javascript.preferences.useAliasesForRenames: Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace. Default:truejavascript.preferences.autoImportFileExcludePatterns: Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.javascript.preferences.autoImportSpecifierExcludeRegexes: Specify regular expressions for restricting auto imports. Requires using TypeScript 5.9+ in the workspace.javascript.preferences.organizeImports: Controls how Organize Imports sorts imports (unicodeCollation,caseSensitivity,typeOrder,caseFirst,accentCollation,locale,numericCollation).javascript.preferences.renameShorthandProperties: Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace. Default:truejavascript.validate.enable: Enable/disable JavaScript validation. Default:truejavascript.suggestionActions.enabled: Enable/disable suggestion diagnostics for JavaScript files in the editor. Requires using TypeScript 2.8 or newer in the workspace. Default:truejavascript.suggest.names: Enable/disable including unique names from the file in JavaScript suggestions. Note that name suggestions are always disabled in JavaScript code that is semantically checked using@ts-checkorcheckJs. Default:truejavascript.suggest.enabled: Enabled/disable autocomplete suggestions. Default:truejavascript.suggest.paths: Enable/disable suggest paths in import statement and require calls Default:truejavascript.suggest.autoImports: Enable/disable auto import suggests. Default:truejavascript.suggest.completeFunctionCalls: Enable snippet for method suggestion Default:truejavascript.suggest.includeCompletionsForImportStatements: Enable/disable auto-import-style completions on partially-typed import statements. Requires using TypeScript 4.3+ in the workspace. Default:truejavascript.suggest.classMemberSnippets.enabled: Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace Default:truejavascript.suggest.jsdoc.generateReturns: Enable/disable generating@returnannotations for JSDoc templates. Requires using TypeScript 4.2+ in the workspace. Default:truejavascript.format.enable: Enable format for javascript. Default:truejavascript.format.insertSpaceAfterCommaDelimiter: Default:truejavascript.format.insertSpaceAfterConstructor: Default:falsejavascript.format.insertSpaceAfterSemicolonInForStatements: Default:truejavascript.format.insertSpaceBeforeAndAfterBinaryOperators: Default:truejavascript.format.insertSpaceAfterKeywordsInControlFlowStatements: Default:truejavascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions: Default:truejavascript.format.insertSpaceBeforeFunctionParenthesis: Default:falsejavascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: Default:falsejavascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: Default:falsejavascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces: Default:falsejavascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: Default:falsejavascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: Default:falsejavascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: Default:falsejavascript.format.insertSpaceAfterTypeAssertion: Default:falsejavascript.format.placeOpenBraceOnNewLineForFunctions: Default:falsejavascript.format.placeOpenBraceOnNewLineForControlBlocks: Default:falsejavascript.suggest.includeAutomaticOptionalChainCompletions: Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires TS 3.7+ and strict null checks to be enabled. Default:truetypescript.inlayHints.parameterNames.enabled: Enable/disable inlay hints of parameter names. Default:"none"Valid options: ["none","literals","all"]typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName: Suppress parameter name hints on arguments whose text is identical to the parameter name. Default:truetypescript.inlayHints.parameterTypes.enabled: Enable/disable inlay hints of parameter types. Default:falsetypescript.inlayHints.variableTypes.enabled: Enable/disable inlay hints of variable types. Default:falsetypescript.inlayHints.propertyDeclarationTypes.enabled: Enable/disable inlay hints of property declarations. Default:falsetypescript.inlayHints.functionLikeReturnTypes.enabled: Enable/disable inlay hints of return type for function signatures. Default:falsetypescript.inlayHints.enumMemberValues.enabled: Enable/disable inlay hints of enum member values. Default:falsetypescript.inlayHints.variableTypes.suppressWhenTypeMatchesName: Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace. Default:truejavascript.inlayHints.parameterNames.enabled: Enable/disable inlay hints of parameter names. Default:"none"Valid options: ["none","literals","all"]javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName: Suppress parameter name hints on arguments whose text is identical to the parameter name. Default:truejavascript.inlayHints.parameterTypes.enabled: Enable/disable inlay hints of parameter types. Default:falsejavascript.inlayHints.variableTypes.enabled: Enable/disable inlay hints of variable types. Default:falsejavascript.inlayHints.propertyDeclarationTypes.enabled: Enable/disable inlay hints of property declarations. Default:falsejavascript.inlayHints.functionLikeReturnTypes.enabled: Enable/disable inlay hints of return type for function signatures. Default:falsejavascript.inlayHints.enumMemberValues.enabled: Enable/disable inlay hints of enum member values. Default:falsejavascript.inlayHints.variableTypes.suppressWhenTypeMatchesName: Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace. Default:truejavascript.autoClosingTags: Enable/disable automatic closing of JSX tags. Default:truejavascript.preferGoToSourceDefinition: Makes Go to Definition avoid type declaration files when possible by triggering Go to Source Definition instead. Requires using TypeScript 4.7+ in the workspace. Default:falsejavascript.hover.maximumLength: The maximum number of characters in a hover. If the hover is longer than this, it will be truncated. Requires using TypeScript 5.9+ in the workspace. Default:500javascript.format.semicolons: Defines handling of optional semicolons. Requires using TypeScript 3.7 or newer in the workspace. Default:"ignore"Valid options: ["ignore","insert","remove"]javascript.format.indentSwitchCase: Defines whether an indent is inserted when acaseordefaultclause is inside aswitchstatement. Default:truejavascript.suggest.completeJSDocs: Enable/disable suggestion to complete JSDoc comments. Default:truetypescript.suggest.completeJSDocs: Enable/disable suggestion to complete JSDoc comments. Default:truejavascript.suggest.objectLiteralMethodSnippets.enabled: Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace Default:truetypescript.suggest.objectLiteralMethodSnippets.enabled: Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace Default:true
Most Configurations are the same as with VSCode. Install
coc-json and try completion with
tsserver, typescript or javascript in your
coc-settings.json.
Differences between VSCode
Added configurations by coc-tsserver:
tsserver.useLocalTsdkonly works when used as workspace folder configuration.tsserver.tsconfigPathtsserver.enable
Removed configurations:
typescript.tsserver.useSeparateSyntaxServerUsetsserver.useSyntaxServerinstead.typescript.enablePromptUseWorkspaceTsdkNo propmpts given.typescript.tsc.autoDetectUsed for task, not supported.typescript.surveys.enabledNot supported.
Renamed configurations to use tsserver as prefix:
typescript.tsdk=>tsserver.tsdktypescript.disableAutomaticTypeAcquisition=>tsserver.disableAutomaticTypeAcquisitiontypescript.npm=>tsserver.npmtypescript.locale=>tsserver.localetypescript.tsserver.maxTsServerMemory=>tsserver.maxTsServerMemorytypescript.tsserver.watchOptions=>tsserver.watchOptionstypescript.tsserver.useSyntaxServer=>tsserver.useSyntaxServertypescript.tsserver.log=>tsserver.logtypescript.tsserver.trace=>tsserver.trace.servertypescript.tsserver.enableTracing=>tsserver.enableTracingtypescript.tsserver.pluginPaths=>tsserver.pluginPathstypescript.reportStyleChecksAsWarnings=>tsserver.reportStyleChecksAsWarningsjs/ts.implicitProjectConfig.checkJs=>tsserver.implicitProjectConfig.checkJsjs/ts.implicitProjectConfig.experimentalDecorators=>tsserver.implicitProjectConfig.experimentalDecoratorsjs/ts.implicitProjectConfig.module=>tsserver.implicitProjectConfig.modulejs/ts.implicitProjectConfig.target=>tsserver.implicitProjectConfig.targetjs/ts.implicitProjectConfig.strictNullChecks=>tsserver.implicitProjectConfig.strictNullChecksjs/ts.implicitProjectConfig.strictFunctionTypes=>tsserver.implicitProjectConfig.strictFunctionTypestypescript.tsserver.experimental.enableProjectDiagnostics=>tsserver.experimental.enableProjectDiagnostics
Related extensions
- coc-eslint: enable eslint plugin for tsserver to lint TypeScript and JavaScript files.
- coc-tslint-plugin: enable tslint plugin for tsserver (deprecated).
- coc-styled-components: Styled component for coc.nvim as a tsserver plugin.
- coc-react-refactor: React refactor extension for coc.nvim, forked from vscode-react-refactor.
- coc-vetur: vue extension.
- coc-angular: angular extension.
Troubleshooting
- Add
"tsserver.log": "verbose"to yourcoc-settings.json(opened by command:CocConfig) - To trace LSP communication, add
"tsserver.trace.server": "verbose"to yourcoc-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:
License
MIT
Repo liên quan
Neovim is an open-source project at neovim/neovim that refactors Vim's internals to make the editor easier to maintain, easier to split across contributors, and open to modern interfaces without patching the core. It ships a plugin API reachable from languages including Lua, Python, Ruby, Go, and JavaScript/Node.js, an embedded terminal emulator, and asynchronous job control, while staying compatible with most existing Vim plugins.
fzf is a Go-based command-line fuzzy finder that turns any piped list — files, shell history, running processes — into an interactively searchable menu, with official shell integration for Bash, Zsh, Fish, and Nushell plus a Vim/Neovim plugin. It's released under the MIT license and distributed as a single binary across Homebrew, most Linux package managers, and Windows package managers like Scoop and Chocolatey.
π RuView turns commodity WiFi signals into real-time spatial intelligence, vital sign monitoring, and presence detection — all without a single pixel of video.
DeerFlow is ByteDance's open-source super agent harness — a Gateway API, sandbox layer, and LangGraph-backed checkpoint store for running multi-agent AI tasks that take minutes to hours rather than seconds. Version 2.0 is a full rewrite of the original Deep Research framework, adding a setup wizard, broader LLM provider support (including CLI-backed Codex and Claude Code auth), and a documented multi-worker production path built on Postgres and Redis.
Trả lời nhanh
Cùng nhóm Developer Tools còn repo nào?
neoclide/coc-tsserver thuộc nhóm Developer Tools trên TopGit, cùng 4 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về neoclide/coc-tsserver ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/neoclide/coc-tsserver là nguồn chính thức.
neoclide/coc-tsserver có phải mã nguồn mở không?
Có — neoclide/coc-tsserver phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/neoclide/coc-tsserver.
neoclide/coc-tsserver là gì?
neoclide/coc-tsserver (neoclide/coc-tsserver) là dự án TypeScript trên GitHub. Theo mô tả gốc: Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
neoclide/coc-tsserver so với các dự án Developer Tools khác thế nào?
neoclide/coc-tsserver được TopGit xếp vào nhóm Developer Tools, với 1.1k sao GitHub và viết bằng TypeScript. Xem trang chủ đề Developer Tools trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Vì sao neoclide/coc-tsserver được xếp vào nhóm Developer Tools?
TopGit xếp neoclide/coc-tsserver vào nhóm Developer Tools dựa trên GitHub topics và mô tả của repo (gắn thẻ: "neovim", "tsserver", "typescript"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
coc-tsserver có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về coc-tsserver.