-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
IDE functionality in unsaved examples #17432
Comments
Currently, some functionalities in r-a require the file to be saved (e.g., flycheck). Therefore, if the file is not saved, many features of r-a will not be available. |
There is no way that saving it to a temp directory could be hacked around to suffice? |
Uncreated files can have a path, that's not the problem. If you e.g. do |
Yeah, that's more or less what I assumed was the case. My question is not specific to examples btw, but it is whether or not it is possible to use a heuristic when a file is being edited that's not found in the Cargo project hierarchy. Can a file in examples/ be assumed to be an example and compiled manually as such, a file in bin/ treated as a top-level entry point, and other files treated as if they were in a module accessible by their path (e.g. src/foo/bar.rs would assume the presence of |
It's a very different problem for examples/bins and for modules. I think for examples and bins the main problem would be fitting it into the architecture, but if/once we have on-demand project loading it might be pretty doable as a heuristic (it seems pretty similar to that to me). |
While your basic GUI editor like VS Code can’t do it, the majority of command line editors support providing the path a file will be saved under prior to actually writing out the buffer upon first save.
I realize this could be an issue with the LSP client, so please correct me if so, but in cases where the user creates a buffer associated with an unmaterialized path, could RA use that path instead of showing errors about the buffer not being part of the crate tree?
eg
:e examples/foo.rs
will currently trip up RA until a :w is issued, but does that need to be the case (assuming the client sends the path along)?The text was updated successfully, but these errors were encountered: