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
👋 I have been working on #13529 and (indirectly) on #15741 ( as a matter of fact there should have been a "toml support for rust-analyzer issue". In order for both of these features to be implemented there needs to be a map ( and its inv. ) that maps SourceFiles ( so essentially a FileId ) to its corresponding (most of the time the closest) Cargo.toml/RA.toml file. I believe that this should be handled when we get to partition a Vfs into SourceRoots. Based on my poor observation we partition with the intention to group as many files as possible into the same FileSet. I want to change that in such a way that Cargo.toml/RATOML files are used as anchors to a SourceRoot , meaning that if you encounter , say , a Cargo.toml you would know that this is a new SourceRoot. This change would enable me to map a FileId to the FileId of its corresponding SourceRoot, as in
Can't you just store the FileId of the cargo.toml inside the SourceRoot
That is what I am exactly trying to do. But the problem is that the current partition does not guarantee that there will be one or many Cargo.tomls in a SourceRoot. I want this to be limited to at most one
That aside, why do you need such a mapping?
Because when we introduce multiple rust-analyzer.toml files to be used to configure different parts of a project I always need to be able to ask what the nearest configuration file that applies to a certain FileId is.
👋 I have been working on #13529 and (indirectly) on #15741 ( as a matter of fact there should have been a "toml support for rust-analyzer issue". In order for both of these features to be implemented there needs to be a map ( and its inv. ) that maps
SourceFile
s ( so essentially aFileId
) to its corresponding (most of the time the closest)Cargo.toml
/RA.toml
file. I believe that this should be handled when we get to partition aVfs
intoSourceRoot
s. Based on my poor observation we partition with the intention to group as many files as possible into the sameFileSet
. I want to change that in such a way thatCargo.toml
/RATOML
files are used as anchors to aSourceRoot
, meaning that if you encounter , say , aCargo.toml
you would know that this is a newSourceRoot
. This change would enable me to map aFileId
to theFileId
of its correspondingSourceRoot
, as inI cannot see any other way of doing this so I wanted to get community's opinion on this.
The text was updated successfully, but these errors were encountered: