mirror of
https://github.com/latex-lsp/texlab.git
synced 2025-08-04 10:49:55 +00:00
Improve performance of LaTeX command completion
This commit is contained in:
parent
d1b0732cc5
commit
c0a9240adc
1 changed files with 5 additions and 3 deletions
|
@ -20,7 +20,9 @@ impl<'a> QualityEvaluator<'a> {
|
|||
return 7;
|
||||
}
|
||||
|
||||
if label.to_lowercase() == query.to_lowercase() {
|
||||
let label_ci = label.to_lowercase();
|
||||
let query_ci = query.to_lowercase();
|
||||
if label_ci == query_ci {
|
||||
return 6;
|
||||
}
|
||||
|
||||
|
@ -28,7 +30,7 @@ impl<'a> QualityEvaluator<'a> {
|
|||
return 5;
|
||||
}
|
||||
|
||||
if label.to_lowercase().starts_with(&query.to_lowercase()) {
|
||||
if label_ci.starts_with(&query_ci) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
@ -36,7 +38,7 @@ impl<'a> QualityEvaluator<'a> {
|
|||
return 3;
|
||||
}
|
||||
|
||||
if label.to_lowercase().contains(&query.to_lowercase()) {
|
||||
if label_ci.contains(&query_ci) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue