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

Adding/moving a directory in VSCode confuse the LSP #684

Closed
ice1000 opened this issue Nov 18, 2022 · 9 comments
Closed

Adding/moving a directory in VSCode confuse the LSP #684

ice1000 opened this issue Nov 18, 2022 · 9 comments
Labels
bug Something isn't working lsp
Milestone

Comments

@ice1000
Copy link
Member

ice1000 commented Nov 18, 2022

Very easy to reproduce.

@ice1000 ice1000 added bug Something isn't working lsp labels Nov 18, 2022
@imkiva
Copy link
Member

imkiva commented Nov 19, 2022

VSCode does not send a file system event when adding/moving a directory?

@imkiva
Copy link
Member

imkiva commented Nov 19, 2022

It looks like a design problem: microsoft/language-server-protocol#742, microsoft/vscode#60813, microsoft/vscode#90746

We may need our own file system watcher, but it sounds too bad.

@imkiva
Copy link
Member

imkiva commented Nov 19, 2022

"workspace/didChangeWorkspaceFolders" may does not help

@imkiva imkiva added wontfix This will not be worked on and removed wontfix This will not be worked on labels Nov 19, 2022
@ice1000
Copy link
Member Author

ice1000 commented Nov 19, 2022

Does the moved files trigger some notifications?

@ice1000
Copy link
Member Author

ice1000 commented Nov 19, 2022

microsoft/vscode#60813 (comment)

They said they trigger folder change events

@imkiva
Copy link
Member

imkiva commented Nov 20, 2022

microsoft/vscode#60813 (comment)

They said they trigger folder change events

It also says "instead of the files within". So we have to manually list files and process the removal and creation.

And it requires a glob pattern "**/*" (watches everything). But this "everything" does not include external changes like git, according to microsoft/language-server-protocol#742 (comment)

So I suppose we will have a file system watcher to watch files without such "optimizations" and also works for external changes.

@imkiva
Copy link
Member

imkiva commented Nov 20, 2022

Does the moved files trigger some notifications?

Moving a file triggers a file deletion followed by a file creation.

Moving a directory does not trigger file events. But I expect them to be a list of file deletion, a list of file creation, and a move of the directory (a move event makes fixing directory references easier) --- just like what IntelliJ does.

@ice1000
Copy link
Member Author

ice1000 commented Nov 20, 2022

microsoft/vscode#60813 (comment)
They said they trigger folder change events

It also says "instead of the files within". So we have to manually list files and process the removal and creation.

And it requires a glob pattern "**/*" (watches everything). But this "everything" does not include external changes like git, according to microsoft/language-server-protocol#742 (comment)

So I suppose we will have a file system watcher to watch files without such "optimizations" and also works for external changes.

Yeah.... But I would ask for an option to disable it. It sounds like a disk killer.

@imkiva
Copy link
Member

imkiva commented Nov 20, 2022

Yeah.... But I would ask for an option to disable it. It sounds like a disk killer.

Yes...

@ice1000 ice1000 modified the milestone: fridge Jun 4, 2024
@ice1000 ice1000 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lsp
Projects
None yet
Development

No branches or pull requests

2 participants