mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Encode edition within FileId in the hir layer
This commit is contained in:
parent
92268627a8
commit
5264f86242
160 changed files with 1117 additions and 824 deletions
|
@ -1,8 +1,5 @@
|
|||
use hir::Semantics;
|
||||
use ide_db::{
|
||||
base_db::{FilePosition, SourceDatabaseExt},
|
||||
LineIndexDatabase, RootDatabase,
|
||||
};
|
||||
use ide_db::{base_db::SourceDatabaseExt, FilePosition, LineIndexDatabase, RootDatabase};
|
||||
use std::{fmt::Write, time::Instant};
|
||||
use syntax::{algo::ancestors_at_offset, ast, AstNode, TextRange};
|
||||
|
||||
|
@ -26,7 +23,7 @@ pub(crate) fn interpret_function(db: &RootDatabase, position: FilePosition) -> S
|
|||
|
||||
fn find_and_interpret(db: &RootDatabase, position: FilePosition) -> Option<String> {
|
||||
let sema = Semantics::new(db);
|
||||
let source_file = sema.parse(position.file_id);
|
||||
let source_file = sema.parse_guess_edition(position.file_id);
|
||||
|
||||
let item = ancestors_at_offset(source_file.syntax(), position.offset)
|
||||
.filter(|it| !ast::MacroCall::can_cast(it.kind()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue