This repository has been archived by the owner on Jan 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Fix for #45 - remove redundant symbols from imports #290
Merged
Conversation
This file contains 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
aherrmann-da
approved these changes
Dec 23, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, that looks great!
There are some CI issues (hlint
and stack.yaml
) - see review comments
Co-Authored-By: Andreas Herrmann <[email protected]>
Co-Authored-By: Andreas Herrmann <[email protected]>
Suggestions applied, thanks! |
GHC ticket #14881 changed this to print identifiers unqualified
@pepeiborra Thank you for fixing all these and for implementing the feature. |
pepeiborra
added a commit
to pepeiborra/ghcide
that referenced
this pull request
Jan 3, 2020
* Test for #45 * Remove redundant symbols from imports Fixes #45 * Update src/Development/IDE/LSP/CodeAction.hs Co-Authored-By: Andreas Herrmann <[email protected]> * Apply suggestions from code review Co-Authored-By: Andreas Herrmann <[email protected]> * Add regex-tdfa extra deps to ghc-lib build * Fix for GHC 8.4 (error message prints qualified binding) GHC ticket #14881 changed this to print identifiers unqualified * dropBindingsFromImportLine: make total Co-authored-by: Andreas Herrmann <[email protected]>
pepeiborra
added a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
…skell/ghcide#290) * Test for haskell/ghcide#45 * Remove redundant symbols from imports Fixes haskell/ghcide#45 * Update src/Development/IDE/LSP/CodeAction.hs Co-Authored-By: Andreas Herrmann <[email protected]> * Apply suggestions from code review Co-Authored-By: Andreas Herrmann <[email protected]> * Add regex-tdfa extra deps to ghc-lib build * Fix for GHC 8.4 (error message prints qualified binding) GHC ticket haskell/ghcide#14881 changed this to print identifiers unqualified * dropBindingsFromImportLine: make total Co-authored-by: Andreas Herrmann <[email protected]>
pepeiborra
added a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
…skell/ghcide#290) * Test for haskell/ghcide#45 * Remove redundant symbols from imports Fixes haskell/ghcide#45 * Update src/Development/IDE/LSP/CodeAction.hs Co-Authored-By: Andreas Herrmann <[email protected]> * Apply suggestions from code review Co-Authored-By: Andreas Herrmann <[email protected]> * Add regex-tdfa extra deps to ghc-lib build * Fix for GHC 8.4 (error message prints qualified binding) GHC ticket haskell/ghcide#14881 changed this to print identifiers unqualified * dropBindingsFromImportLine: make total Co-authored-by: Andreas Herrmann <[email protected]>
pepeiborra
added a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
…skell/ghcide#290) * Test for haskell/ghcide#45 * Remove redundant symbols from imports Fixes haskell/ghcide#45 * Update src/Development/IDE/LSP/CodeAction.hs Co-Authored-By: Andreas Herrmann <[email protected]> * Apply suggestions from code review Co-Authored-By: Andreas Herrmann <[email protected]> * Add regex-tdfa extra deps to ghc-lib build * Fix for GHC 8.4 (error message prints qualified binding) GHC ticket haskell/ghcide#14881 changed this to print identifiers unqualified * dropBindingsFromImportLine: make total Co-authored-by: Andreas Herrmann <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
To parse and edit module imports I went with a very low tech solution, instead of reusing the GHC parse tree or similar, in the interest of preserving as much of the user text as possible.
To match on the GHC error output I went with regex-tdfa, which is able to run regular expressions on
Text
values, because it seems the right tool for the job. While it has an upper bound onbase
that rules out 8.8, it worked for me withallow-newer
.