Skip to content

Support RemoveModule tags in map overrides#76

Merged
ViTeXFTW merged 2 commits into
devfrom
t3code/remove-module-moduletags
Jul 25, 2026
Merged

Support RemoveModule tags in map overrides#76
ViTeXFTW merged 2 commits into
devfrom
t3code/remove-module-moduletags

Conversation

@ViTeXFTW

Copy link
Copy Markdown
Owner

Summary

  • Added support for RemoveModule tags in map override files, including validation and completions for effective module tags.
  • Updated diagnostics to flag unknown module tags and warn when a new map object still inherits default modules.
  • Simplified map override reference checks to focus on order-dependent references and removed obsolete asset/module completion paths.
  • Refreshed schema, analysis, server, and VS Code plumbing to match the new map-override behavior.

Testing

  • Added/updated spec coverage for map override behavior and RemoveModule handling.
  • cargo test -p zerosyntax-analysis --test spec
  • cargo test -p zerosyntax-schema
  • Not run: full workspace test suite and end-to-end server checks.

- Resolve RemoveModule references to module tags
- Validate and complete inherited DefaultThingTemplate tags for new map objects
- Add diagnostics, navigation, semantic highlighting, and tests
@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown

Greptile Summary

Adds indexed RemoveModule tag validation, completion, navigation, diagnostics, and corresponding server/test/documentation plumbing.

  • Tracks module-tag definitions and locations across workspace files.
  • Includes DefaultThingTemplate tags for newly created map objects.
  • Adds unknown-tag and inherited-default-module diagnostics.
  • Updates map override specifications and server behavior.

Confidence Score: 3/5

The PR should not merge until RemoveModule validation respects map operation order; incomplete reference and rename integration is additionally worth addressing.

Whole-file tag aggregation allows a removal to validate against a module declared only later, while the server's shared symbol resolver does not recognize the newly supported module-tag reference.

Files Needing Attention: crates/analysis/src/index.rs, crates/analysis/src/diagnostics.rs, crates/server/src/backend.rs

T-Rex T-Rex Logs

What T-Rex did

  • Ran a focused Rust integration test against a forward RemoveModule fixture to verify module-order preservation; the test reproduced the assertion failure with no diagnostics and cargo exited with code 101.
  • Executed the explicit spec suite; default-tag completion and tag-validation tests passed, and no tracked source files were modified.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

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)

  1. crates/server/src/backend.rs, line 475-480 (link)

    P2 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 a RemoveModule value and renaming a module-tag declaration leaves matching removals unchanged.

Reviews (1): Last reviewed commit: "Support RemoveModule tags in map overrid..." | Re-trigger Greptile

Comment thread crates/analysis/src/index.rs Outdated
Comment on lines +455 to +458
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"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

View artifacts

T-Rex Ran code and verified through T-Rex

@ViTeXFTW
ViTeXFTW force-pushed the t3code/remove-module-moduletags branch from 43cf944 to de59cb2 Compare July 25, 2026 18:40
@ViTeXFTW
ViTeXFTW merged commit 2dfbd17 into dev Jul 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant