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

Cannot rename folder #1414

Open
taisho2023 opened this issue Jun 29, 2024 · 8 comments · Fixed by #1523 · May be fixed by #1610
Open

Cannot rename folder #1414

taisho2023 opened this issue Jun 29, 2024 · 8 comments · Fixed by #1523 · May be fixed by #1610
Assignees
Labels
Milestone

Comments

@taisho2023
Copy link

taisho2023 commented Jun 29, 2024

Note

This issue is caused on Windows due to the file watcher we are using. You can try the following workaround:

  1. Create a file spyglass.json in the workspace root
  2. Paste the following contents inside:
{
  "env": {
    "useFilePolling": true
  }
}
  1. Reload vscode, for example by running the Developer: Reload Window command after pressing Ctrl+Shift+P
problem.of.DHP.mp4
@taisho2023 taisho2023 changed the title can't rename Cannot rename folder Jun 29, 2024
@misode misode added 🐛 bug Something isn't working /core labels Jun 29, 2024
@MulverineX MulverineX added this to the Backlog milestone Jun 29, 2024
@misode
Copy link
Member

misode commented Jul 5, 2024

This seems like a problem with chokidar, as explained here: paulmillr/chokidar#664 (comment)

Unless we switch to an entirely different way of watching files I don't think this is likely to be solved

@misode
Copy link
Member

misode commented Jul 5, 2024

@SPGoding What were the problems with vscode's createFileSystemWatcher API that made you switch to chokidar? Was it just to make the language server agnostic?

@SPGoding
Copy link
Member

SPGoding commented Jul 5, 2024

There is a DidChangeWatchedFiles notification in LSP so I believe editor support is not as big of a problem (depending on how many editors implement that notification). I think I run into issues with how folder operations (like rename and deletes) are notified in the events. I believe the chokidar watcher we use sends an individual event for every entry in the affected folder recursively while the LSP notification sent by VS Code only includes the top level folder so I had to do some weird heuristics that didn't really work (#351).

We can either figure out how the notification works or use polling in chokidar on Windows.

@Kesuaheli
Copy link

Oh... that comes from Spyglass...
I really wondered why VSCode wont let me rename any folders. I thought VSCode had a buggy update.
I couldnt even rename them in Windowns Explorer, because of "is opened by another program" (the file watcher, ig?).
Have to close VSCode everytime in order to rename.
Now I found this issue in the Discord gh-issues channel.

+1 to fix this

@misode
Copy link
Member

misode commented Aug 15, 2024

Reopening because the config is opt-in and this is a common issue people are experiencing. We should look into a better solution in the future.

@B1BU
Copy link

B1BU commented Aug 23, 2024

I'm having this issue very frequently, can't rename anything with the extension enabled

@B1BU
Copy link

B1BU commented Aug 23, 2024

Is there a way to enable this useFilePolling option globally?

@misode
Copy link
Member

misode commented Aug 23, 2024

Is there a way to enable this useFilePolling option globally?

No, that's not possible. This workaround is not meant to be a final solution, we plan to fix this issue properly in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment