Merge pull request #8957 from Microsoft/navbar_indent
Include indent in navigation bar protocol
This commit is contained in:
commit
3aaa4ea833
|
@ -459,7 +459,7 @@ namespace ts.server {
|
||||||
kindModifiers: item.kindModifiers || "",
|
kindModifiers: item.kindModifiers || "",
|
||||||
spans: item.spans.map(span => createTextSpanFromBounds(this.lineOffsetToPosition(fileName, span.start), this.lineOffsetToPosition(fileName, span.end))),
|
spans: item.spans.map(span => createTextSpanFromBounds(this.lineOffsetToPosition(fileName, span.start), this.lineOffsetToPosition(fileName, span.end))),
|
||||||
childItems: this.decodeNavigationBarItems(item.childItems, fileName),
|
childItems: this.decodeNavigationBarItems(item.childItems, fileName),
|
||||||
indent: 0,
|
indent: item.indent,
|
||||||
bolded: false,
|
bolded: false,
|
||||||
grayed: false
|
grayed: false
|
||||||
}));
|
}));
|
||||||
|
|
5
src/server/protocol.d.ts
vendored
5
src/server/protocol.d.ts
vendored
|
@ -1242,6 +1242,11 @@ declare namespace ts.server.protocol {
|
||||||
* Optional children.
|
* Optional children.
|
||||||
*/
|
*/
|
||||||
childItems?: NavigationBarItem[];
|
childItems?: NavigationBarItem[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of levels deep this item should appear.
|
||||||
|
*/
|
||||||
|
indent: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NavBarResponse extends Response {
|
export interface NavBarResponse extends Response {
|
||||||
|
|
|
@ -872,7 +872,8 @@ namespace ts.server {
|
||||||
start: compilerService.host.positionToLineOffset(fileName, span.start),
|
start: compilerService.host.positionToLineOffset(fileName, span.start),
|
||||||
end: compilerService.host.positionToLineOffset(fileName, ts.textSpanEnd(span))
|
end: compilerService.host.positionToLineOffset(fileName, ts.textSpanEnd(span))
|
||||||
})),
|
})),
|
||||||
childItems: this.decorateNavigationBarItem(project, fileName, item.childItems)
|
childItems: this.decorateNavigationBarItem(project, fileName, item.childItems),
|
||||||
|
indent: item.indent
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,8 @@ verify.navigationBar([
|
||||||
"text": "prop",
|
"text": "prop",
|
||||||
"kind": "property"
|
"kind": "property"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"indent": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "Shapes",
|
"text": "Shapes",
|
||||||
|
@ -100,7 +101,8 @@ verify.navigationBar([
|
||||||
"text": "Values",
|
"text": "Values",
|
||||||
"kind": "enum"
|
"kind": "enum"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"indent": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "Point",
|
"text": "Point",
|
||||||
|
@ -143,7 +145,8 @@ verify.navigationBar([
|
||||||
"kind": "property",
|
"kind": "property",
|
||||||
"kindModifiers": "public"
|
"kindModifiers": "public"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"indent": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "Values",
|
"text": "Values",
|
||||||
|
@ -161,6 +164,7 @@ verify.navigationBar([
|
||||||
"text": "value3",
|
"text": "value3",
|
||||||
"kind": "property"
|
"kind": "property"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"indent": 2
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue