-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Include files in vfs on demand #13279
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
Conversation
@@ -24,10 +24,14 @@ pub struct NotifyHandle { | |||
_thread: jod_thread::JoinHandle, | |||
} | |||
|
|||
impl UnwindSafe for NotifyHandle {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok?
I think CI failure is unrelated to this PR. It also happens on #13275 |
Ye CI fails because the proc-macro server doesnt support 1.64 which released yesterday |
d43599a
to
45afd98
Compare
Sorry that I didn't get back to this. I was pondering about this change a bit(in part because I am still not too familiar with our VFS). I think there is a problem here now though, whenever a path won't be resolvable from a given source root (so not because the file ending isn't tracked but because it might lie outside the source root, think |
So the problem is that we may push a file multiple times in |
Not quite, what I mean is something like the following scenario, we have a module like This is basically #9173. Now the issue here specifically is about fixing non rs-files but the way this is implemented it will try to register files from different sourceroots and fail. So either we try to fix the sourceroot problem as well (which is gonna be very tough because we do not want to break the concept of source roots so this would require a lot of though), or we try to limit subscribing to only unknown files that are still within our current sourceroot, though I don't know how simple that would be either (although I assume that to be simpler). |
I found a more fundamental problem. This PR in current state actually doesn't work, since |
Right .. the reason for that I think is that we load the data of all files in the VFS into memory, so if we add all files, we'll have a lot of memory wasted on unnecessary files. So I think this kind of lazy loading would probably be the best choice, though as you said i dont think we can even make that work with client watching ... |
In the last changes, the client will watch all the files, but we will read from disk and store in memory only if the file is in the |
@Veykril is this problem now resolved? |
@rustbot author |
Sorry again for having pushed this to side for so long. I am still not too comfortable with this part of the code :) I have to say, I am not too fond of us asking the client to watch every file now, this will include everything in the |
Linux has a very low system wide limit on the amount of inodes you can watch. |
Ye figured, then this isn't an option I would say |
I think vscode already watches every file for its own proposes, and it is not unhappy with the |
☔ The latest upstream changes (presumably #14061) made this pull request unmergeable. Please resolve the merge conflicts. |
I am going to close this, I don't think this is the right way to approach this and I'd rather we revisit the VFS/SourceRoot abstraction to see if we can come up with a scheme that works out better here. |
fix #12181
fix #11025
fix #10178
I'm not sure if this is in line with
vfs
abstraction or not, but I think we can start with it.