-
Notifications
You must be signed in to change notification settings - Fork 299
Feature: render markdown and fix tooltip dimensions #1253
Conversation
fix code font and markdown styles Note bug re rendering if width changes
Cool, thanks for looking at this @Akin909 ! The hover experience could definitely use some love 😄
Regarding the syntax highlighting - this is something I'm still trying to figure out. It would be interesting to see what strategy @TalAmuyal used for the markdown-preview plugin - I wonder if we could share/reuse pieces between this? One challenge we have with the syntax highlighting is being able to read the highlight groups. Right now, we don't really have the information on the Oni side related to the colors for each of the highlight groups. It'd be really nice to have this! One option would be to explicitly set it in the themes (like a It might also be possible to use our existing TextMate highlighting for code blocks - we can run a TextMate grammar on each line. The code where this happens is here:
editor.tokenColors . But still need to figure out how to get actual colors there 😄
Ideally, with whatever strategy we choose - the highlighting colors can match our theme. One thing I noticed too between our experience and VSCode is that we render the first line in a special way: I'm wondering if we should do away with that special handling (box-shadow/different font/different formatting) of our 'title'? Oh, and the width changes you made look good to me - thanks for digging in there and looking at options! 👍 |
fix overflow quirk but setting it only in docs and not its children increase arrow size add margin right to autocomplete
based on theme
Having had a peek over a co-worker's shoulder at the |
We should have a way at least to specify handpicked colors for the hover info, to override the darkening behavior, since it might not work correctly in every case (or perhaps someone wants some exotic color for their scheme 😄 ). Using the strategy of seeing if the theme is light/dark would help, but there will still be situations where the user might still want to override it. Perhaps we could use
Hmm, I'll grab the latest changes and see if I can reproduce it again. |
Ah thanks for the info and the screen grab seems that definitely relates to forcing the font-family down through css which I did to bypass having to use prop drilling to pass it down from the container that has this state, I can revert that and apply that change only for code blocks. I'll add the config options as you suggest as well as darkening based on vim's background setting |
@bryphe I've added your recommend config options which if not set default to the darkened tooltip options. I haven't implemented the vim background based alteration as I realised I can determine the lightness or darkness of the original color just using the I also reverted the |
Changes looks good to me, @Akin909 ! I'm going to re-run the Linux job, as that should be passing. I'll bring it in after that runs. Thanks for your work on this! 👍 |
@bryphe nice! ✨, I can add a section to the docs about the changes that users can now configure like I imagine your intent would be to use the internal |
That would be awesome, thanks!
Yep, eventually 😄 But for now I'd like to funnel them through the |
Looks like the linux build failed, but due to the code coverage changes - I'm pulling those out in #1338 until we have a sturdier foundation for builds. I'll bring this in now. Thanks again for your work on this, @Akin909 ! 💯 |
Following comments in #1237 I've had a look at implementing some changes to the tooltip:
quickinfo
usingmarked
.This is still a WIP as outstanding things include:
theme["highlight.normal.bg"]
theme
fromstyled-components
?Maybe? syntax highlightingseparate pr@bryphe was hoping to get your feedback regarding the outstanding point especially syntax highlighting as I feel you likely would have had something in mind for this ?external lib like
highlight.js
orprism
? home grown highlighting to match themesSecondly the tweaks I made re the dimensions of the tooltip, I think that as per #1237 an almost full width tooltip is subjectively not ideal, I tried containing this width to a max-width which it seems like
vscode
does (it seems to have a relative max-width of say 40%) but what I personally like about oni's hover bar is that it gives you a lot of the type info. I initially tried a slightly larger max-width than vscode possibly/maybe uses but this causes an issue with padding, so i've tried to preserve this by rendering any element that will fit the screen, adding wrapping to thequickinfo
so text wraps vertically and also adding awidth: min-content
only for elements which are too big for the screen.here are some screenshots: