refactor: rename local variables and some types (#1023)

* fix: naming

* refactor: rename local variables and some types
This commit is contained in:
Myriad-Dreamin 2024-12-18 19:23:31 +08:00 committed by GitHub
parent ad0c1e8aca
commit be1d659719
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 805 additions and 787 deletions

View file

@ -64,7 +64,7 @@ struct OnEnterWorker<'a> {
impl OnEnterWorker<'_> {
fn indent_of(&self, of: usize) -> String {
let all_text = self.source.text();
let start = all_text[..of].rfind('\n').map(|e| e + 1);
let start = all_text[..of].rfind('\n').map(|lf_offset| lf_offset + 1);
let indent_size = all_text[start.unwrap_or_default()..of].chars().count();
" ".repeat(indent_size)
}
@ -87,7 +87,7 @@ impl OnEnterWorker<'_> {
.children()
.skip(leaf.index().saturating_sub(first_index))
.take_while(skipper)
.filter(|e| matches!(e.kind(), SyntaxKind::LineComment))
.filter(|child| matches!(child.kind(), SyntaxKind::LineComment))
.count();
let comment_prefix = {