mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
internal: Make autoclosing angle brackets configurable, disabled by default
This commit is contained in:
parent
d7c147406e
commit
f02c915eb5
6 changed files with 25 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue