neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.16k stars 954 forks source link

"Error loading workspace" but no actual error shown #4878

Closed vitaly-zdanevich closed 4 months ago

vitaly-zdanevich commented 5 months ago

In one project I have no such error, but I have in another one:

image

I think you should print something usefull here.

Result from CocInfo

## versions

vim version: VIM - Vi IMproved 9.0 9002092
node version: v20.6.1
coc.nvim version: 0.0.82-7a50d4d9 2022-08-01 01:37:29 +0800
coc.nvim directory: /home/vitaly/.vim/pack/git-submodules-plugins/start/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2024-02-01T11:26:01.653 WARN (pid:5801) [attach] - Plugin not ready when received "updateConfig" [
  'languageserver',
  {
    go: {
      filetypes: [Array],
      'trace.server': 'verbose',
      rootPatterns: [Array],
      command: 'gopls'
    }
  }
]
2024-02-01T11:26:01.655 WARN (pid:5801) [attach] - Plugin not ready when received "updateConfig" [
  'languageserver',
  {
    go: {
      filetypes: [Array],
      'trace.server': 'verbose',
      rootPatterns: [Array],
      command: 'gopls'
    }
  }
]
2024-02-01T11:26:01.655 WARN (pid:5801) [attach] - Plugin not ready when received "updateConfig" [
  'languageserver',
  {
    go: {
      filetypes: [Array],
      'trace.server': 'verbose',
      rootPatterns: [Array],
      command: 'gopls'
    }
  }
]
2024-02-01T11:26:01.704 INFO (pid:5801) [services] - registered service "languageserver.go"
2024-02-01T11:26:01.705 INFO (pid:5801) [services] - go state change: stopped => starting
2024-02-01T11:26:01.706 INFO (pid:5801) [plugin] - coc.nvim initialized with node: v20.6.1 after 32ms
2024-02-01T11:26:01.716 INFO (pid:5801) [language-client-index] - Language server "languageserver.go" started with 5894
2024-02-01T11:26:01.737 INFO (pid:5801) [services] - go state change: starting => running
2024-02-01T11:26:01.739 INFO (pid:5801) [services] - service languageserver.go started
2024-02-01T11:28:51.530 INFO (pid:5801) [attach] - receive notification: showInfo []
vitaly-zdanevich commented 5 months ago

I set minProgressWidth to 300 - but still width is not enough to see the full error message.

fannheyward commented 5 months ago

Set "notification.statusLineProgress": true, will display the progress notification on status line. Maybe the status line is not enough to see the full message too 😞

Another way to see the error message: :CocCommand workspace.showOutput languageserver.go to see the trace logs.

vitaly-zdanevich commented 5 months ago

Thanks, I tried call coc#config('notification', { 'statusLineProgress': 'true' })

but nothing changed - nothing in the status line.

I solved it by call coc#config('notification', { 'minProgressWidth': 200, 'maxWidth': 200 })

So now I have: image

fannheyward commented 5 months ago

I made a test for the long notification, the error message was wrapped to lines with Vi IMproved 9.1 9010050:

image

Use C-f to scroll:

nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
image

In nvim, C-ww can jump into the notification window:

image
vitaly-zdanevich commented 5 months ago

but nothing changed - nothing in the status line.

Oh this is because I disabled the status line.

fannheyward commented 5 months ago

I don't have "notification.statusLineProgress": true in my test, the notification displayed in floating window, not status line.

My question is: the notification should display message in lines, but yours not. Still debuging on this.

fannheyward commented 4 months ago

coc.nvim version: 0.0.82-7a50d4d9 2022-08-01 01:37:29 +0800

Upgrade your coc.nvim to latest release, this has been already fixed.

vitaly-zdanevich commented 4 months ago

Latest release is 0.0.82, and I have the same git tag.

fannheyward commented 4 months ago

It's recommended to use the release branch, tag release is outdated.

" Use release branch (recommended)
Plug 'neoclide/coc.nvim', {'branch': 'release'}

" Or build from source code by using npm
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'npm ci'}