Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/language/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ tree-sitter.workspace = true
unicase = "2.6"
util.workspace = true
watch.workspace = true
zlog.workspace = true
diffy = "0.4.2"

[dev-dependencies]
Expand Down
7 changes: 6 additions & 1 deletion crates/language/src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,12 @@ pub fn range_from_lsp(range: lsp::Range) -> Range<Unclipped<PointUtf16>> {
let mut start = point_from_lsp(range.start);
let mut end = point_from_lsp(range.end);
if start > end {
log::warn!("range_from_lsp called with inverted range {start:?}-{end:?}");
// We debug instead of warn so that this is not logged by default unless explicitly requested.
// Using warn would write to the log file, and since we receive an enormous amount of
// range_from_lsp calls (especially during completions), that can hang the main thread.
//
// See issue #36223.
zlog::debug!("range_from_lsp called with inverted range {start:?}-{end:?}");
mem::swap(&mut start, &mut end);
}
start..end
Expand Down
Loading