-
Notifications
You must be signed in to change notification settings - Fork 184
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
Enhancement: Keep whitespace displayed in popups #112
Conversation
mdpopups' markdown engine squashes down all multiple spaces to one. This commit prepares the content to preserve them all and make popup content look a bit better.
It is related to #105 yes, even though I havn't been not following that issue. Just realized it myself. before now |
If you ask me, signature/docstring popups require their own rendering module/package to be able to handle different languages and formats and create a common user experience. This is just a very short and quick hotfix.
|
Yeah, I sort of agree with @deathaxe in that signature popups may vary too much between servers/languages. It could be an idea to make LSP itself a PC package that can be added as a dependency, and then provide language-specific overrides for various servers/languages. This is how it's handled in VSCode and Atom, for example. |
This approach would split the server/protocol specific communication infrastructure which is some kind of backend away from presenting the results and handle user interactions which would be the frontend. No matter how it is solved, but I think some infrastructure which splits apart the the protocol and communication stuff away from language-specific handling is required. But I like the idea to have one package, which is at least capable to provide a minimum set of functions. If you ask someone to create a frontend for each language, you'll probably not find one. Have a look onto the new |
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.
Solid improvement, thanks!
main.py
Outdated
@@ -1721,6 +1721,14 @@ def show_hover(self, point, contents): | |||
max_width=800) | |||
|
|||
|
|||
def format_popup_content(contents: str) -> str: |
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.
To avoid confusion about what "formatting" really means, could you rename this to something like preserve_whitespace
or encode_whitespace
(or something else to your liking?)
🤘 |
mdpopups' markdown engine squashes down all multiple spaces to one.
This PR prepares the content to preserve them all and make popup content look a bit better.