From b2a6c1736295a5fffa5ac0d0fee835cdc719ada3 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 14 Mar 2019 13:14:54 +0300 Subject: remove lower module --- crates/ra_ide_api/src/change.rs | 2 +- crates/ra_ide_api/src/symbol_index.rs | 11 +++-------- .../test/snapshots/test__unresolved_module_diagnostic.snap | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index 0c90ed5b5..26fde91bc 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -223,7 +223,7 @@ impl RootDatabase { self.query(hir::db::FileItemsQuery).sweep(sweep); self.query(hir::db::FileItemQuery).sweep(sweep); - self.query(hir::db::LowerModuleWithSourceMapQuery).sweep(sweep); + self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep); self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep); } } diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 94fe1d6d7..23c743bef 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -30,7 +30,7 @@ use std::{ use fst::{self, Streamer}; use ra_syntax::{ SyntaxNode, SyntaxNodePtr, SourceFile, SmolStr, TreeArc, AstNode, - algo::{visit::{visitor, Visitor}, find_covering_node}, + algo::{visit::{visitor, Visitor}}, SyntaxKind::{self, *}, ast::{self, NameOwner}, WalkEvent, @@ -66,14 +66,9 @@ fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc db.check_canceled(); let source_file = db.parse(file_id); - let mut symbols = source_file_to_file_symbols(&source_file, file_id); + let symbols = source_file_to_file_symbols(&source_file, file_id); - for (name, text_range) in hir::source_binder::macro_symbols(db, file_id) { - let node = find_covering_node(source_file.syntax(), text_range); - let ptr = SyntaxNodePtr::new(node); - // TODO: Should we get container name for macro symbols? - symbols.push(FileSymbol { file_id, name, ptr, name_range: None, container_name: None }) - } + // TODO: add macros here Arc::new(SymbolIndex::new(symbols)) } diff --git a/crates/ra_ide_api/tests/test/snapshots/test__unresolved_module_diagnostic.snap b/crates/ra_ide_api/tests/test/snapshots/test__unresolved_module_diagnostic.snap index d258820af..5bb953892 100644 --- a/crates/ra_ide_api/tests/test/snapshots/test__unresolved_module_diagnostic.snap +++ b/crates/ra_ide_api/tests/test/snapshots/test__unresolved_module_diagnostic.snap @@ -7,7 +7,7 @@ source: "crates\\ra_ide_api\\tests\\test\\main.rs" [ Diagnostic { message: "unresolved module", - range: [4; 7), + range: [0; 8), fix: Some( SourceChange { label: "create module", -- cgit v1.2.3