mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Re-implement InFile wrappers as type aliases over generic InFileWrapper
This commit is contained in:
parent
30093a6d81
commit
c43078f99d
13 changed files with 151 additions and 107 deletions
|
@ -1,4 +1,4 @@
|
|||
use hir::{HasSource, InFile, Semantics};
|
||||
use hir::{HasSource, InFile, InRealFile, Semantics};
|
||||
use ide_db::{
|
||||
base_db::{FileId, FilePosition, FileRange},
|
||||
defs::Definition,
|
||||
|
@ -149,8 +149,8 @@ pub(crate) fn annotations(
|
|||
node: InFile<T>,
|
||||
source_file_id: FileId,
|
||||
) -> Option<(TextRange, Option<TextRange>)> {
|
||||
if let Some(InFile { file_id, value }) = node.original_ast_node(db) {
|
||||
if file_id == source_file_id.into() {
|
||||
if let Some(InRealFile { file_id, value }) = node.original_ast_node(db) {
|
||||
if file_id == source_file_id {
|
||||
return Some((
|
||||
value.syntax().text_range(),
|
||||
value.name().map(|name| name.syntax().text_range()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue