fix(deps): update dependencies and fix all compilation errors
Updated dependencies to latest versions causing breaking changes: - logos: 0.14 -> 0.16 - lalrpop: 0.21 -> 0.23 - thiserror: 1.0 -> 2.0 - petgraph: 0.6 -> 0.8 - notify: 6.0 -> 8 - toml: 0.8 -> 1.0.2 - tree-sitter (grammar): 0.20 -> 0.26 Fixed compilation issues: 1. logos 0.16: Added allow_greedy for unbounded repetitions in lexer 2. lalrpop 0.23: Changed from process_current_dir() to process() 3. tree-sitter 0.26: Updated bindings to use &Language reference Also fixed Zed extension: - Removed local highlights.scm override that had diverged from source - Added regression test to prevent future divergence
This commit is contained in:
@@ -329,6 +329,56 @@ concept_comparison SkillLevel {
|
||||
// Zed Extension Build Tests
|
||||
// ============================================================================
|
||||
|
||||
#[test]
|
||||
fn test_zed_highlights_query_not_overridden() {
|
||||
// This test ensures the Zed extension doesn't have a local highlights.scm
|
||||
// that overrides the grammar's version. Local overrides create a maintenance
|
||||
// burden and can easily diverge from the source of truth.
|
||||
//
|
||||
// The preferred approach is to let Zed use the fetched grammar's queries.
|
||||
// If a local override is needed (for Zed-specific customizations), this test
|
||||
// will fail and remind us to keep them in sync.
|
||||
|
||||
let grammar_highlights = tree_sitter_dir().join("queries").join("highlights.scm");
|
||||
let zed_highlights = zed_extension_dir()
|
||||
.join("languages")
|
||||
.join("storybook")
|
||||
.join("highlights.scm");
|
||||
|
||||
// Verify grammar version exists
|
||||
assert!(
|
||||
grammar_highlights.exists(),
|
||||
"Grammar highlights.scm not found at {:?}",
|
||||
grammar_highlights
|
||||
);
|
||||
|
||||
// If Zed has a local override, it MUST match the grammar version exactly
|
||||
if zed_highlights.exists() {
|
||||
let grammar_content = std::fs::read_to_string(&grammar_highlights)
|
||||
.expect("Failed to read grammar highlights");
|
||||
let zed_content =
|
||||
std::fs::read_to_string(&zed_highlights).expect("Failed to read zed highlights");
|
||||
|
||||
assert_eq!(
|
||||
grammar_content,
|
||||
zed_content,
|
||||
"\n\nZed extension has a local highlights.scm that differs from the grammar version.\n\
|
||||
This causes the query to fail validation against the fetched grammar.\n\
|
||||
\n\
|
||||
To fix:\n\
|
||||
1. Delete zed-storybook/languages/storybook/highlights.scm (preferred)\n\
|
||||
2. Or sync it: cp tree-sitter-storybook/queries/highlights.scm zed-storybook/languages/storybook/\n\
|
||||
\n\
|
||||
Grammar version: {:?}\n\
|
||||
Zed version: {:?}\n",
|
||||
grammar_highlights,
|
||||
zed_highlights
|
||||
);
|
||||
}
|
||||
// If no local override exists, the test passes - Zed will use the fetched
|
||||
// grammar's version
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore] // Only run with --ignored flag as this is slow
|
||||
fn test_zed_extension_builds() {
|
||||
|
||||
Reference in New Issue
Block a user