mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-04 10:50:15 +00:00
chore: Remove legacy SyntaxContextId
re-export
This commit is contained in:
parent
60cd01864a
commit
02a793bd59
38 changed files with 164 additions and 228 deletions
|
@ -159,7 +159,7 @@ type ProtocolWrite<W: Write> = for<'o, 'msg> fn(out: &'o mut W, msg: &'msg str)
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use intern::{sym, Symbol};
|
||||
use span::{Edition, ErasedFileAstId, Span, SpanAnchor, SyntaxContextId, TextRange, TextSize};
|
||||
use span::{Edition, ErasedFileAstId, Span, SpanAnchor, SyntaxContext, TextRange, TextSize};
|
||||
use tt::{
|
||||
Delimiter, DelimiterKind, Ident, Leaf, Literal, Punct, Spacing, TopSubtree,
|
||||
TopSubtreeBuilder,
|
||||
|
@ -180,12 +180,12 @@ mod tests {
|
|||
open: Span {
|
||||
range: TextRange::empty(TextSize::new(0)),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
close: Span {
|
||||
range: TextRange::empty(TextSize::new(19)),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
kind: DelimiterKind::Invisible,
|
||||
});
|
||||
|
@ -196,7 +196,7 @@ mod tests {
|
|||
span: Span {
|
||||
range: TextRange::at(TextSize::new(0), TextSize::of("struct")),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
is_raw: tt::IdentIsRaw::No,
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ mod tests {
|
|||
span: Span {
|
||||
range: TextRange::at(TextSize::new(5), TextSize::of("r#Foo")),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
is_raw: tt::IdentIsRaw::Yes,
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ mod tests {
|
|||
span: Span {
|
||||
range: TextRange::at(TextSize::new(10), TextSize::of("\"Foo\"")),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
kind: tt::LitKind::Str,
|
||||
suffix: None,
|
||||
|
@ -229,7 +229,7 @@ mod tests {
|
|||
span: Span {
|
||||
range: TextRange::at(TextSize::new(13), TextSize::of('@')),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
spacing: Spacing::Joint,
|
||||
}));
|
||||
|
@ -238,7 +238,7 @@ mod tests {
|
|||
Span {
|
||||
range: TextRange::at(TextSize::new(14), TextSize::of('{')),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
);
|
||||
builder.push(Leaf::Literal(Literal {
|
||||
|
@ -246,7 +246,7 @@ mod tests {
|
|||
span: Span {
|
||||
range: TextRange::at(TextSize::new(15), TextSize::of("0u32")),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
kind: tt::LitKind::Integer,
|
||||
suffix: Some(sym::u32.clone()),
|
||||
|
@ -254,7 +254,7 @@ mod tests {
|
|||
builder.close(Span {
|
||||
range: TextRange::at(TextSize::new(19), TextSize::of('}')),
|
||||
anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
});
|
||||
|
||||
builder.build()
|
||||
|
|
|
@ -40,9 +40,7 @@ use std::collections::VecDeque;
|
|||
use intern::Symbol;
|
||||
use rustc_hash::FxHashMap;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use span::{
|
||||
EditionedFileId, ErasedFileAstId, Span, SpanAnchor, SyntaxContextId, TextRange, TokenId,
|
||||
};
|
||||
use span::{EditionedFileId, ErasedFileAstId, Span, SpanAnchor, SyntaxContext, TextRange, TokenId};
|
||||
|
||||
use crate::legacy_protocol::msg::{ENCODE_CLOSE_SPAN_VERSION, EXTENDED_LEAF_DATA};
|
||||
|
||||
|
@ -74,7 +72,7 @@ pub fn deserialize_span_data_index_map(map: &[u32]) -> SpanDataIndexMap {
|
|||
ast_id: ErasedFileAstId::from_raw(ast_id),
|
||||
},
|
||||
range: TextRange::new(start.into(), end.into()),
|
||||
ctx: SyntaxContextId::from_u32(e),
|
||||
ctx: SyntaxContext::from_u32(e),
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue