Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add a README for typescript-plugin
Fixes: #3925
- Loading branch information
1 parent
3793058
commit b575dd6
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# typescript plugin | ||
|
||
This is a plug-in for `tsserver` or `typescript-language-server`. In must be | ||
installed in a file-system location visible by the language server or in the | ||
`node_modules` directory of projects being edited. | ||
|
||
The LSP client must be configured to explicitly enable this plug-in. This is | ||
done by passing `initializationOptions` with the appropriate [`plugins`] | ||
configuration to the language server: | ||
|
||
[`plugins`]: https://github.com/typescript-language-server/typescript-language-server/blob/b224b878652438bcdd639137a6b1d1a6630129e4/docs/configuration.md?plain=1#L27-L31 | ||
|
||
```json | ||
"initializationOptions": { | ||
"plugins": [ | ||
{ | ||
"name": "@vue/typescript-plugin", | ||
"location": "/usr/local/lib/node_modules/@vue/typescript-plugin", | ||
"languages": ["javascript", "typescript", "vue"], | ||
}, | ||
], | ||
}, | ||
``` | ||
|
||
The `languages` field must specify file-types for which the plug-in will be | ||
enabled. If the plug-in package is installed in the local `node_modules`, the | ||
`location` field may contain any arbitrary string, but MUST be present. | ||
|
||
<!-- TODO: link to neovim's configuration instructions once it is merged --> | ||
<!-- PR: https://github.com/neovim/nvim-lspconfig/pull/3049 --> |