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
You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain
Bug description
I use doom-emacs and rust-analyzer, when edit the Cargo.toml file in doom-emacs or vscode it will not trigger the workspace/didChangeWatchedFiles event.
lsp-mode use file-notify-add-watch to watch a directory change to trigger workspace/didChangeWatchedFiles.
It works in vanilla Emacs because it enabled backup file feature, when edit and save a file will trigger a create or rename or delete event .
When disable this feature such as doom-emacs or edit the file in vscode, it only change the file content, only trigger a file change event, so directory change event will not work as expect.
Running into this myself, on macOS. Maybe related to me using backup-by-copying t that I learned from #3516 / #4112? Not sure.
It does seem less than ideal that file-notify-add-watch can't detect changes to existing files, at least the way it's ending up working on macOS. There was some talk about improving in this bug but it was closed.
Is there something else lsp-mode could do? Would having (optional) support for using an external process for watching directories/files for changes help at all? At least then there would be a way to plug something in that can detect all creates/changes/deletes, I think.
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
I use doom-emacs and rust-analyzer, when edit the
Cargo.toml
file in doom-emacs or vscode it will not trigger theworkspace/didChangeWatchedFiles
event.lsp-mode
usefile-notify-add-watch
to watch a directory change to triggerworkspace/didChangeWatchedFiles
.It works in vanilla Emacs because it enabled backup file feature, when edit and save a file will trigger a create or rename or delete event .
When disable this feature such as doom-emacs or edit the file in vscode, it only change the file content, only trigger a file change event, so directory change event will not work as expect.
Steps to reproduce
doomemacs/doomemacs#5630
brotzeit/rustic#322
When edit and save
Cargo.toml
file in doom-emacs and vscode, only file change event:When edit in vanilla Emacs:
Expected behavior
When edit
Cargo.toml
in vscode or emacs without backup file, can also reload rust-analyzerWhich Language Server did you use?
rust-analyzer
OS
MacOS
Error callstack
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: