internal: Make autoclosing angle brackets configurable, disabled by default

This commit is contained in:
Lukas Wirth 2022-05-25 12:15:36 +02:00
parent d7c147406e
commit f02c915eb5
6 changed files with 25 additions and 2 deletions

View file

@ -342,11 +342,16 @@ impl Analysis {
&self,
position: FilePosition,
char_typed: char,
autoclose: bool,
) -> Cancellable<Option<SourceChange>> {
// Fast path to not even parse the file.
if !typing::TRIGGER_CHARS.contains(char_typed) {
return Ok(None);
}
if char_typed == '<' && !autoclose {
return Ok(None);
}
self.with_db(|db| typing::on_char_typed(db, position, char_typed))
}