zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48.38k stars 2.88k forks source link

Zed cannot find new files and folders after an external process creates them (git pull) #18860

Open danielfigueiredo opened 6 days ago

danielfigueiredo commented 6 days ago

Check for existing issues

Describe the bug / provide steps to reproduce it

  1. Open Zed editor
  2. Open any git project
  3. Wait for Zed to be done indexing
  4. Do a git command that will bring in new folders and files
  5. cmd +p try to find the new folder or file (does not exist), open Project panel, navigate to path where the new folder should be and their files don't not show up on project panel either.
  6. ls -las via terminal the same path to confirm the folders actually exist there. They do.

Note: make sure when you simulate creating new files you don't do that via Zed, otherwise I will know about them. Because if you open the file once Zed knows about them. You want that an external process (my case git) brings the new folder/files in, or simply do this via command line.

The opposite scenario is also true. I have a branch that has the new folders/file, I checkout main, the folder and files are still there on the project panel and can be found by running cmd + p.

It was a bit of a time sync for me, as I kept searching for similar issues and couldn't find anything related. I tried looking at command pallet and searching and there is nothing related to refresh indexes, or refresh project. The project panel options don't include any refresh by default. You are really stuck unless you kill all processes and restart them.

I still couldn't find a workaround for this. I switch branches and I'm forced to restart Zed.

Other note: Once you open the files once, Zed will display them as options via cmd+p even though they don't exist anymore in the file system.

Environment

macOS: 14.5 (23F79) Zed 0.155.2 77175bfe6675f76f1b926f7e571055b6c0cc386a

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

I had to omit some class names and file paths, but this is the entire log while I was reproducing the bug. I don't think there is anything relevant here.
These are all the logs in my Zed.log file when reproducing the bug:

```
2024-10-08T10:39:58.070661-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:39:58.070869-04:00 [ERROR] sign in required
2024-10-08T10:39:58.444969-04:00 [INFO] Language server with id 2 sent unhandled notification eslint/status:
{
  "uri": "file:///Users/dfigueiredo/code/ws/backstage/plugins/..../SomeClass.ts",
  "state": 1,
  "validationTime": 61
}
2024-10-08T10:41:28.056357-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.059041-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.062804-04:00 [WARN] request completed with error: failed to connect to the server
2024-10-08T10:41:28.148206-04:00 [INFO] Language server with id 2 sent unhandled notification eslint/status:
{
  "uri": "file:///Users/dfigueiredo/code/backstage/plugins/..../SomeClass.ts",
  "state": 1,
  "validationTime": 43
}
2024-10-08T10:41:28.15572-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.371013-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.4037-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.406736-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.411781-04:00 [INFO] Language server with id 2 sent unhandled notification eslint/status:
{
  "uri": "file:///Users/dfigueiredo/code/backstage/plugins/node_modules/@backstage/backend-plugin-api/dist/index.d.ts",
  "state": 1,
  "validationTime": 8
}
2024-10-08T10:41:28.417758-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.433156-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.455237-04:00 [INFO] Initializing default prettier with plugins {}
2024-10-08T10:41:28.537602-04:00 [INFO] Language server with id 2 sent unhandled notification eslint/status:
{
  "uri": "file:///Users/dfigueiredo/code/backstage/plugins/..../Database.ts",
  "state": 1,
  "validationTime": 59
}
2024-10-08T10:41:28.537737-04:00 [INFO] Language server with id 2 sent unhandled notification eslint/status:
{
  "uri": "file:///Users/dfigueiredo/code/backstage/plugins/..../Database.ts",
  "state": 1,
  "validationTime": 25
}
```            
notpeter commented 1 day ago

Curious if your project or it's parent directories are a symlink as it could be this:

Also wanted to double check that this is not a folder inside Dropbox, iCloud Drive, Box.net, NFS/SMB mount or on a FUSE filesystem.

tancop commented 1 day ago

Can you search your zed log for "outside of root path" or "ignoring event"? If you get error messages like that it might be related to the symlink issue.