Closed camflan closed 6 years ago
"coc.tslint.enable": false,
"coc.tsserver.enable": false,
They're not valid configurations, they won't work, try
yarn global add vscode-json-languageserver
to get completion support for coc-settings.json
.
You can disable tsserver
by create file .vim/coc-settings.json
in the folder of your flow project, and add configuration:
{
"tsserver.enableJavascript": false
}
Oh, weird. I have the vscode-json-languageserver installed, that's how I got those keys in cot-settings
I also have "tsserver.enableJavascript": false
in my $HOME/.vim/coc-settings.json file. Do I also need this in each of my flow projects?
here's my coc-settings.json for reference,
{
"coc.preferences.autoTrigger": "trigger",
"coc.preferences.timeout": 300,
"coc.tslint.enable": false,
"coc.tsserver.enable": false,
"coc.tsserver.enableJavascript": false,
"languageserver": {
"reason": {
"command": "ocaml-language-server",
"args": ["start", "--stdio"],
"filetypes": ["reason"],
"initializationOptions": {},
"settings": {}
},
"flow": {
"command": "flow-language-server",
"args": ["--stdio", "--try-flow-bin"],
"filetypes": ["javascript", "javascript.jsx"],
"initializationOptions": {},
"settings": {}
}
}
}
Do I also need this in each of my flow projects?
Not needed.
"coc.tsserver.enableJavascript": false,
should be
"tsserver.enableJavascript": false,
The json language server use snippet feature, it's better to use confirm to get the completion result, so bind <cr>
to <C-y>
is recommanded:
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
Another tip is not type "
before completion, just type tslint
and type <cr>
to select.
Fix needed for json extension to avoid such miss leading completion.
But, disabling tsserver like this will also turn off other features like variable renaming, right?
"javascript.validate.enable": false
works for me
Disable javascript in your flow project only by creating .vim/coc-settings.json
in your project's directory with:
{
"tsserver.enableJavascript": false
}
https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file#configuration-file-resolve
Use "tsserver.enable": false
and start vim from the directory of your project is recommended
Describe the bug Attempting to get only Flow working on flow files, as the tsserver is reporting syntax errors specific to ts type annotations vs flow annotations
To Reproduce Open flow typed files, see tsserver errors.
I've re-added the neovim-languageclient plugin (I had removed it prior to installing Coc) configured the "languageservers" section of the config file and added
to my coc config and it still shows tsserver errors in addition to my flow errors.
Expected behavior I would see flow errors, not tsserver errors
Screenshots
Desktop (please complete the following information):
Additional context .vimrc
cot-settings.json