microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 237 forks source link

Popups Have No Color #698

Open kbjr opened 5 years ago

kbjr commented 5 years ago

Pretty much what the title says, the popups don't seem to have any colors at all.

image

This is on Windows 10 64-bit, Sublime Text 3184

sluebbert commented 5 years ago

I was looking into this several weeks ago when I noticed demos actually had color and mine didn't. I didn't figure anything out though. I hoped I was just missing a plugin or a setting. I have tried several different themes / color schemes.

Unfortunately, all I can add to this issue is that it is also happening on Arch Linux 64 bit, Sublime Text 3176.

DanielRosenwasser commented 5 years ago

Was it demos with Sublime? Or VS Code? I don't think we ever had color, but it would be a welcome addition if anyone can figure it out.

kbjr commented 5 years ago

You have a gif right here on the readme of this repo (signature popup example) that shows the popups with color.

image

kbjr commented 5 years ago

So, I started doing some digging, and this is the HTML rendered in that signature popup for a basic example:

<style>
body {
    font-size: ${fontSize}px;
}
div {
    margin: 5px;
    word-wrap:break-word;
}
</style>
<div><b>
    <span class="text">Session</span>
    <span class="text">(</span>
    <span class="current">
        <span class="param">options</span>
    </span>
    <span class="text">:</span>
    <span class="text"> </span>
    <span class="text">SessionOptions</span>
    <span class="text">)</span>
    <span class="text">:</span>
    <span class="text"> </span>
    <span class="text">Session</span>
</b></div>
<div style="margin-left: 15px"></div>
<div>
    <span class="param">options:</span> 
    <i></i>
</div>
<div><a href="link">1/1</a></div>

It very clearly appears as if it was designed to be syntax highlighted from the start, it's already broken down into types to be styled. There just aren't any actual styles applied.

kbjr commented 5 years ago

Here's a very basic working version: https://github.com/Microsoft/TypeScript-Sublime-Plugin/pull/707

kbjr commented 5 years ago

Also, from the file history here (https://github.com/Microsoft/TypeScript-Sublime-Plugin/blame/07b705722da75ff74ef6f5aab1ebceb9f8121fef/popup.html), yes, the feature did exist previously, but it had hardcoded values for colors, then it was removed at some point. The readme was just never updated to not show that in the examples anymore.

This version actually pulls the colors from the current theme, rather than hard coded colors. Someone could take it a step further and look at the styles other than foreground color, I just wanted to get it working at all first.

KubaJastrz commented 5 years ago

closed by #707