Fix tooltip showing mangled module suffix for companion modules (#17335)#19867
Open
T-Gro wants to merge 4 commits into
Open
Fix tooltip showing mangled module suffix for companion modules (#17335)#19867T-Gro wants to merge 4 commits into
T-Gro wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Routes the VRefLocal branch of fullNameOfParentOfValRef[AsLayout] through fullNameOfEntityRef[AsLayout] using TryDeclaringEntity. This reuses the existing entity-walking helper that calls DemangledModuleOrNamespaceName, so companion modules (FSharpModuleWithSuffix) lose their 'Module' suffix in the 'Full name:' tooltip, matching the VRefNonLocal branch behavior. Fixes #17335. Also corrects the caret placement in the 'ModuleSuffix attribute without companion type demangles' test (added in Sprint 01) so that the resolve position lands on the identifier 'x' rather than the preceding space. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
❗ Release notes required
|
auduchinok
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #17335
When a module has the same name as a type (companion module), the tooltip for values in that module was showing the mangled ModuleModule suffix instead of the demangled name. For example, unc123 in module MyType would show MyType.MyTypeModule.func123 instead of MyType.MyType.func123.
Root Cause
In ullNameOfParentOfValRef and ullNameOfParentOfValRefAsLayout, the VRefLocal case was using ullNameOfPubPath which walks the raw public path without demangling module names. The VRefNonLocal case already used DemangledModuleOrNamespaceName correctly.
Fix
For VRefLocal values that have a declaring entity available, use ullNameOfEntityRef with DemangledModuleOrNamespaceName (matching the VRefNonLocal path). Fall back to the old ullNameOfPubPath behavior only when no declaring entity is present.
Testing
Added tooltip tests verifying correct demangling for: