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

Fix hover format #2911

Merged
merged 3 commits into from
May 24, 2022
Merged

Fix hover format #2911

merged 3 commits into from
May 24, 2022

Conversation

July541
Copy link
Collaborator

@July541 July541 commented May 17, 2022

Close #2863.

It is because markdown newline requires two '\n' but a separate section only needs one '\n'.

image

@July541 July541 requested a review from pepeiborra as a code owner May 17, 2022 13:21
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.

Can we get some comments explaining the place where we need to be careful about newlines? Otherwise we're going to lose the knowledge you just generated!

++ catMaybes [ T.unlines . spanDocToMarkdown <$> lookupNameEnv dm n
]
where maybeKind = fmap printOutputable $ safeTyThingType =<< lookupNameEnv km n
pretty Nothing Nothing = Nothing
pretty (Just define) Nothing = Just $ define <> "\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Completely independent of this PR, but I wonder if we'd make our lives easier by using prettyprinter for some of this stuff 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately, I have little knowledge about prettyprinter... Maybe I'll improve this someday or any other can pick this...

@July541
Copy link
Collaborator Author

July541 commented May 18, 2022

Can we get some comments explaining the place where we need to be careful about newlines? Otherwise we're going to lose the knowledge you just generated!

Yes! all markdown-based content should be treat with care, I'll push more comment to explain what happened now.

@July541 July541 added the merge me Label to trigger pull request merge label May 23, 2022
@mergify mergify bot merged commit 859edfb into haskell:master May 24, 2022
hololeap pushed a commit to hololeap/haskell-language-server that referenced this pull request Aug 26, 2022
* Fix hover format

* Test with regex

* Add comments about inserting a new line in Markdown
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.

Hover content has different behavior between ghc-8.10.7 and ghc-9.2.2
2 participants