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

File watcher is not activated: clangd does not refresh open files on compile_commands.json changes #681

Open
WB2210 opened this issue Sep 10, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@WB2210
Copy link

WB2210 commented Sep 10, 2024

Not sure if to tag as bug or enhancement -

Open files do not refresh in vscode when compile_commands.json changes, unless the each file is manually closed and re-opened or remembering to run restart clangd server command (Which 99% of the time I forget to do after updating compile_commands.json), this causes confusion when switching targets that have different ifdefs and defines.

I see that clangd extension supports file watch, I tried to debug the extension and discovered that the file watch is never called, when I manually edited the code to force call it, when compile_commands.json changes language server restarts and the files in vscode are refreshed properly, without having to manually perform refresh clangd or close and open each file every time a target is switched.

So what's the solution? Can we have the file watch enabled back? (It fixes the issue) Are all opened files supposed to refresh automatically on vscode without restarting the server?
Thanks

System information
Clangd version (from the log, or clangd --version): 18.1.3 (tried on version 16 too, same issue)
clangd extension version: 1.29
Operating system: mac

@WB2210 WB2210 added the bug Something isn't working label Sep 10, 2024
@HighCommander4
Copy link
Contributor

I think this is a duplicate of #300, with this comment describing the current state of things.

@WB2210
Copy link
Author

WB2210 commented Sep 10, 2024

Hmmm so from my understanding this issue is still unresolved
Why not simply re-enable the file watch config? It doesn't harm to enable it back the way it was (which was optional anyways) and it would fix the issue (at least for me and for most people who have this problem I suppose)

Thanks

@HighCommander4
Copy link
Contributor

Could you specify what config / code change you're referring to?

(And could you please do it in a comment on #300, to keep the discussion in one place? Thanks!)

@WB2210
Copy link
Author

WB2210 commented Sep 11, 2024

Moving to #300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants