mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-10 04:16:30 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
a75f743ded
commit
00eca98c6a
2 changed files with 4 additions and 4 deletions
|
@ -56,7 +56,7 @@ impl LineOffsets {
|
|||
|
||||
pub fn position_to_line_col(&self, offset: u32) -> (u32, u32) {
|
||||
eprintln!("LineOffsets: Converting position {} to line/col. Offsets: {:?}", offset, self.0);
|
||||
|
||||
|
||||
// Find which line contains this offset by looking for the first line start
|
||||
// that's greater than our position
|
||||
let line = match self.0.binary_search(&offset) {
|
||||
|
@ -76,10 +76,10 @@ impl LineOffsets {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Calculate column as offset from line start
|
||||
let col = offset - self.0[line];
|
||||
|
||||
|
||||
eprintln!("LineOffsets: Found line {} starting at offset {}", line, self.0[line]);
|
||||
eprintln!("LineOffsets: Calculated col {} as {} - {}", col, offset, self.0[line]);
|
||||
(line as u32, col)
|
||||
|
|
|
@ -61,7 +61,7 @@ impl Lexer {
|
|||
'\n' => {
|
||||
self.consume()?;
|
||||
let token = TokenType::Newline;
|
||||
eprintln!("Lexer: Found newline at position {}, incrementing line from {} to {}",
|
||||
eprintln!("Lexer: Found newline at position {}, incrementing line from {} to {}",
|
||||
self.start, self.line, self.line + 1);
|
||||
self.line += 1;
|
||||
token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue