Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tsserver can not detect the corresponding error messages #813

Closed
zlxbuzz opened this issue Nov 16, 2023 · 7 comments
Closed

Tsserver can not detect the corresponding error messages #813

zlxbuzz opened this issue Nov 16, 2023 · 7 comments

Comments

@zlxbuzz
Copy link

zlxbuzz commented Nov 16, 2023

I'm using NeoVim NERDTree. When I open a TypeScript file, tsserver can detect the corresponding error messages. However, when I switch files and return to the previous one, any code modifications aren't detected by tsserver until I use LspRestart to trigger a recheck. What could be the reason for this?

@rchl
Copy link
Member

rchl commented Nov 16, 2023

Many things could be the reason. Enable LSP logs in your editor and provide them here after reproducing the issue.

@zlxbuzz zlxbuzz changed the title Tsserver can detect the corresponding error messages Tsserver can not detect the corresponding error messages Nov 16, 2023
@zlxbuzz
Copy link
Author

zlxbuzz commented Nov 16, 2023

Many things could be the reason. Enable LSP logs in your editor and provide them here after reproducing the issue.

When I switch back to the previous TypeScript file, tsserver doesn't detect any code changes. There are no messages in LspLog. At 18:21:21, executing LspRestart resulted in the following output. Other LSPs like css-lsp and json-lsp don't have this issue. I manage my plugins using lazy.nvim.
LspLog:

  [WARN][2023-11-16 17:43:24] .../lua/vim/lsp.lua:1637  "buf_attach_client called on unloaded buffer (id: 6): "
  [WARN][2023-11-16 17:49:23] .../lua/vim/lsp.lua:1637  "buf_attach_client called on unloaded buffer (id: 7): "
  [WARN][2023-11-16 17:50:35] .../lua/vim/lsp.lua:1637  "buf_attach_client called on unloaded buffer (id: 7): "
  [WARN][2023-11-16 17:50:41] .../lua/vim/lsp.lua:1637  "buf_attach_client called on unloaded buffer (id: 7): "
  [WARN][2023-11-16 17:50:53] .../lua/vim/lsp.lua:1637  "buf_attach_client called on unloaded buffer (id: 7): "
  [START][2023-11-16 18:21:21] LSP logging initiated
  [WARN][2023-11-16 18:21:21] .../lua/vim/lsp.lua:1637  "buf_attach_client called on unloaded buffer (id: 9): "
  [WARN][2023-11-16 18:22:46] .../lua/vim/lsp.lua:1637  "buf_attach_client called on unloaded buffer (id: 9): "
  [WARN][2023-11-16 18:25:57] .../lua/vim/lsp.lua:1637  "buf_attach_client called on unloaded buffer (id: 9): "

@rchl
Copy link
Member

rchl commented Nov 16, 2023

There are logs if your LSP is working.
There will be things logged when opening, editing and all other actions that you do.
I'm asking you to provide the full LSP logs from the time you open the project to the point where you've reproduced the issue.

And I don't know what the:

[WARN][2023-11-16 17:43:24] .../lua/vim/lsp.lua:1637 "buf_attach_client called on unloaded buffer (id: 6

means since that's specific to your editor and not the LSP protocol.

@zlxbuzz
Copy link
Author

zlxbuzz commented Nov 17, 2023

Afterward, I made some attempts and found that when I use version 4.0.0 of the typescript-language-server, the issue no longer occurs. However, when I switch to version 4.1.0 or above, the previous problem arises again. So, I'm wondering if the new versions have made some modifications.

@rchl
Copy link
Member

rchl commented Nov 17, 2023

Obviously new versions have new changes.

I've asked about logs. That's the fastest way I can help you.

@zlxbuzz
Copy link
Author

zlxbuzz commented Nov 17, 2023

Obviously new versions have new changes.

I've asked about logs. That's the fastest way I can help you.

Sorry, I checked the Lsp log, but it's too large to pinpoint the issue. I identified the problem through a minimal code configuration. I found that when I set 'set nohidden', the issue arises. However, when I use 'set hidden', the problem disappears. So, could it be a problem caused by buffers?

@rchl
Copy link
Member

rchl commented Nov 17, 2023

I don't know what set hidden does. You might want to ask the neovim community or whoever maintains the typescript integration with neovim.

@rchl rchl closed this as completed Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants