Merge #3549
3549: Implement env! macro r=matklad a=edwin0cheng This PR implements `env!` macro by adding following things: 1. Added `additional_outdirs` settings in vscode. (naming to be bikeshed) 2. Added `ExternSourceId` which is a wrapping for SourceRootId but only used in extern sources. It is because `OUT_DIR` is not belonged to any crate and we have to access it behind an `AstDatabase`. 3. This PR does not implement the `OUT_DIR` parsing from `cargo check`. I don't have general design about this, @kiljacken could we reuse some cargo watch code for that ? ~~Block on [#3536]~~ PS: After this PR , we (kind of) completed the `include!(concat!(env!('OUT_DIR'), "foo.rs")` macro call combo. [Exodia Obliterate!](https://www.youtube.com/watch?v=RfqNH3FoGi0) Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
This commit is contained in:
@@ -55,6 +55,13 @@ impl FileLoader for RootDatabase {
|
||||
fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> {
|
||||
FileLoaderDelegate(self).relevant_crates(file_id)
|
||||
}
|
||||
fn resolve_extern_path(
|
||||
&self,
|
||||
extern_id: ra_db::ExternSourceId,
|
||||
relative_path: &RelativePath,
|
||||
) -> Option<FileId> {
|
||||
FileLoaderDelegate(self).resolve_extern_path(extern_id, relative_path)
|
||||
}
|
||||
}
|
||||
|
||||
impl salsa::Database for RootDatabase {
|
||||
|
||||
Reference in New Issue
Block a user