Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
845c93d
Add workspace scanning
lionel- May 20, 2026
12a38a9
Hook up `oak_scan` to the LSP
lionel- May 20, 2026
02ce74d
Add workspace watching
lionel- May 21, 2026
d7ccc70
Add more tests
lionel- May 22, 2026
3779e87
Support legacy workspace folder
lionel- May 22, 2026
d972f91
Handle workspace changed event
lionel- May 22, 2026
25b9298
Align workspace scanning on setter approach
lionel- May 22, 2026
eb19ed4
Move closed editors to stale root if needed
lionel- May 22, 2026
eec3212
Include package scripts as Salsa inputs
lionel- May 22, 2026
2035f95
Remove support for deprecated `rootUri`
lionel- Jun 10, 2026
499c0ff
Finish renaming `DbExt` to `DbScan`
lionel- Jun 10, 2026
3febba0
Use `db` name for Oak DB field
lionel- Jun 10, 2026
520d950
Pass empty set of owned editors directly
lionel- Jun 10, 2026
39819e2
Inline `Url` creation
lionel- Jun 10, 2026
2076743
Rename `skip` to `editor_owned`
lionel- Jun 10, 2026
c9ba5d8
Update comment
lionel- Jun 10, 2026
6a68b8d
Simplify auxiliary loop init
lionel- Jun 10, 2026
218eca9
Simplify state init in tests
lionel- Jun 10, 2026
5034835
Check that `did_close` clears diagnostics
lionel- Jun 10, 2026
f2edf8d
Tweak comment
lionel- Jun 10, 2026
1530776
Rename `PackageDescriptor` to `PackageEntry`
lionel- Jun 10, 2026
91554d4
Take `package_dir` in `read_package()`
lionel- Jun 10, 2026
127a235
Split into `scan_workspace_packages()` and `scan_workspace_scripts()`
lionel- Jun 10, 2026
e42cc4f
Remove confusing comment
lionel- Jun 10, 2026
4662bd9
Use longer names in closures
lionel- Jun 10, 2026
b24aa91
Address code review
lionel- Jun 10, 2026
efaac0e
Extract `PackagePlacement`
lionel- Jun 10, 2026
b4c9374
Respect gitignore in workspace packages
lionel- Jun 10, 2026
b9a8807
Avoid unncessary clones
lionel- Jun 10, 2026
779653a
Store files in `HashSet`
lionel- Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,5 @@ If changes are needed in these files, that must happen in the separate Positron
- Don't let comments drift from the code. If behaviour changes, update nearby comments. If a file is renamed, update its header comment.

- Use the new async closure syntax, e.g. `async move || { ... }` instead of `|| async move { ... }`.

- Name closure and pattern bindings after what they hold, not by a single letter. Still use short names if possible, but disambiguate if needed. E.g. write `|root| root.path(db)` and `|(root_path, _)| path.starts_with(root_path)`, not `|r|` / `|(p, _)|`.
31 changes: 31 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ harp_macros = { path = "crates/harp_macros" }
hex = "0.4.3"
hmac = "0.13.0"
home = "0.5.12"
ignore = "0.4.23"
insta = "1.47.2"
itertools = "0.14.0"
libc = "0.2.186"
Expand Down
1 change: 1 addition & 0 deletions crates/ark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ oak_core.workspace = true
oak_db.workspace = true
oak_ide.workspace = true
oak_package_metadata.workspace = true
oak_scan.workspace = true
oak_semantic.workspace = true
oak_sources.workspace = true
once_cell.workspace = true
Expand Down
67 changes: 32 additions & 35 deletions crates/ark/src/lsp/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,6 @@ mod tests {
use oak_package_metadata::namespace::Namespace;
use oak_semantic::library::Library;
use oak_semantic::package::Package;
use once_cell::sync::Lazy;
use stdext::SortedVec;
use tower_lsp::lsp_types;
use tower_lsp::lsp_types::Position;
Expand All @@ -1147,9 +1146,6 @@ mod tests {
use crate::lsp::state::WorldState;
use crate::r_task;

// Default state that includes installed packages and default scopes.
static DEFAULT_STATE: Lazy<WorldState> = Lazy::new(current_state);

fn generate_diagnostics(doc: Document, state: WorldState) -> Vec<lsp_types::Diagnostic> {
super::generate_diagnostics(doc, state, false)
}
Expand All @@ -1174,7 +1170,7 @@ foo

1 }";
let document = Document::new(text, None);
let diagnostics = generate_diagnostics(document, DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document, current_state());
assert_eq!(diagnostics.len(), 2);

let diagnostic = diagnostics.first().unwrap();
Expand All @@ -1198,7 +1194,7 @@ foo
2 # hi there
)";
let document = Document::new(text, None);
let diagnostics = generate_diagnostics(document, DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document, current_state());
assert!(diagnostics.is_empty());
})
}
Expand All @@ -1208,7 +1204,7 @@ foo
r_task(|| {
let text = "base::";
let document = Document::new(text, None);
let diagnostics = generate_diagnostics(document, DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document, current_state());
assert_eq!(diagnostics.len(), 1);
let diagnostic = diagnostics.first().unwrap();
insta::assert_snapshot!(diagnostic.message);
Expand All @@ -1221,7 +1217,7 @@ foo
let text = "..1 + ..2 + 3";
let document = Document::new(text, None);

let diagnostics = generate_diagnostics(document, DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document, current_state());

assert!(diagnostics.is_empty());
})
Expand Down Expand Up @@ -1264,7 +1260,7 @@ foo
y + x + z
";
let document = Document::new(text, None);
let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert!(diagnostics.is_empty());
})
}
Expand All @@ -1278,7 +1274,7 @@ foo
y + x
";
let document = Document::new(text, None);
let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert!(diagnostics.is_empty());
})
}
Expand All @@ -1293,7 +1289,7 @@ foo
";
let document = Document::new(text, None);

