Support RemoveModule tags in map overrides#76
Conversation
- Resolve RemoveModule references to module tags - Validate and complete inherited DefaultThingTemplate tags for new map objects - Add diagnostics, navigation, semantic highlighting, and tests
|
| Filename | Overview |
|---|---|
| crates/analysis/src/index.rs | Adds location-aware module-tag indexing and effective-tag lookup, but the lookup loses map operation ordering. |
| crates/analysis/src/diagnostics.rs | Adds useful removal validation and default-module hints, while relying on a position-independent effective-tag set. |
| crates/analysis/src/nav.rs | Correctly identifies RemoveModule value tokens and their owning objects for definition lookup. |
| crates/server/src/backend.rs | Wires module tags into go-to-definition but leaves find-references and rename unaware of the new reference kind. |
| crates/server/src/scan.rs | Propagates module-tag definitions through workspace scanning without an identified defect. |
| crates/analysis/src/completion.rs | Uses effective module tags for removal completions, inheriting the index's order-insensitive behavior. |
Comments Outside Diff (1)
-
crates/server/src/backend.rs, line 475-480 (link)Include module-tag reference operations
The shared resolver for Find References and Rename omits
module_tag_reference_at, so these operations return no result from aRemoveModulevalue and renaming a module-tag declaration leaves matching removals unchanged.
Reviews (1): Last reviewed commit: "Support RemoveModule tags in map overrid..." | Re-trigger Greptile
| let mut out = self.module_tags_for_object(name).collect::<Vec<_>>(); | ||
| let is_new_override = file.is_some_and(|file| self.is_new_override_object(name, file)); | ||
| if is_new_override { | ||
| out.extend(self.module_tags_for_object("DefaultThingTemplate")); |
There was a problem hiding this comment.
Preserve module operation ordering
When a map or solo override removes a tag before a later module declaration introduces that tag, the whole-file index already includes the later declaration and accepts the removal, leaving an ineffective forward removal without an unknown-module-tag diagnostic.
Artifacts
Repro: minimal map override fixture with a forward module removal
- Evidence file captured while the check ran.
Repro: focused Rust analysis integration test and expected-versus-observed assertion
- Evidence file captured while the check ran.
Repro: verbose Cargo test output showing no diagnostics and the failed unknown-module-tag assertion
- The full command output behind this check.
43cf944 to
de59cb2
Compare
Summary
RemoveModuletags in map override files, including validation and completions for effective module tags.Testing
RemoveModulehandling.cargo test -p zerosyntax-analysis --test speccargo test -p zerosyntax-schema