Skip to content

Commit d05ea05

Browse files
committed
Make guard name more explicit
1 parent 0eb735e commit d05ea05

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

crates/ark/src/lsp/definitions.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ mod tests {
8989

9090
#[test]
9191
fn test_goto_definition() {
92-
// Reset the indexer on exit
93-
let _guard = indexer::IndexerGuard;
92+
let _guard = indexer::ResetIndexerGuard;
9493

9594
let code = r#"
9695
foo <- 42
@@ -131,8 +130,7 @@ print(foo)
131130

132131
#[test]
133132
fn test_goto_definition_comment_section() {
134-
// Reset the indexer on exit
135-
let _guard = indexer::IndexerGuard;
133+
let _guard = indexer::ResetIndexerGuard;
136134

137135
let code = r#"
138136
# foo ----

crates/ark/src/lsp/indexer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ pub(crate) fn indexer_clear() {
167167
/// RAII guard that clears `WORKSPACE_INDEX` when dropped.
168168
/// Useful for ensuring a clean index state in tests.
169169
#[cfg(test)]
170-
pub(crate) struct IndexerGuard;
170+
pub(crate) struct ResetIndexerGuard;
171171

172172
#[cfg(test)]
173-
impl Drop for IndexerGuard {
173+
impl Drop for ResetIndexerGuard {
174174
fn drop(&mut self) {
175175
indexer_clear();
176176
}

crates/ark/src/lsp/symbols.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ mod tests {
586586
use crate::lsp::config::LspConfig;
587587
use crate::lsp::config::WorkspaceSymbolsConfig;
588588
use crate::lsp::documents::Document;
589-
use crate::lsp::indexer::IndexerGuard;
589+
use crate::lsp::indexer::ResetIndexerGuard;
590590

591591
fn test_symbol(code: &str) -> Vec<DocumentSymbol> {
592592
let doc = Document::new(code, None);
@@ -901,7 +901,7 @@ a <- function() {
901901
#[test]
902902
fn test_workspace_symbols_include_comment_sections() {
903903
fn run(include_comment_sections: bool) -> Vec<String> {
904-
let _guard = IndexerGuard;
904+
let _guard = ResetIndexerGuard;
905905

906906
let code = "# Section ----\nfoo <- 1";
907907

0 commit comments

Comments
 (0)