You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the API to retrieve a file path from the VFS with a file ID (https://docs.rs/ra_ap_vfs/latest/ra_ap_vfs/struct.Vfs.html#method.file_path) panics if the file does not exist in the VFS. An exists() boolean method allows a preliminary check, but it would be great to have a fallible API that returns an Option<&VfsPath> and saves the user from having to do an existential check every time. Maybe it can be named file_path_if_exists()? I'm open to ideas, and am happy to contribute this addition!
The text was updated successfully, but these errors were encountered:
How are you getting a FileId that doesn't exist? We seem to use exists in a single place in the entirety of r-a, for an id that's passed back by the client (in a /resolve request).
I am writing an analysis engine that builds a Cargo project, and then retrieves individual file IDs while walking the HIR. Building the project returns a (db, vfs): (RootDatabase, Vfs) tuple, but I wasn't sure if the two are guaranteed to be in sync across edits. If that is the case, then a fallible method would not be necessary.
Currently, the API to retrieve a file path from the VFS with a file ID (https://docs.rs/ra_ap_vfs/latest/ra_ap_vfs/struct.Vfs.html#method.file_path) panics if the file does not exist in the VFS. An
exists()
boolean method allows a preliminary check, but it would be great to have a fallible API that returns anOption<&VfsPath>
and saves the user from having to do an existential check every time. Maybe it can be namedfile_path_if_exists()
? I'm open to ideas, and am happy to contribute this addition!The text was updated successfully, but these errors were encountered: