Skip to content

Create hls-export-plugin with Export '...' code action#4952

Draft
crtschin wants to merge 9 commits into
haskell:masterfrom
crtschin:crtschin/export-1-export
Draft

Create hls-export-plugin with Export '...' code action#4952
crtschin wants to merge 9 commits into
haskell:masterfrom
crtschin:crtschin/export-1-export

Conversation

@crtschin

@crtschin crtschin commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

First part to #4948.

This differs from the existing action that hls-refactor-plugin provided:

  • hls-refactor-plugin only worked when the symbol was detected unused.
  • This uses structured diagnostics
  • Handles constructor/types nicely
  • Uses ghc-exactprint for export splicing

@crtschin crtschin force-pushed the crtschin/export-1-export branch from 9d4dfd2 to 764ce31 Compare June 6, 2026 22:42
crtschin added 4 commits June 8, 2026 22:26
A shared library lets the export plugin reuse them without depending on
hls-refactor-plugin.
Offered on `-Wunused-top-binds` diagnostics.
The hls-export-plugin Export action replaces it.
@crtschin crtschin force-pushed the crtschin/export-1-export branch from a81bce2 to 418edd5 Compare June 8, 2026 20:34
crtschin added 5 commits June 8, 2026 23:09
Freshly built names carry EpAnnNotUsed before GHC 9.9, so addParens
could not parenthesize operators.
TcRnUnusedName gained structured provenance only in GHC 9.8, so 9.6
cannot identify unused top-level binds to attach the action to.
@crtschin crtschin force-pushed the crtschin/export-1-export branch from 418edd5 to e9a5ab3 Compare June 8, 2026 21:11
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