mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
refactor typing_handlers
This commit is contained in:
parent
6f00bb1cb0
commit
ea948e9fbb
2 changed files with 41 additions and 35 deletions
|
@ -323,6 +323,10 @@ impl Analysis {
|
|||
position: FilePosition,
|
||||
char_typed: char,
|
||||
) -> Cancelable<Option<SourceChange>> {
|
||||
// Fast path to not even parse the file.
|
||||
if !typing::TRIGGER_CHARS.contains(char_typed) {
|
||||
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