doc
This commit is contained in:
parent
a065861beb
commit
a45d50acca
1 changed files with 13 additions and 11 deletions
24
Readme.md
24
Readme.md
|
@ -2,14 +2,18 @@
|
|||
|
||||
Tsserver language server extension for [coc.nvim](https://github.com/neoclide/coc.nvim).
|
||||
|
||||
Most of the code is from `typescript-language-features` extension which is bundled with VSCode.
|
||||
Tsserver is part of [TypeScript](https://github.com/microsoft/TypeScript) which
|
||||
provide rich features for javascript and typescript.
|
||||
|
||||
This extension is a fork of `typescript-language-features` extension which is bundled with VSCode.
|
||||
|
||||
**Note:** for React to work as expected, you need your JSX filetype to be
|
||||
`javascript.jsx` and your TSX filetype to be `typescript.jsx` or
|
||||
`typescript.tsx`. In coc.nvim, these filetypes are mapped to `javascriptreact`
|
||||
and `typescriptreact` because that's what tsserver uses.
|
||||
|
||||
**Note** for javascript project, make sure you have [jsconfig.json](https://code.visualstudio.com/docs/languages/jsconfig)
|
||||
**Note** for javascript project, configure [jsconfig.json](https://code.visualstudio.com/docs/languages/jsconfig)
|
||||
to make tsserver understand your code.
|
||||
|
||||
## Install
|
||||
|
||||
|
@ -19,18 +23,16 @@ In your vim/neovim, run command:
|
|||
:CocInstall coc-tsserver
|
||||
```
|
||||
|
||||
For yarn2 user what to use local typescript module:
|
||||
For yarn2 ( >= v2.0.0-rc.36) user want to use local typescript module:
|
||||
|
||||
- Add PnPify to your dependencies:
|
||||
- Run command `yarn dlx @yarnpkg/pnpify --sdk vim`, which will generate `.vim/coc-settings.json`, with content:
|
||||
|
||||
```
|
||||
yarn add @yarnpkg/pnpify
|
||||
```
|
||||
|
||||
- Run the following command, which will generate a new directory called .vscode/pnpify
|
||||
|
||||
```
|
||||
yarn pnpify --sdk
|
||||
{
|
||||
"tsserver.tsdk": ".yarn/sdks/typescript/lib",
|
||||
"eslint.packageManager": "yarn",
|
||||
"eslint.nodePath": ".yarn/sdks"
|
||||
}
|
||||
```
|
||||
|
||||
### intructions for nvm users
|
||||
|
|
Loading…
Reference in a new issue