Skip to content

Commit e6fbf7d

Browse files
Merge pull request #343 from SwiftFiddle/token-balloon
Improve balloon token kind
2 parents e850511 + 343585e commit e6fbf7d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Public/css/balloon.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@
5757
.balloon .title {
5858
color: #fff;
5959
font-weight: bolder;
60+
display: inline-block;
61+
}
62+
63+
.balloon .token-kind {
64+
color: #fff;
65+
font-weight: normal;
66+
font-family: Menlo, Consolas, "DejaVu Sans Mono", "Ubuntu Mono", monospace;
67+
max-width: 200px;
68+
display: inline-block;
69+
vertical-align: bottom;
6070
}
6171

6272
.balloon .range {

Public/js/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ export class App {
153153
this.structureView.update(data);
154154

155155
this.structureView.onmouseover = (event, target, data) => {
156-
const title = data.token ? "Token" : `${data.text}`;
156+
const title = data.token
157+
? `Token <span class="token-kind text-truncate" style="max-width: 300px;">${data.token.kind}</span>`
158+
: `${data.text}`;
157159
const range = data.range;
158160

159161
const formatted = formatRange(range);

0 commit comments

Comments
 (0)