doomemacs / doomemacs/core

lsp-mode isn't sending up-to-date diagnostics

Open
#7,609 1 comment 3 reactions 0 assignees View on GitHub
is:bug needs-triage
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### I confirm that...

- [X] I have searched the [issue tracker](https://github.com/doomemacs/doomemacs/issues), [documentation](https://docs.doomemacs.org), [FAQ](https://docs.doomemacs.org/-/faq), [Discourse](https://discourse.doomemacs.org), and [Google](https://google.com), in case this issue has already been reported/resolved.

- [X] I have read "[How to Debug Issues](https://doomemacs.org/d/how2debug)", and will use it to provide as much information about this issue as possible.

- [X] The issue can be reproduced on the **latest** available commit of Doom.

- [X] The issue can be reproduced on a stable release of Emacs, such as 27, 28, or 29. *(Unstable versions end in .50, .60, or .9x)*

### Expected behavior

Upon updating a file, I'd expect flycheck to display up-to-date list of errors.
It seems that lsp-mode (specifically ts-ls) is not sending correct diagnostics upon changing.
Only after restarting lsp via running `lsp-restart-workspace` it updates as expected.

Example (Type is completely wrong, no LSP error)
![Screenshot 2024-01-03 at 19 43 51](https://github.com/doomemacs/doomemacs/assets/25355177/a83fe3e6-7719-4d40-904c-06c199c242e3)

After running `lsp-restart-workspace`
![Screenshot 2024-01-03 at 19 44 04](https://github.com/doomemacs/doomemacs/assets/25355177/cbbf3811-b703-4169-84be-fceaf3f9d506)

Similar thing happens when I fix an error:
1. I have a correctly displayed error
2. I fix the code
3. I still get a flycheck error message for old code

Not sure if this is related to lsp-mode or my emacs installation.
I've tried emacs 29, 28 and multiple doom re-installations. I'm running on mac sonoma, with an M2 chip. Emacs-mac but have had the same behaviour with emacs-plus

### Current behavior

explained above

### Steps to reproduce

1. Install emacs with native comp on mac sonoma M2
2. Open TS project, a file with an error
3. fix code but still see error for outdated code

### System Information

https://pastebin.com/YU3z6RUr

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.