Skip to content

Fix module inlay hint source positions - #1222

Merged
Frotty merged 1 commit into
masterfrom
codex/fix-module-inlay-hints
Aug 10, 2026
Merged

Fix module inlay hint source positions#1222
Frotty merged 1 commit into
masterfrom
codex/fix-module-inlay-hints

Conversation

@Frotty

@Frotty Frotty commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • skip compiler-generated module instantiation bodies when collecting inlay hints
  • require hinted arguments to have concrete source positions in the requested document
  • add a regression test for hints leaking from an imported module onto blank lines

Root cause

Module expansion grafts copied module bodies beneath classes that use them. The copied expressions retain the module definition's line and column, while an LSP position carries no filename. Those coordinates were therefore interpreted as positions in the consuming document, producing hints on unrelated or empty lines.

Impact

Classes using modules no longer display parameter hints originating from generated module copies. Normal source-level parameter hints remain unchanged.

Validation

  • ./gradlew.bat test --tests "tests.wurstscript.tests.LspNativeFeaturesTests.inlayHintsIgnoreCopiedModuleBodyFromAnotherFile"
  • ./gradlew.bat test --tests "tests.wurstscript.tests.LspNativeFeaturesTests"
  • git diff --check

@Frotty
Frotty merged commit b687a99 into master Aug 10, 2026
6 checks passed
@Frotty
Frotty deleted the codex/fix-module-inlay-hints branch August 10, 2026 10:10
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