You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## versions
vim version: VIM - Vi IMproved 8.2 8024827
node version: v17.9.0
coc.nvim version: 0.0.81-aede54f 2022-05-28 12:06:17 +0800
coc.nvim directory: /home/pure_bliss/.vim/plugged/coc.nvim
term: dumb
platform: linux
## Log of coc.nvim
2022-05-28T11:06:06.312 INFO (pid:33857) [services] - registered service "eslint"
2022-05-28T11:06:06.314 INFO (pid:33857) [services] - ESLint state change: stopped => starting
2022-05-28T11:06:06.442 INFO (pid:33857) [services] - registered service "tsserver"
2022-05-28T11:06:06.447 INFO (pid:33857) [plugin] - coc.nvim initialized with node: v17.9.0 after 194ms
2022-05-28T11:06:06.467 INFO (pid:33857) [services] - service tsserver started
2022-05-28T11:06:06.528 INFO (pid:33857) [services] - ESLint state change: starting => running
2022-05-28T11:06:06.531 INFO (pid:33857) [services] - service eslint started
2022-05-28T11:06:08.405 INFO (pid:33857) [attach] - receive notification: showInfo []
2022-05-28T11:06:18.974 INFO (pid:33857) [attach] - receive notification: showInfo []
Describe the bug
It seems like TSServer does not get the latest version of the edited file, and shows warning for older states. If eslint-s auto fix on save is enabled, then eslint gets the older state too, and tries to fix it. For some reason this can split words in half.
After inserting a text TSServer doesn't seem to get the latest version, and thinks that I only typed 's' instead of 'string' (in my case)
Prettier auto runs on save, and for some reason it replaces 'string' with 's'
Pressing 'u' once (undoing changes) reverts the file to the unformatted version, with 'string' fully typed, and redoing the changes overwrites 'string' with 's' (not in video)
Reproduce the bug
Started vim with vim -u mini.vim a/test.ts
~ $ cat mini.vim
set nocompatible
set runtimepath^=/home/pure_bliss/.vim/plugged/coc.nvim
filetype plugin indent on
syntax on
set hidden
~ $ cat .vim/coc-settings.json
{
"eslint.autoFixOnSave": true,
"coc.preferences.formatOnSaveFiletypes": ["css", "typescript", "javascript-jsx", "typescript-tsx", "javascript", "typescriptreact"],
"coc.preferences.jumpCommand": "vsplit",
"diagnostic.errorSign": "❌",
"diagnostic.warningSign": "⚠️",
"diagnostic.infoSign": "ℹ️",
"javascript.suggest.autoImports": true,
"typescript.suggest.autoImports": true,
"typescript.preferences.includePackageJsonAutoImports": "on"
}
Contents of test.ts:
export function loooooooooooooooooooooooooooooooooooooooooooooooooongfunction(a: number): any {
return a
}
Delete 'number' or add any new type after it ' | string' and save the file. See the 'Video' section
Pressing 'u' once (undoing changes) reverts the file to the unformatted version, with 'string' fully typed, and redoing the changes overwrites 'string' with 's' (not in video)
Yes, the first time to save:
export function loooooooooooooooooooooooooooooooooooooooooooooooooongfunction(
❌ a: number | s
❌tring): any {
return a;
}
Undo with u, and save again:
export function loooooooooooooooooooooooooooooooooooooooooooooooooongfunction(
a: number | string
): any {
return a;
}
Result from CocInfo
Describe the bug
It seems like TSServer does not get the latest version of the edited file, and shows warning for older states. If eslint-s auto fix on save is enabled, then eslint gets the older state too, and tries to fix it. For some reason this can split words in half.
Reproduce the bug
Started vim with
vim -u mini.vim a/test.ts
Contents of test.ts:
Delete 'number' or add any new type after it ' | string' and save the file. See the 'Video' section
Video
Sorry for the stretched video
2022-05-28.11-05-07.mp4
Logs created while reproducing the issue
CocCommand tsserver.openTsServerLog
tsserver.log
CocCommand workspace.showOutput tsserver
outputChannel.log
Additional information
With the
0.0.80-8f2a2dc441
version of coc.nvim this bug doesn't exist at all. This is why I created the issue here. Issue at coc-tsserver.The working version of coc.nvim-s
:CocInfo
:Video with version
0.0.80-8f2a2dc441
expected.mp4
The text was updated successfully, but these errors were encountered: