Submodule is enum

This commit is contained in:
Aleksey Kladov 2018-11-05 13:23:37 +03:00
parent 17a88928f4
commit 44d8919384
3 changed files with 67 additions and 21 deletions

View file

@ -164,6 +164,13 @@ impl ModuleSource {
}
}
fn file_id(self) -> FileId {
match self {
ModuleSource::File(f) => f,
ModuleSource::Inline(ptr) => ptr.file_id(),
}
}
fn resolve(self, db: &impl SyntaxDatabase) -> ModuleSourceNode {
match self {
ModuleSource::File(file_id) => {