Skip to content

Commit 2b8e1ee

Browse files
Styling
1 parent f6a9226 commit 2b8e1ee

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

Public/css/popover.css

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222
font-size: larger;
2323
}
2424

25-
.popover-content .badge {
26-
margin: 0 8px 0 8px;
27-
color: #808080;
28-
background-color: #f2f2f2;
29-
}
30-
3125
.popover-content dl {
3226
margin-top: 0;
3327
margin-bottom: 0;
@@ -50,12 +44,26 @@
5044
white-space: pre-line;
5145
}
5246

47+
.popover-content .badge {
48+
margin: 0 8px 0 8px;
49+
color: #696969;
50+
background-color: #f2f2f2;
51+
}
52+
53+
.popover-content .badge.ref {
54+
margin: 0 0 0 -0.65em;
55+
color: #696969;
56+
background-color: #f2f2f2;
57+
font-size: 100%;
58+
font-weight: normal;
59+
}
60+
5361
.popover-content .badge.annotation {
5462
width: 48px;
5563
text-align: end;
5664
font-size: 0.8rem;
5765
margin: 0 8px 0 0;
5866
padding: 0;
59-
color: #808080;
67+
color: #696969;
6068
background-color: transparent;
6169
}

Public/js/structure_view.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ function makeSourceRangePopoverContent(data, list) {
128128
function makePropertyPopoverContent(property, list) {
129129
const details = (() => {
130130
const value = property.value;
131-
if (value && value.text && value.kind) {
131+
if (property.ref) {
132+
return `<span class="badge ref">${property.ref}</span>`;
133+
} else if (value && value.text && value.kind) {
132134
const text = stripHTMLTag(value.text);
133135
const kind = stripHTMLTag(value.kind);
134136
return `${text}<span class="badge rounded-pill">${kind}</span>`;

Sources/App/Controllers/TokenVisitor.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ final class TokenVisitor: SyntaxRewriter {
102102
)
103103
case let value?:
104104
if let value = value as? SyntaxProtocol {
105-
treeNode.structure.append(StructureProperty(name: key, value: StructureValue(text: "\(value.syntaxNodeType)(...)")))
105+
let type = "\(value.syntaxNodeType)"
106+
treeNode.structure.append(StructureProperty(name: key, value: StructureValue(text: "\(type)"), ref: "\(type)"))
106107
} else {
107108
treeNode.structure.append(StructureProperty(name: key, value: StructureValue(text: "\(value)")))
108109
}

Sources/App/Models/TreeNode.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ struct Range: Codable {
2828
struct StructureProperty: Codable {
2929
let name: String
3030
let value: StructureValue?
31+
let ref: String?
3132

32-
init(name: String, value: StructureValue? = nil) {
33+
init(name: String, value: StructureValue? = nil, ref: String? = nil) {
3334
self.name = name
3435
self.value = value
36+
self.ref = ref
3537
}
3638
}
3739

0 commit comments

Comments
 (0)