Skip to content

Fix LSP diagnostics on folder rename#11834

Draft
LeonMatthes wants to merge 2 commits into
slint-ui:masterfrom
LeonMatthes:11778-lsp-folder-renaming
Draft

Fix LSP diagnostics on folder rename#11834
LeonMatthes wants to merge 2 commits into
slint-ui:masterfrom
LeonMatthes:11778-lsp-folder-renaming

Conversation

@LeonMatthes
Copy link
Copy Markdown
Member

@LeonMatthes LeonMatthes commented May 22, 2026

As outlined in #11778, this wires up the file system watcher to the LSP so that we can benefit from the reconcile logic in the file system watcher.

Closes #11778

Comment thread internal/interpreter/file_watcher.rs Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lsp shouldn't need this worker loop logic.

If i understand correctly, the goal is only to have the reconcile step to be shared, (WorkerState::reconcile) which is less than 100 lines of code.

But even then, it seems overkill to try to be so accurate. We could detect folder change and then clear the whole cache in the LSP. (not including the contents of the files open in the editor) wouldn't that work?

This should allow us to implement a separate file watcher for the LSP.
The LSP currently can't reconcile watched paths, so it doesn't
notice if a directory is deleted or renamed because it does not have the
directory itself listed as a file in the document cache.
@LeonMatthes LeonMatthes force-pushed the 11778-lsp-folder-renaming branch 3 times, most recently from 5036ae6 to 8357eea Compare May 27, 2026 15:00
This gives the LSP access to the reconcile logic of the file system
watcher.

E.g. If a directory is renamed, VS Code will just send a delete and
create event for the directory, not the underlying files.
The FileWatcher in the interpreter can deal with this kind of events and
synthesizes any necessary events.

Closes slint-ui#11778
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

Successfully merging this pull request may close these issues.

LSP: Renaming folder doesn't update files correctly

2 participants