mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Remove usages of SpanData where Span suffices
This commit is contained in:
parent
b59c8c76db
commit
0dd89d7ee7
6 changed files with 34 additions and 31 deletions
|
@ -44,6 +44,9 @@ pub const FIXUP_ERASED_FILE_AST_ID_MARKER: ErasedFileAstId =
|
|||
|
||||
pub type Span = SpanData<SyntaxContextId>;
|
||||
|
||||
/// Spans represent a region of code, used by the IDE to be able link macro inputs and outputs
|
||||
/// together. Positions in spans are relative to some [`SpanAnchor`] to make them more incremental
|
||||
/// friendly.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct SpanData<Ctx> {
|
||||
/// The text range of this span, relative to the anchor.
|
||||
|
@ -84,7 +87,7 @@ impl<Ctx: Copy> SpanData<Ctx> {
|
|||
|
||||
impl Span {
|
||||
#[deprecated = "dummy spans will panic if surfaced incorrectly, as such they should be replaced appropriately"]
|
||||
pub const DUMMY: Self = SpanData {
|
||||
pub const DUMMY: Self = Self {
|
||||
range: TextRange::empty(TextSize::new(0)),
|
||||
anchor: SpanAnchor { file_id: FileId::BOGUS, ast_id: ROOT_ERASED_FILE_AST_ID },
|
||||
ctx: SyntaxContextId::ROOT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue