Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r--crates/ide/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index d4ef9570e1..b4f3de3b17 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -411,6 +411,7 @@ impl Analysis {
position: FilePosition,
char_typed: char,
autoclose: bool,
+ chars_to_exclude: Option<String>,
) -> Cancellable<Option<SourceChange>> {
// Fast path to not even parse the file.
if !typing::TRIGGER_CHARS.contains(char_typed) {
@@ -419,6 +420,11 @@ impl Analysis {
if char_typed == '<' && !autoclose {
return Ok(None);
}
+ if let Some(chars_to_exclude) = chars_to_exclude {
+ if chars_to_exclude.contains(char_typed) {
+ return Ok(None);
+ }
+ }
self.with_db(|db| typing::on_char_typed(db, position, char_typed))
}