mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +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
|
@ -12,13 +12,12 @@ mod tests;
|
|||
|
||||
use hir::ImportPathConfig;
|
||||
use ide_db::{
|
||||
base_db::FilePosition,
|
||||
helpers::mod_path_to_ast,
|
||||
imports::{
|
||||
import_assets::NameToImport,
|
||||
insert_use::{self, ImportScope},
|
||||
},
|
||||
items_locator, RootDatabase,
|
||||
items_locator, FilePosition, RootDatabase,
|
||||
};
|
||||
use syntax::algo;
|
||||
use text_edit::TextEdit;
|
||||
|
@ -239,7 +238,7 @@ pub fn resolve_completion_edits(
|
|||
let _p = tracing::info_span!("resolve_completion_edits").entered();
|
||||
let sema = hir::Semantics::new(db);
|
||||
|
||||
let original_file = sema.parse(file_id);
|
||||
let original_file = sema.parse(sema.attach_first_edition(file_id)?);
|
||||
let original_token =
|
||||
syntax::AstNode::syntax(&original_file).token_at_offset(offset).left_biased()?;
|
||||
let position_for_import = &original_token.parent()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue