Skip to content

Commit

Permalink
Merge pull request #19033 from ChayimFriedman2/span-1
Browse files Browse the repository at this point in the history
fix: Make proc_macro span's line & column 1-indexed, as documented
  • Loading branch information
ChayimFriedman2 authored Jan 26, 2025
2 parents 90bf50c + 3f2fb17 commit be9710e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/proc-macro-srv/src/server_impl/rust_analyzer_span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ impl server::Span for RaSpanServer {

fn line(&mut self, _span: Self::Span) -> usize {
// FIXME requires db to resolve line index, THIS IS NOT INCREMENTAL
0
1
}

fn column(&mut self, _span: Self::Span) -> usize {
// FIXME requires db to resolve line index, THIS IS NOT INCREMENTAL
0
1
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/proc-macro-srv/src/server_impl/token_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ impl server::Span for TokenIdServer {
}

fn line(&mut self, _span: Self::Span) -> usize {
0
1
}

fn column(&mut self, _span: Self::Span) -> usize {
0
1
}
}

Expand Down

0 comments on commit be9710e

Please sign in to comment.