From 44d891938493cc32efd2e44d81bc76cc3bc391c0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 5 Nov 2018 13:23:37 +0300 Subject: Submodule is enum --- crates/ra_analysis/src/descriptors/module/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/ra_analysis/src/descriptors/module/mod.rs') diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs index 13bab0087..8464b0618 100644 --- a/crates/ra_analysis/src/descriptors/module/mod.rs +++ b/crates/ra_analysis/src/descriptors/module/mod.rs @@ -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) => { -- cgit v1.2.3