maziac / hex-hover-converter

MIT License
8 stars 3 forks source link

Better Readability #6

Closed nwehrle closed 2 years ago

nwehrle commented 3 years ago

Hi. I really like your extension for converting numbers the most, because it detects the base properly in my asm code. Kudos! Other plugins (I found 3) look better but do not work better.

Could you invest some time in a nicer styling for the numbers?

Quickwins in my opinion:

Bonus points:

Example without nibble-grouping:

Screenshot 2021-05-21 at 22 22 58
maziac commented 3 years ago

The Hex-Hover-Converter uses a markdown string for formatting. This does not allow many options. Markdown and plain text are the 2 formats that vscode understands for hovering. I would love to have more options on formatting. If you have any suggestions how to do it technically please let me know. Or if you have a link for one or more extensions that have better formatting please put them here and I have a look.

nwehrle commented 3 years ago

Thanks for the reply. Here is a link to a styled hover. https://github.com/mateuszchudyk/vscode-hexinspector

maziac commented 3 years ago

Thanks for the link. Seems hex inspector is using the 'language' feature and provides some syntax for it. I will not go that way as I need to use the table functionality from the markdown. I.e. if the number cannot be uniquely identified as hex I will show 2 or 3 table entries next to each other. That would not easily be possible.

But if you have other links/extensions I can have a look there too. Maybe some other implementation I could use ...

nwehrle commented 3 years ago

This one does not work properly for my use case, but it has some formatting. https://marketplace.visualstudio.com/items?itemName=bedrankara.hoverconverter

maziac commented 3 years ago

From the pictures in the readme I can‘t see much formatting. There is some coloring, but from the code I can‘t see where it is coming from. Will play a little bit with it.

maziac commented 3 years ago

The color is coming again from a 'language' and the used format is not markdown. I.e. not usable in my case.

I also experimented with using ` for plaintext or code to get a non-proportional text to use. but that results in slightly different background colors, see here:

Bildschirmfoto 2021-05-24 um 15 08 56

Black on dark gray.

Doing some more research: vscode is disallowing formatting inside the hover text for markdown on purpose. They want to keep the IntelliSense experience similar.

So, I guess there is not much I can do about it.

maziac commented 1 year ago

I checked this once more. The interface that the hex inspector is using (MarkedString with a given language) is deprecated.

But there is now the possibility to use

                    const mdText = new vscode.MarkdownString();
                    mdText.supportHtml = true;
                    mdText.isTrusted = true;

with '<span style='color:#fff>' But the problem here is that the colors are hardcoded, it is only possible to use hex numbers. I.e. they will not change when toggling between dark and light mode.

Furthermore it is still not possible to get the hex color string from a ThemeColor.

Conclusion: As of vscode 1.74 there is no (future proof) way to colorize the hovers.