Skip to content

Commit 915e4d1

Browse files
committed
Fix typos
1 parent 9092ac0 commit 915e4d1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

crates/ark/src/lsp/diagnostics.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl Default for DiagnosticsConfig {
8484
}
8585

8686
impl<'a> DiagnosticContext<'a> {
87-
pub fn new(contents: &'a Rope, library: &'a crate::lsp::inputs::library::Library) -> Self {
87+
pub fn new(contents: &'a Rope, library: &'a Library) -> Self {
8888
Self {
8989
contents,
9090
document_symbols: Vec::new(),
@@ -103,21 +103,20 @@ impl<'a> DiagnosticContext<'a> {
103103
symbols.insert(name.to_string(), location);
104104
}
105105

106-
// First, check document symbols.
107106
pub fn has_definition(&self, name: &str, start_position: Point) -> bool {
107+
// Check document symbols
108108
for symbols in &self.document_symbols {
109109
if symbols.contains_key(name) {
110110
return true;
111111
}
112112
}
113113

114-
// Then, check workspace symbols.
114+
// Check workspace symbols
115115
if self.workspace_symbols.contains(name) {
116116
return true;
117117
}
118118

119-
// Finally, check package symbols from `library()` calls.
120-
// Check all symbols exported by `library()` before the given position.
119+
// Check all symbols exported by `library()` calls before the given position
121120
for (library_position, exports) in self.library_symbols.iter() {
122121
if *library_position > start_position {
123122
break;
@@ -127,7 +126,7 @@ impl<'a> DiagnosticContext<'a> {
127126
}
128127
}
129128

130-
// Finally, check session symbols.
129+
// Finally, check session symbols
131130
self.session_symbols.contains(name)
132131
}
133132
}

crates/ark/src/lsp/diagnostics_syntax.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,11 @@ mod tests {
309309
use crate::lsp::diagnostics::DiagnosticContext;
310310
use crate::lsp::diagnostics_syntax::syntax_diagnostics;
311311
use crate::lsp::documents::Document;
312+
use crate::lsp::inputs::library::Library;
312313

313314
fn text_diagnostics(text: &str) -> Vec<Diagnostic> {
314315
let document = Document::new(text, None);
315-
let library = crate::lsp::inputs::library::Library::default();
316+
let library = Library::default();
316317
let context = DiagnosticContext::new(&document.contents, &library);
317318
let diagnostics = syntax_diagnostics(document.ast.root_node(), &context).unwrap();
318319
diagnostics

0 commit comments

Comments
 (0)