refactor typing_handlers

This commit is contained in:
Aleksey Kladov 2019-10-25 12:04:17 +03:00
parent 6f00bb1cb0
commit ea948e9fbb
2 changed files with 41 additions and 35 deletions

View file

@ -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))
}