mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
internal: Make exclude characters for typing assists configurable, default to None
Signed-off-by: Tarek <tareknaser360@gmail.com>
This commit is contained in:
parent
e6276c8b64
commit
d6b701e251
5 changed files with 37 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue