Skip to content

Commit 3a055a6

Browse files
committed
internal: make upstream bug less annoying
1 parent c418700 commit 3a055a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/rust-analyzer/src/handlers.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::{
77
process::{self, Stdio},
88
};
99

10-
use always_assert::always;
1110
use ide::{
1211
AnnotationConfig, AssistKind, AssistResolveStrategy, FileId, FilePosition, FileRange,
1312
HoverAction, HoverGotoTypeData, Query, RangeInfo, Runnable, RunnableKind, SingleResolve,
@@ -268,7 +267,9 @@ pub(crate) fn handle_on_type_formatting(
268267
let char_typed = params.ch.chars().next().unwrap_or('\0');
269268

270269
let text = snap.analysis.file_text(position.file_id)?;
271-
if !always!(text[usize::from(position.offset)..].starts_with(char_typed)) {
270+
if !text[usize::from(position.offset)..].starts_with(char_typed) {
271+
// Add `always!` here once VS Code bug is fixed:
272+
// https://github.com/rust-analyzer/rust-analyzer/issues/10002
272273
return Ok(None);
273274
}
274275

0 commit comments

Comments
 (0)