let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert_eq!(diagnostics.len(), 1);

// Only marks the `x` before the `x <- 1`
Expand All @@ -1312,7 +1308,7 @@ foo
identity(~foo)
";
let document = Document::new(text, None);
let diagnostics = generate_diagnostics(document, DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document, current_state());
assert!(diagnostics.is_empty());
})
}
Expand All @@ -1329,7 +1325,7 @@ foo

let document = Document::new(code, None);

let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert_eq!(diagnostics.len(), 1);

let diagnostic = diagnostics.first().unwrap();
Expand All @@ -1349,7 +1345,7 @@ foo

let document = Document::new(code, None);

let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert_eq!(diagnostics.len(), 1);

let diagnostic = diagnostics.first().unwrap();
Expand All @@ -1370,7 +1366,7 @@ foo

let document = Document::new(code, None);

let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert_eq!(diagnostics.len(), 1);

let diagnostic = diagnostics.first().unwrap();
Expand All @@ -1390,7 +1386,7 @@ foo

let document = Document::new(code, None);

let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert_eq!(diagnostics.len(), 1);

let diagnostic = diagnostics.first().unwrap();
Expand All @@ -1408,7 +1404,7 @@ foo

let document = Document::new(code, None);

let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert_eq!(diagnostics.len(), 0);
})
}
Expand All @@ -1423,7 +1419,7 @@ foo

let document = Document::new(code, None);

let diagnostics = generate_diagnostics(document.clone(), DEFAULT_STATE.clone());
let diagnostics = generate_diagnostics(document.clone(), current_state());
assert_eq!(diagnostics.len(), 0);
})
}
Expand All @@ -1444,7 +1440,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);

Expand All @@ -1454,7 +1450,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);
});
Expand All @@ -1468,7 +1464,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);

Expand All @@ -1479,7 +1475,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);
});
Expand All @@ -1493,7 +1489,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);

Expand All @@ -1504,7 +1500,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);
});
Expand All @@ -1523,7 +1519,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);

Expand All @@ -1535,7 +1531,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);

Expand All @@ -1546,7 +1542,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
1
);
});
Expand All @@ -1563,7 +1559,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);

Expand All @@ -1576,7 +1572,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);
});
Expand All @@ -1589,7 +1585,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);
});
Expand All @@ -1605,7 +1601,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);

Expand All @@ -1617,7 +1613,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);

Expand All @@ -1628,7 +1624,7 @@ foo
";
let document = Document::new(code, None);
assert_eq!(
generate_diagnostics(document.clone(), DEFAULT_STATE.clone()).len(),
generate_diagnostics(document.clone(), current_state()).len(),
0
);
})
Expand Down Expand Up @@ -1659,7 +1655,8 @@ foo
// Simulate a search path with `library` in scope
let console_scopes = vec![vec!["library".to_string()]];

// Whereas `DEFAULT_STATE` contains base package attached, this world state
// Whereas `current_state()` returns a state with the base package
// attached, this world state
// only contains `mockpkg` as installed package and `library()` on
// the search path.
let state = WorldState {
Expand Down Expand Up @@ -1861,7 +1858,7 @@ foo
let library = Library::new(vec![]).insert("penguins", palmerpenguins_pkg);

// Simulate a world state with the penguins package installed and attached
let mut state = DEFAULT_STATE.clone();
let mut state = current_state();
state.library = library;
state.console_scopes = vec![vec!["library".to_string()]];

Expand Down
Loading
Loading