Skip to content

Commit 797e037

Browse files
committed
feat: make datatips look like the linter tooltips
1 parent 28a84dc commit 797e037

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

lib/datatip-manager.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export class DataTipManager {
361361
containerClassName: "datatip-component-container",
362362
contentClassName: "datatip-component",
363363
},
364-
className: "datatip-element select-list popover-list",
364+
className: "datatip-element",
365365
})
366366
this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView)
367367
} else if (datatip.markedStrings.length > 0) {
@@ -399,7 +399,7 @@ export class DataTipManager {
399399
const dataTipView = new ViewContainer({
400400
snippet,
401401
markdown,
402-
className: "datatip-element select-list popover-list",
402+
className: "datatip-element",
403403
})
404404

405405
this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView)
@@ -425,7 +425,10 @@ export class DataTipManager {
425425
position: Point,
426426
view: ViewContainer
427427
): CompositeDisposable | null {
428-
const element = view.element as HTMLElement
428+
const element = document.createElement("div")
429+
element.className = "datatip-border"
430+
431+
element.appendChild(view.element as HTMLElement)
429432

430433
// TODO do we need this?
431434
if (!element) {

styles/atom-ide-datatips.less

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
@import "ui-variables";
22
@import "syntax-variables";
33

4+
// .datatip-overlay {
5+
// }
6+
7+
.datatip-border {
8+
background: @app-background-color;
9+
padding: 10px;
10+
}
11+
412
.datatip-element {
13+
background: @app-background-color;
14+
.datatip-hover-effect();
15+
padding: 2px;
16+
517
overflow: auto; // prevents the long text to come out of the datatip
618
color: @syntax-text-color;
719
white-space: nowrap;
@@ -34,19 +46,14 @@
3446
}
3547
}
3648

37-
.datatip-element.select-list.popover-list {
38-
width: auto;
39-
}
40-
41-
.datatip-overlay {
49+
.datatip-hover-effect() {
4250
// info border
43-
border-bottom: 5px solid @background-color-highlight;
44-
border-radius: 3px;
51+
border-left: 5px solid @background-color-highlight;
4552

4653
// info bar glow
47-
transition: border-bottom-color 0.15s ease;
54+
transition: border-left-color 0.15s ease;
4855
&:hover {
49-
border-bottom-color: lighten(@background-color-highlight, 10%);
56+
border-left-color: lighten(@background-color-highlight, 10%);
5057
}
5158
}
5259

0 commit comments

Comments
 (0)