chore: Remove legacy SyntaxContextId re-export

This commit is contained in:
Lukas Wirth 2025-03-15 16:07:52 +01:00
parent 60cd01864a
commit 02a793bd59
38 changed files with 164 additions and 228 deletions

View file

@ -29,7 +29,7 @@ use crate::{
use base_db::AnchoredPathBuf;
use either::Either;
use hir::{FieldSource, FileRange, HirFileIdExt, InFile, ModuleSource, Semantics};
use span::{Edition, EditionedFileId, FileId, SyntaxContextId};
use span::{Edition, EditionedFileId, FileId, SyntaxContext};
use stdx::{never, TupleExt};
use syntax::{
ast::{self, HasName},
@ -113,7 +113,7 @@ impl Definition {
/// renamed and extern crate names will report its range, though a rename will introduce
/// an alias instead.
pub fn range_for_rename(self, sema: &Semantics<'_, RootDatabase>) -> Option<FileRange> {
let syn_ctx_is_root = |(range, ctx): (_, SyntaxContextId)| ctx.is_root().then_some(range);
let syn_ctx_is_root = |(range, ctx): (_, SyntaxContext)| ctx.is_root().then_some(range);
let res = match self {
Definition::Macro(mac) => {
let src = sema.source(mac)?;
@ -220,7 +220,7 @@ impl Definition {
fn name_range<D>(
def: D,
sema: &Semantics<'_, RootDatabase>,
) -> Option<(FileRange, SyntaxContextId)>
) -> Option<(FileRange, SyntaxContext)>
where
D: hir::HasSource,
D::Ast: ast::HasName,