Skip to content

[Repo Assist] Improve type alias tooltip: show abbreviation signature as fallback#1516

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-914-type-alias-tooltip-fallback-6ba4f1cf66cbc728
Draft

[Repo Assist] Improve type alias tooltip: show abbreviation signature as fallback#1516
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-914-type-alias-tooltip-fallback-6ba4f1cf66cbc728

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 1, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Partially addresses #914 — improves tooltip/hover display for type aliases by providing a fallback signature when GetAbbreviatedParent() fails.

Root Cause

As identified by @baronfel in #914, fse.GetAbbreviatedParent() throws for certain type aliases (particularly those that resolve to tuples, primitives, or cross-assembly types that FCS doesn't represent as FSharpEntity symbols). When this happens, the TypeAbbreviation handler in DocumentationFormatter.fs catches the exception and returns None, resulting in no tooltip at all for those type aliases.

Fix

When GetAbbreviatedParent() fails or returns a non-entity, fall back to calling getEntitySignature directly on the abbreviation entity fse. This produces a signature like:

type StringPair = string * string

The getEntitySignature function already has this branch (checking IsFSharpAbbreviation) — we just weren't using it as a fallback before.

What remains unresolved

The full fix for #914 (clickable links to the abbreviated type, full documentation of the parent type) would require FCS changes to expose type alias entities properly. This PR improves the user experience in the common case by showing something useful rather than nothing.

Test Status

✅ Build succeeded (dotnet build src/FsAutoComplete/FsAutoComplete.fsproj -f net8.0)
✅ General unit tests passed

Full test suite was not run locally — CI will validate.

Generated by 🌈 Repo Assist at {run-started}. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@1f672aef974f4246124860fc532f82fe8a93a57e

When GetAbbreviatedParent() fails (e.g. for cross-assembly type aliases,
or when the abbreviated entity is not an FSharpEntity), fall back to
showing the type abbreviation's own signature using getEntitySignature
directly on the alias entity.

Previously the TypeAbbreviation case returned None on any failure,
resulting in no tooltip/documentation for type aliases. Now users
will see at minimum the abbreviation definition itself, e.g.:
  type StringPair = string * string

Partially addresses #914

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Krzysztof-Cieslak
Copy link
Copy Markdown
Member

/repo-assist add tests for this

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 1, 2026

✗ Repo Assist encountered failed at {run-ended}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant