Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify showSDocUnsafe #2830

Merged
merged 19 commits into from
Apr 27, 2022
Merged

Unify showSDocUnsafe #2830

merged 19 commits into from
Apr 27, 2022

Conversation

July541
Copy link
Collaborator

@July541 July541 commented Apr 16, 2022

We choose printOutputable :: Outputable a => a -> Text finally.


Extends #2828, this pr wrapped showSDocUnsafe and unified all SDoc printing functions into the following four functions

  1. showGhc has defaultUserStyle and suppressUnique, we'd use this as much as we can to print ghc internal.
  2. showGhcWithUniques is the alias of showSDocUnsafe, it may have different behavior under different ghc versions, like complex type variables in hover with GHC 9.2 #2716.
  3. prettyPrint sames as showGhc but return String instead of Text.
  4. prettyPrintWithUnique, the String version of showGhcWithUniques.

@July541 July541 marked this pull request as ready for review April 18, 2022 10:36
Copy link
Collaborator

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful, thank you!

ghcide/src/Development/IDE/GHC/Util.hs Outdated Show resolved Hide resolved
ghcide/src/Development/IDE/GHC/Util.hs Outdated Show resolved Hide resolved
ghcide/src/Development/IDE/GHC/Util.hs Outdated Show resolved Hide resolved
ghcide/src/Development/IDE/LSP/Outline.hs Outdated Show resolved Hide resolved
ghcide/src/Development/IDE/Types/Exports.hs Outdated Show resolved Hide resolved
@isovector
Copy link
Collaborator

lgtm, thanks!

Copy link
Member

@Ailrun Ailrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update!

Copy link
Member

@Ailrun Ailrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me :) Here are a few very minor comments:

ghcide/src/Development/IDE/Spans/AtPoint.hs Outdated Show resolved Hide resolved
ghcide/src/Development/IDE/GHC/Compat/Outputable.hs Outdated Show resolved Hide resolved
Copy link
Collaborator

@eddiemundo eddiemundo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanna bikeshed printOutputable to prettyPrintAsText since it's the same as prettyPrint, or oppositely prettyPrint to printOutputableAsString, but since you already did a change once, it's fine...

So all good.

@Ailrun Ailrun added the merge me Label to trigger pull request merge label Apr 21, 2022
@michaelpj michaelpj removed the merge me Label to trigger pull request merge label Apr 21, 2022
@michaelpj
Copy link
Collaborator

Temporarily taking out of the merge queue until the release is done.

@Ailrun Ailrun added the merge me Label to trigger pull request merge label Apr 26, 2022
@mergify mergify bot merged commit 6742c20 into haskell:master Apr 27, 2022
sloorush pushed a commit to sloorush/haskell-language-server that referenced this pull request May 21, 2022
* Unify showSDocUnsafe

* Fix dependency

* Add missing instance

* Add missing instance

* Remove unused imports

* Clean up unused code

* Remove unnecessary exports & Rename

* Unify use printOutputable

* Remove redundant import

* Replace show with unpack

* Rerun tests

* Rerun tests

Co-authored-by: Pepe Iborra <[email protected]>
Co-authored-by: Junyoung "Clare" Jang <[email protected]>
hololeap pushed a commit to hololeap/haskell-language-server that referenced this pull request Aug 26, 2022
* Unify showSDocUnsafe

* Fix dependency

* Add missing instance

* Add missing instance

* Remove unused imports

* Clean up unused code

* Remove unnecessary exports & Rename

* Unify use printOutputable

* Remove redundant import

* Replace show with unpack

* Rerun tests

* Rerun tests

Co-authored-by: Pepe Iborra <[email protected]>
Co-authored-by: Junyoung "Clare" Jang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants