Repository navigation
Reintroduce hls-retrie-plugin - #5147
Open
simonhorlick wants to merge 93 commits into
Open
simonhorlick wants to merge 93 commits into
simonhorlick wants to merge 93 commits into
Conversation
This reverts commit b6f2b74.
Replace the two plugin commands with a resolve provider registered via mkCodeActionWithResolveAndCommand. This allows for better integration with editors.
* appends an import * append import at layout column * import unqualified to match template * import qualified * reject if required import isn't exported
Import handling was mostly broken for inlining. The new implementation looks up how the defining module imports a name and attempts to add that import to the target module. If the name cannot be imported (it uses PatternSynonyms, or the name is just not exported) then alert the user and skip the rewrite.
Since the addition of the resolve flow, this is better handled inside the client. For example, in VSCode using ctrl+enter on a code action allows users to select which rewrites to apply.
This needs to be fixed upstream in ghc-exactprint
simonhorlick
requested review from
crtschin,
fendor,
michaelpj and
wz1000
as code owners
October 16, 2026 14:18
1 task done
stylish-haskell blanks the #if lines and parses the whole module, with the body in the previous position that caused a parse error from stylish haskell. This seems like the simplest fix.
This branch has not been deployed
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.
This PR resurrects the hls-retrie-plugin.
The previous retrie plugin had a few issues that I wanted to ensure were solved by the new plugin:
This is the result of many attempts and failures, each leading to a hopefully better implementation. I have tried to document below the known shortcomings, many of these I intend to address with follow up PRs.
AI disclaimer: Some of the test cases were suggested by Claude. The plugin code itself is almost completely hand written.
What's supported
What's missing?
Testing
This PR has undergone the following tests:
Fixes #279
Fixes #307
Fixes #1758
Partially fixes #4374 (by rejecting defs with guards, for now)
Fixes #4408 (except for the ghc10 support as noted in the comments)