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

Duplicate diagnostics when opening files, with paths containing / on Windows #299

Open
dimhatz opened this issue Sep 26, 2024 · 0 comments

Comments

@dimhatz
Copy link

dimhatz commented Sep 26, 2024

First of all, a big thank you to the maintainers for this great plugin!

Steps to reproduce:

  1. :cd myproject (optional, but convenient to test relative paths)
  2. :e ~/myproject/src/file1.ts or use absolute path :e c:/myuser/myproject/src/file2.ts (do not use Tab completion, as it will change slashes to \)
  3. modify the buffer to produce a ts error
  4. lua =vim.diagnostics.get() will show duplicate entries of the error

This happens every time, when restoring nvim sessions, since the Session.vim file uses forward slashes.

NOTE: with relative paths (e.g. step 2 becomes :e src/file3.ts) this bug does not occur. It also does not occur when using \.

NOTE2: when a file is first opened with / and then closed, its /-containing path will be saved in :ls!. The following re-opening of the file, even with \ this time, will still result in the buggy behavior.

Additional info:

- Windows 10 x64
- nvim 0.10 (latest stable)
- typescript-tools latest, using only options: { separate_diagnostic_server = true, expose_as_code_action = 'all' }
(separate_diagnostic_server = false does not make any difference)
- lspconfig without mason-lspconfig
- tsserver: project-local from package [email protected]

Happy to provide more info if needed.

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

1 participant