Merge branch 'master' into map4

This commit is contained in:
Andy Hanson
2016-10-12 09:13:36 -07:00
55 changed files with 1785 additions and 140 deletions
+16
View File
@@ -2258,6 +2258,18 @@ namespace FourSlash {
}
}
public verifyNavigationTree(json: any) {
const tree = this.languageService.getNavigationTree(this.activeFile.fileName);
if (JSON.stringify(tree, replacer) !== JSON.stringify(json)) {
this.raiseError(`verifyNavigationTree failed - expected: ${stringify(json)}, got: ${stringify(tree, replacer)}`);
}
function replacer(key: string, value: any) {
// Don't check "spans", and omit falsy values.
return key === "spans" ? undefined : (value || undefined);
}
}
public printNavigationItems(searchValue: string) {
const items = this.languageService.getNavigateToItems(searchValue);
const length = items && items.length;
@@ -3346,6 +3358,10 @@ namespace FourSlashInterface {
this.state.verifyNavigationBar(json);
}
public navigationTree(json: any) {
this.state.verifyNavigationTree(json);
}
public navigationItemsListCount(count: number, searchValue: string, matchKind?: string, fileName?: string) {
this.state.verifyNavigationItemsCount(count, searchValue, matchKind, fileName);
}
+4
View File
@@ -459,6 +459,10 @@ namespace Harness.LanguageService {
getNavigationBarItems(fileName: string): ts.NavigationBarItem[] {
return unwrapJSONCallResult(this.shim.getNavigationBarItems(fileName));
}
getNavigationTree(fileName: string): ts.NavigationTree {
return unwrapJSONCallResult(this.shim.getNavigationTree(fileName));
}
getOutliningSpans(fileName: string): ts.OutliningSpan[] {
return unwrapJSONCallResult(this.shim.getOutliningSpans(fileName));
}
+27 -10
View File
@@ -512,7 +512,7 @@ namespace ts.server {
return this.lastRenameEntry.locations;
}
decodeNavigationBarItems(items: protocol.NavigationBarItem[], fileName: string, lineMap: number[]): NavigationBarItem[] {
private decodeNavigationBarItems(items: protocol.NavigationBarItem[], fileName: string, lineMap: number[]): NavigationBarItem[] {
if (!items) {
return [];
}
@@ -521,10 +521,7 @@ namespace ts.server {
text: item.text,
kind: item.kind,
kindModifiers: item.kindModifiers || "",
spans: item.spans.map(span =>
createTextSpanFromBounds(
this.lineOffsetToPosition(fileName, span.start, lineMap),
this.lineOffsetToPosition(fileName, span.end, lineMap))),
spans: item.spans.map(span => this.decodeSpan(span, fileName, lineMap)),
childItems: this.decodeNavigationBarItems(item.childItems, fileName, lineMap),
indent: item.indent,
bolded: false,
@@ -533,17 +530,37 @@ namespace ts.server {
}
getNavigationBarItems(fileName: string): NavigationBarItem[] {
const args: protocol.FileRequestArgs = {
file: fileName
};
const request = this.processRequest<protocol.NavBarRequest>(CommandNames.NavBar, args);
const request = this.processRequest<protocol.NavBarRequest>(CommandNames.NavBar, { file: fileName });
const response = this.processResponse<protocol.NavBarResponse>(request);
const lineMap = this.getLineMap(fileName);
return this.decodeNavigationBarItems(response.body, fileName, lineMap);
}
private decodeNavigationTree(tree: protocol.NavigationTree, fileName: string, lineMap: number[]): NavigationTree {
return {
text: tree.text,
kind: tree.kind,
kindModifiers: tree.kindModifiers,
spans: tree.spans.map(span => this.decodeSpan(span, fileName, lineMap)),
childItems: map(tree.childItems, item => this.decodeNavigationTree(item, fileName, lineMap))
};
}
getNavigationTree(fileName: string): NavigationTree {
const request = this.processRequest<protocol.NavTreeRequest>(CommandNames.NavTree, { file: fileName });
const response = this.processResponse<protocol.NavTreeResponse>(request);
const lineMap = this.getLineMap(fileName);
return this.decodeNavigationTree(response.body, fileName, lineMap);
}
private decodeSpan(span: protocol.TextSpan, fileName: string, lineMap: number[]) {
return createTextSpanFromBounds(
this.lineOffsetToPosition(fileName, span.start, lineMap),
this.lineOffsetToPosition(fileName, span.end, lineMap));
}
getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan {
throw new Error("Not Implemented Yet.");
}
+26 -6
View File
@@ -110,7 +110,7 @@ declare namespace ts.server.protocol {
*/
export interface TodoCommentRequestArgs extends FileRequestArgs {
/**
* Array of target TodoCommentDescriptors that describes TODO comments to be found
* Array of target TodoCommentDescriptors that describes TODO comments to be found
*/
descriptors: TodoCommentDescriptor[];
}
@@ -231,7 +231,7 @@ declare namespace ts.server.protocol {
offset?: number;
/**
* Position (can be specified instead of line/offset pair)
* Position (can be specified instead of line/offset pair)
*/
position?: number;
}
@@ -624,12 +624,12 @@ declare namespace ts.server.protocol {
/**
* Represents a file in external project.
* External project is project whose set of files, compilation options and open\close state
* External project is project whose set of files, compilation options and open\close state
* is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio).
* External project will exist even if all files in it are closed and should be closed explicity.
* If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
* If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will
* create configured project for every config file but will maintain a link that these projects were created
* as a result of opening external project so they should be removed once external project is closed.
* as a result of opening external project so they should be removed once external project is closed.
*/
export interface ExternalFile {
/**
@@ -1045,7 +1045,7 @@ declare namespace ts.server.protocol {
}
/**
* Response for CompileOnSaveAffectedFileListRequest request;
* Response for CompileOnSaveAffectedFileListRequest request;
*/
export interface CompileOnSaveAffectedFileListResponse extends Response {
body: CompileOnSaveAffectedFileListSingleProject[];
@@ -1812,6 +1812,13 @@ declare namespace ts.server.protocol {
export interface NavBarRequest extends FileRequest {
}
/**
* NavTree request; value of command field is "navtree".
* Return response giving the navigation tree of the requested file.
*/
export interface NavTreeRequest extends FileRequest {
}
export interface NavigationBarItem {
/**
* The item's display text.
@@ -1844,7 +1851,20 @@ declare namespace ts.server.protocol {
indent: number;
}
/** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
export interface NavigationTree {
text: string;
kind: string;
kindModifiers: string;
spans: TextSpan[];
childItems?: NavigationTree[];
}
export interface NavBarResponse extends Response {
body?: NavigationBarItem[];
}
export interface NavTreeResponse extends Response {
body?: NavigationTree;
}
}
+50 -41
View File
@@ -110,6 +110,8 @@ namespace ts.server {
export const SyntacticDiagnosticsSync = "syntacticDiagnosticsSync";
export const NavBar = "navbar";
export const NavBarFull = "navbar-full";
export const NavTree = "navtree";
export const NavTreeFull = "navtree-full";
export const Navto = "navto";
export const NavtoFull = "navto-full";
export const Occurrences = "occurrences";
@@ -960,15 +962,8 @@ namespace ts.server {
return completions.entries.reduce((result: protocol.CompletionEntry[], entry: ts.CompletionEntry) => {
if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) {
const { name, kind, kindModifiers, sortText, replacementSpan } = entry;
let convertedSpan: protocol.TextSpan = undefined;
if (replacementSpan) {
convertedSpan = {
start: scriptInfo.positionToLineOffset(replacementSpan.start),
end: scriptInfo.positionToLineOffset(replacementSpan.start + replacementSpan.length)
};
}
const convertedSpan: protocol.TextSpan =
replacementSpan ? this.decorateSpan(replacementSpan, scriptInfo) : undefined;
result.push({ name, kind, kindModifiers, sortText, replacementSpan: convertedSpan });
}
return result;
@@ -1106,22 +1101,13 @@ namespace ts.server {
this.projectService.closeClientFile(file);
}
private decorateNavigationBarItem(project: Project, fileName: NormalizedPath, items: ts.NavigationBarItem[]): protocol.NavigationBarItem[] {
if (!items) {
return undefined;
}
const scriptInfo = project.getScriptInfoForNormalizedPath(fileName);
return items.map(item => ({
private decorateNavigationBarItems(items: ts.NavigationBarItem[], scriptInfo: ScriptInfo): protocol.NavigationBarItem[] {
return map(items, item => ({
text: item.text,
kind: item.kind,
kindModifiers: item.kindModifiers,
spans: item.spans.map(span => ({
start: scriptInfo.positionToLineOffset(span.start),
end: scriptInfo.positionToLineOffset(ts.textSpanEnd(span))
})),
childItems: this.decorateNavigationBarItem(project, fileName, item.childItems),
spans: item.spans.map(span => this.decorateSpan(span, scriptInfo)),
childItems: this.decorateNavigationBarItems(item.childItems, scriptInfo),
indent: item.indent
}));
}
@@ -1129,15 +1115,40 @@ namespace ts.server {
private getNavigationBarItems(args: protocol.FileRequestArgs, simplifiedResult: boolean): protocol.NavigationBarItem[] | NavigationBarItem[] {
const { file, project } = this.getFileAndProject(args);
const items = project.getLanguageService(/*ensureSynchronized*/ false).getNavigationBarItems(file);
if (!items) {
return undefined;
}
return simplifiedResult
? this.decorateNavigationBarItem(project, file, items)
return !items
? undefined
: simplifiedResult
? this.decorateNavigationBarItems(items, project.getScriptInfoForNormalizedPath(file))
: items;
}
private decorateNavigationTree(tree: ts.NavigationTree, scriptInfo: ScriptInfo): protocol.NavigationTree {
return {
text: tree.text,
kind: tree.kind,
kindModifiers: tree.kindModifiers,
spans: tree.spans.map(span => this.decorateSpan(span, scriptInfo)),
childItems: map(tree.childItems, item => this.decorateNavigationTree(item, scriptInfo))
};
}
private decorateSpan(span: TextSpan, scriptInfo: ScriptInfo): protocol.TextSpan {
return {
start: scriptInfo.positionToLineOffset(span.start),
end: scriptInfo.positionToLineOffset(ts.textSpanEnd(span))
};
}
private getNavigationTree(args: protocol.FileRequestArgs, simplifiedResult: boolean): protocol.NavigationTree | NavigationTree {
const { file, project } = this.getFileAndProject(args);
const tree = project.getLanguageService(/*ensureSynchronized*/ false).getNavigationTree(file);
return !tree
? undefined
: simplifiedResult
? this.decorateNavigationTree(tree, project.getScriptInfoForNormalizedPath(file))
: tree;
}
private getNavigateToItems(args: protocol.NavtoRequestArgs, simplifiedResult: boolean): protocol.NavtoItem[] | NavigateToItem[] {
const projects = this.getProjects(args);
@@ -1274,19 +1285,11 @@ namespace ts.server {
const position = this.getPosition(args, scriptInfo);
const spans = project.getLanguageService(/*ensureSynchronized*/ false).getBraceMatchingAtPosition(file, position);
if (!spans) {
return undefined;
}
if (simplifiedResult) {
return spans.map(span => ({
start: scriptInfo.positionToLineOffset(span.start),
end: scriptInfo.positionToLineOffset(span.start + span.length)
}));
}
else {
return spans;
}
return !spans
? undefined
: simplifiedResult
? spans.map(span => this.decorateSpan(span, scriptInfo))
: spans;
}
getDiagnosticsForProject(delay: number, fileName: string) {
@@ -1571,6 +1574,12 @@ namespace ts.server {
[CommandNames.NavBarFull]: (request: protocol.FileRequest) => {
return this.requiredResponse(this.getNavigationBarItems(request.arguments, /*simplifiedResult*/ false));
},
[CommandNames.NavTree]: (request: protocol.FileRequest) => {
return this.requiredResponse(this.getNavigationTree(request.arguments, /*simplifiedResult*/ true));
},
[CommandNames.NavTreeFull]: (request: protocol.FileRequest) => {
return this.requiredResponse(this.getNavigationTree(request.arguments, /*simplifiedResult*/ false));
},
[CommandNames.Occurrences]: (request: protocol.FileLocationRequest) => {
return this.requiredResponse(this.getOccurrences(request.arguments));
},
+43 -42
View File
@@ -131,52 +131,53 @@ namespace ts.server {
return <NormalizedPath>fileName;
}
function throwLanguageServiceIsDisabledError() {
function throwLanguageServiceIsDisabledError(): never {
throw new Error("LanguageService is disabled");
}
export const nullLanguageService: LanguageService = {
cleanupSemanticCache: (): any => throwLanguageServiceIsDisabledError(),
getSyntacticDiagnostics: (): any => throwLanguageServiceIsDisabledError(),
getSemanticDiagnostics: (): any => throwLanguageServiceIsDisabledError(),
getCompilerOptionsDiagnostics: (): any => throwLanguageServiceIsDisabledError(),
getSyntacticClassifications: (): any => throwLanguageServiceIsDisabledError(),
getEncodedSyntacticClassifications: (): any => throwLanguageServiceIsDisabledError(),
getSemanticClassifications: (): any => throwLanguageServiceIsDisabledError(),
getEncodedSemanticClassifications: (): any => throwLanguageServiceIsDisabledError(),
getCompletionsAtPosition: (): any => throwLanguageServiceIsDisabledError(),
findReferences: (): any => throwLanguageServiceIsDisabledError(),
getCompletionEntryDetails: (): any => throwLanguageServiceIsDisabledError(),
getQuickInfoAtPosition: (): any => throwLanguageServiceIsDisabledError(),
findRenameLocations: (): any => throwLanguageServiceIsDisabledError(),
getNameOrDottedNameSpan: (): any => throwLanguageServiceIsDisabledError(),
getBreakpointStatementAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getBraceMatchingAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getSignatureHelpItems: (): any => throwLanguageServiceIsDisabledError(),
getDefinitionAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getRenameInfo: (): any => throwLanguageServiceIsDisabledError(),
getTypeDefinitionAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getReferencesAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getDocumentHighlights: (): any => throwLanguageServiceIsDisabledError(),
getOccurrencesAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getNavigateToItems: (): any => throwLanguageServiceIsDisabledError(),
getNavigationBarItems: (): any => throwLanguageServiceIsDisabledError(),
getOutliningSpans: (): any => throwLanguageServiceIsDisabledError(),
getTodoComments: (): any => throwLanguageServiceIsDisabledError(),
getIndentationAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getFormattingEditsForRange: (): any => throwLanguageServiceIsDisabledError(),
getFormattingEditsForDocument: (): any => throwLanguageServiceIsDisabledError(),
getFormattingEditsAfterKeystroke: (): any => throwLanguageServiceIsDisabledError(),
getDocCommentTemplateAtPosition: (): any => throwLanguageServiceIsDisabledError(),
isValidBraceCompletionAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getEmitOutput: (): any => throwLanguageServiceIsDisabledError(),
getProgram: (): any => throwLanguageServiceIsDisabledError(),
getNonBoundSourceFile: (): any => throwLanguageServiceIsDisabledError(),
dispose: (): any => throwLanguageServiceIsDisabledError(),
getCompletionEntrySymbol: (): any => throwLanguageServiceIsDisabledError(),
getImplementationAtPosition: (): any => throwLanguageServiceIsDisabledError(),
getSourceFile: (): any => throwLanguageServiceIsDisabledError(),
getCodeFixesAtPosition: (): any => throwLanguageServiceIsDisabledError()
cleanupSemanticCache: throwLanguageServiceIsDisabledError,
getSyntacticDiagnostics: throwLanguageServiceIsDisabledError,
getSemanticDiagnostics: throwLanguageServiceIsDisabledError,
getCompilerOptionsDiagnostics: throwLanguageServiceIsDisabledError,
getSyntacticClassifications: throwLanguageServiceIsDisabledError,
getEncodedSyntacticClassifications: throwLanguageServiceIsDisabledError,
getSemanticClassifications: throwLanguageServiceIsDisabledError,
getEncodedSemanticClassifications: throwLanguageServiceIsDisabledError,
getCompletionsAtPosition: throwLanguageServiceIsDisabledError,
findReferences: throwLanguageServiceIsDisabledError,
getCompletionEntryDetails: throwLanguageServiceIsDisabledError,
getQuickInfoAtPosition: throwLanguageServiceIsDisabledError,
findRenameLocations: throwLanguageServiceIsDisabledError,
getNameOrDottedNameSpan: throwLanguageServiceIsDisabledError,
getBreakpointStatementAtPosition: throwLanguageServiceIsDisabledError,
getBraceMatchingAtPosition: throwLanguageServiceIsDisabledError,
getSignatureHelpItems: throwLanguageServiceIsDisabledError,
getDefinitionAtPosition: throwLanguageServiceIsDisabledError,
getRenameInfo: throwLanguageServiceIsDisabledError,
getTypeDefinitionAtPosition: throwLanguageServiceIsDisabledError,
getReferencesAtPosition: throwLanguageServiceIsDisabledError,
getDocumentHighlights: throwLanguageServiceIsDisabledError,
getOccurrencesAtPosition: throwLanguageServiceIsDisabledError,
getNavigateToItems: throwLanguageServiceIsDisabledError,
getNavigationBarItems: throwLanguageServiceIsDisabledError,
getNavigationTree: throwLanguageServiceIsDisabledError,
getOutliningSpans: throwLanguageServiceIsDisabledError,
getTodoComments: throwLanguageServiceIsDisabledError,
getIndentationAtPosition: throwLanguageServiceIsDisabledError,
getFormattingEditsForRange: throwLanguageServiceIsDisabledError,
getFormattingEditsForDocument: throwLanguageServiceIsDisabledError,
getFormattingEditsAfterKeystroke: throwLanguageServiceIsDisabledError,
getDocCommentTemplateAtPosition: throwLanguageServiceIsDisabledError,
isValidBraceCompletionAtPosition: throwLanguageServiceIsDisabledError,
getEmitOutput: throwLanguageServiceIsDisabledError,
getProgram: throwLanguageServiceIsDisabledError,
getNonBoundSourceFile: throwLanguageServiceIsDisabledError,
dispose: throwLanguageServiceIsDisabledError,
getCompletionEntrySymbol: throwLanguageServiceIsDisabledError,
getImplementationAtPosition: throwLanguageServiceIsDisabledError,
getSourceFile: throwLanguageServiceIsDisabledError,
getCodeFixesAtPosition: throwLanguageServiceIsDisabledError
};
export interface ServerLanguageServiceHost {
+24 -7
View File
@@ -21,6 +21,13 @@ namespace ts.NavigationBar {
return result;
}
export function getNavigationTree(sourceFile: SourceFile): NavigationTree {
curSourceFile = sourceFile;
const result = convertToTree(rootNavigationBarNode(sourceFile));
curSourceFile = undefined;
return result;
}
// Keep sourceFile handy so we don't have to search for it every time we need to call `getText`.
let curSourceFile: SourceFile;
function nodeText(node: Node): string {
@@ -502,6 +509,16 @@ namespace ts.NavigationBar {
// NavigationBarItem requires an array, but will not mutate it, so just give it this for performance.
const emptyChildItemArray: NavigationBarItem[] = [];
function convertToTree(n: NavigationBarNode): NavigationTree {
return {
text: getItemName(n.node),
kind: getNodeKind(n.node),
kindModifiers: getNodeModifiers(n.node),
spans: getSpans(n),
childItems: map(n.children, convertToTree)
};
}
function convertToTopLevelItem(n: NavigationBarNode): NavigationBarItem {
return {
text: getItemName(n.node),
@@ -526,16 +543,16 @@ namespace ts.NavigationBar {
grayed: false
};
}
}
function getSpans(n: NavigationBarNode): TextSpan[] {
const spans = [getNodeSpan(n.node)];
if (n.additionalNodes) {
for (const node of n.additionalNodes) {
spans.push(getNodeSpan(node));
}
function getSpans(n: NavigationBarNode): TextSpan[] {
const spans = [getNodeSpan(n.node)];
if (n.additionalNodes) {
for (const node of n.additionalNodes) {
spans.push(getNodeSpan(node));
}
return spans;
}
return spans;
}
function getModuleName(moduleDeclaration: ModuleDeclaration): string {
+5 -2
View File
@@ -1523,9 +1523,11 @@ namespace ts {
}
function getNavigationBarItems(fileName: string): NavigationBarItem[] {
const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
return NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName));
}
return NavigationBar.getNavigationBarItems(sourceFile);
function getNavigationTree(fileName: string): NavigationTree {
return NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName));
}
function isTsOrTsxFile(fileName: string): boolean {
@@ -1903,6 +1905,7 @@ namespace ts {
getRenameInfo,
findRenameLocations,
getNavigationBarItems,
getNavigationTree,
getOutliningSpans,
getTodoComments,
getBraceMatchingAtPosition,
+10
View File
@@ -224,6 +224,9 @@ namespace ts {
*/
getNavigationBarItems(fileName: string): string;
/** Returns a JSON-encoded value of the type ts.NavigationTree. */
getNavigationTree(fileName: string): string;
/**
* Returns a JSON-encoded value of the type:
* { textSpan: { start: number, length: number }; hintSpan: { start: number, length: number }; bannerText: string; autoCollapse: boolean } [] = [];
@@ -971,6 +974,13 @@ namespace ts {
);
}
public getNavigationTree(fileName: string): string {
return this.forwardJSONCall(
`getNavigationTree('${fileName}')`,
() => this.languageService.getNavigationTree(fileName)
);
}
public getOutliningSpans(fileName: string): string {
return this.forwardJSONCall(
`getOutliningSpans('${fileName}')`,
+27
View File
@@ -225,6 +225,7 @@ namespace ts {
getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean): NavigateToItem[];
getNavigationBarItems(fileName: string): NavigationBarItem[];
getNavigationTree(fileName: string): NavigationTree;
getOutliningSpans(fileName: string): OutliningSpan[];
getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[];
@@ -266,6 +267,12 @@ namespace ts {
classificationType: string; // ClassificationTypeNames
}
/**
* Navigation bar interface designed for visual studio's dual-column layout.
* This does not form a proper tree.
* The navbar is returned as a list of top-level items, each of which has a list of child items.
* Child items always have an empty array for their `childItems`.
*/
export interface NavigationBarItem {
text: string;
kind: string;
@@ -277,6 +284,26 @@ namespace ts {
grayed: boolean;
}
/**
* Node in a tree of nested declarations in a file.
* The top node is always a script or module node.
*/
export interface NavigationTree {
/** Name of the declaration, or a short description, e.g. "<class>". */
text: string;
/** A ScriptElementKind */
kind: string;
/** ScriptElementKindModifier separated by commas, e.g. "public,abstract" */
kindModifiers: string;
/**
* Spans of the nodes that generated this declaration.
* There will be more than one if this is the result of merging.
*/
spans: TextSpan[];
/** Present if non-empty */
childItems?: NavigationTree[];
}
export interface TodoCommentDescriptor {
text: string;
priority: number;
@@ -5,6 +5,32 @@
goTo.marker();
edit.deleteAtCaret('class Bar { }'.length);
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "Foo",
"kind": "enum",
"childItems": [
{
"text": "a",
"kind": "const"
},
{
"text": "b",
"kind": "const"
},
{
"text": "c",
"kind": "const"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
+1
View File
@@ -212,6 +212,7 @@ declare namespace FourSlashInterface {
codeFixAtPosition(expectedText: string, errorCode?: number): void;
navigationBar(json: any): void;
navigationTree(json: any): void;
navigationItemsListCount(count: number, searchValue: string, matchKind?: string, fileName?: string): void;
navigationItemsListContains(name: string, kind: string, searchValue: string, matchKind: string, fileName?: string, parentName?: string): void;
occurrencesAtPositionContains(range: Range, isWriteAccess?: boolean): void;
+22 -1
View File
@@ -5,6 +5,27 @@
//// ["bar"]: string;
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "C",
"kind": "class",
"childItems": [
{
"text": "[\"bar\"]",
"kind": "property"
},
{
"text": "foo",
"kind": "property"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -31,4 +52,4 @@ verify.navigationBar([
],
"indent": 1
}
])
]);
+11
View File
@@ -2,6 +2,17 @@
//// const c = 0;
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "c",
"kind": "const"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -27,6 +27,83 @@
//// export var x = 3;
//// }
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "ABC",
"kind": "class",
"childItems": [
{
"text": "foo",
"kind": "method",
"kindModifiers": "public"
}
]
},
{
"text": "ABC",
"kind": "module",
"childItems": [
{
"text": "x",
"kind": "var",
"kindModifiers": "export"
}
]
},
{
"text": "Windows",
"kind": "module",
"kindModifiers": "declare",
"childItems": [
{
"text": "Foundation",
"kind": "module",
"kindModifiers": "export,declare",
"childItems": [
{
"text": "A",
"kind": "var",
"kindModifiers": "export,declare"
},
{
"text": "B",
"kind": "var",
"kindModifiers": "export,declare"
},
{
"text": "Test",
"kind": "class",
"kindModifiers": "export,declare",
"childItems": [
{
"text": "wow",
"kind": "method",
"kindModifiers": "public,declare"
}
]
},
{
"text": "Test",
"kind": "module",
"kindModifiers": "export,declare",
"childItems": [
{
"text": "Boom",
"kind": "function",
"kindModifiers": "export,declare"
}
]
}
]
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -13,6 +13,17 @@
////export default function Func { }
goTo.file("a.ts");
verify.navigationTree({
"text": "\"a\"",
"kind": "module",
"childItems": [
{
"text": "default",
"kind": "class",
"kindModifiers": "export"
}
]
});
verify.navigationBar([
{
"text": "\"a\"",
@@ -34,6 +45,17 @@ verify.navigationBar([
]);
goTo.file("b.ts");
verify.navigationTree({
"text": "\"b\"",
"kind": "module",
"childItems": [
{
"text": "C",
"kind": "class",
"kindModifiers": "export"
}
]
});
verify.navigationBar([
{
"text": "\"b\"",
@@ -55,6 +77,17 @@ verify.navigationBar([
]);
goTo.file("c.ts");
verify.navigationTree({
"text": "\"c\"",
"kind": "module",
"childItems": [
{
"text": "default",
"kind": "function",
"kindModifiers": "export"
}
]
});
verify.navigationBar([
{
"text": "\"c\"",
@@ -76,6 +109,17 @@ verify.navigationBar([
]);
goTo.file("d.ts");
verify.navigationTree({
"text": "\"d\"",
"kind": "module",
"childItems": [
{
"text": "Func",
"kind": "function",
"kindModifiers": "export"
}
]
});
verify.navigationBar([
{
"text": "\"d\"",
+11
View File
@@ -2,6 +2,17 @@
////let c = 0;
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "c",
"kind": "let"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -26,6 +26,85 @@
//// (class { });
////})
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "<function>",
"kind": "function",
"childItems": [
{
"text": "nest",
"kind": "function",
"childItems": [
{
"text": "moreNest",
"kind": "function"
}
]
},
{
"text": "x",
"kind": "function",
"childItems": [
{
"text": "xx",
"kind": "function"
}
]
},
{
"text": "y",
"kind": "const",
"childItems": [
{
"text": "foo",
"kind": "function"
}
]
}
]
},
{
"text": "<function>",
"kind": "function",
"childItems": [
{
"text": "<function>",
"kind": "function"
},
{
"text": "z",
"kind": "function"
}
]
},
{
"text": "classes",
"kind": "function",
"childItems": [
{
"text": "<class>",
"kind": "class"
},
{
"text": "cls2",
"kind": "class"
},
{
"text": "cls3",
"kind": "class"
}
]
},
{
"text": "global.cls",
"kind": "class"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -3,6 +3,39 @@
////console.log(console.log(class Y {}, class X {}), console.log(class B {}, class A {}));
////console.log(class Cls { meth() {} });
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "A",
"kind": "class"
},
{
"text": "B",
"kind": "class"
},
{
"text": "Cls",
"kind": "class",
"childItems": [
{
"text": "meth",
"kind": "method"
}
]
},
{
"text": "X",
"kind": "class"
},
{
"text": "Y",
"kind": "class"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -8,39 +8,64 @@
//// propB: function() {}
////};
verify.navigationBar([
{
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "a",
"kind": "var"
},
{
"text": "b",
"kind": "var"
},
{
"text": "propB",
"kind": "function"
}
{
"text": "a",
"kind": "var",
"childItems": [
{
"text": "propA",
"kind": "function"
}
]
},
{
"text": "b",
"kind": "var"
},
{
"text": "propB",
"kind": "function"
}
]
},
{
"text": "a",
"kind": "var",
"childItems": [
{
"text": "propA",
"kind": "function"
}
],
"indent": 1
},
{
"text": "propB",
"kind": "function",
"indent": 1
}
});
verify.navigationBar([
{
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "a",
"kind": "var"
},
{
"text": "b",
"kind": "var"
},
{
"text": "propB",
"kind": "function"
}
]
},
{
"text": "a",
"kind": "var",
"childItems": [
{
"text": "propA",
"kind": "function"
}
],
"indent": 1
},
{
"text": "propB",
"kind": "function",
"indent": 1
}
]);
@@ -8,6 +8,33 @@
//// }
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "X",
"kind": "class",
"childItems": [
{
"text": "x",
"kind": "getter"
},
{
"text": "x",
"kind": "setter",
"childItems": [
{
"text": "f",
"kind": "function"
}
]
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -4,6 +4,29 @@
////import c = require("m");
////import * as d from "m";
verify.navigationTree({
"text": "\"navigationBarImports\"",
"kind": "module",
"childItems": [
{
"text": "a",
"kind": "alias"
},
{
"text": "b",
"kind": "alias"
},
{
"text": "c",
"kind": "alias"
},
{
"text": "d",
"kind": "alias"
}
]
});
verify.navigationBar([
{
"text": "\"navigationBarImports\"",
@@ -6,6 +6,57 @@
////const bar1, [c, d]
////var {e, x: [f, g]} = {a:1, x:[]};
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "a",
"kind": "let"
},
{
"text": "b",
"kind": "let"
},
{
"text": "bar",
"kind": "var"
},
{
"text": "bar1",
"kind": "const"
},
{
"text": "c",
"kind": "const"
},
{
"text": "d",
"kind": "const"
},
{
"text": "e",
"kind": "var"
},
{
"text": "f",
"kind": "var"
},
{
"text": "foo",
"kind": "var"
},
{
"text": "foo1",
"kind": "let"
},
{
"text": "g",
"kind": "var"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -11,6 +11,41 @@
//// }
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "A",
"kind": "class",
"childItems": [
{
"text": "constructor",
"kind": "constructor"
},
{
"text": "x",
"kind": "property"
}
]
},
{
"text": "B",
"kind": "class",
"childItems": [
{
"text": "constructor",
"kind": "constructor"
},
{
"text": "x",
"kind": "property"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -5,6 +5,23 @@
//// }
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "Test",
"kind": "class",
"childItems": [
{
"text": "constructor",
"kind": "constructor"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -9,6 +9,26 @@
////
////export * from "a"; // no bindings here
verify.navigationTree({
"text": "\"navigationBarItemsExports\"",
"kind": "module",
"childItems": [
{
"text": "a",
"kind": "alias"
},
{
"text": "B",
"kind": "alias"
},
{
"text": "e",
"kind": "alias",
"kindModifiers": "export"
}
]
});
verify.navigationBar([
{
"text": "\"navigationBarItemsExports\"",
@@ -14,6 +14,53 @@
//// var v = 10;
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "baz",
"kind": "function",
"childItems": [
{
"text": "v",
"kind": "var"
}
]
},
{
"text": "foo",
"kind": "function",
"childItems": [
{
"text": "bar",
"kind": "function",
"childItems": [
{
"text": "biz",
"kind": "function",
"childItems": [
{
"text": "z",
"kind": "var"
}
]
},
{
"text": "y",
"kind": "var"
}
]
},
{
"text": "x",
"kind": "var"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -4,6 +4,23 @@
//// function;
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "f",
"kind": "function",
"childItems": [
{
"text": "<function>",
"kind": "function"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -5,6 +5,27 @@
//// function;
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "<function>",
"kind": "function"
},
{
"text": "f",
"kind": "function",
"childItems": [
{
"text": "<function>",
"kind": "function"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -13,6 +13,44 @@
////
////import * as ns from "a";
verify.navigationTree({
"text": "\"navigationBarItemsImports\"",
"kind": "module",
"childItems": [
{
"text": "a",
"kind": "alias"
},
{
"text": "B",
"kind": "alias"
},
{
"text": "c",
"kind": "alias"
},
{
"text": "D",
"kind": "alias"
},
{
"text": "d1",
"kind": "alias"
},
{
"text": "d2",
"kind": "alias"
},
{
"text": "e",
"kind": "alias"
},
{
"text": "ns",
"kind": "alias"
}
]
});
verify.navigationBar([
{
@@ -18,6 +18,77 @@
//// emptyMethod() { } // Non child functions method should not be duplicated
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "Class",
"kind": "class",
"childItems": [
{
"text": "constructor",
"kind": "constructor",
"childItems": [
{
"text": "LocalEnumInConstructor",
"kind": "enum",
"childItems": [
{
"text": "LocalEnumMemberInConstructor",
"kind": "const"
}
]
},
{
"text": "LocalFunctionInConstructor",
"kind": "function"
},
{
"text": "LocalInterfaceInConstrcutor",
"kind": "interface"
}
]
},
{
"text": "emptyMethod",
"kind": "method"
},
{
"text": "method",
"kind": "method",
"childItems": [
{
"text": "LocalEnumInMethod",
"kind": "enum",
"childItems": [
{
"text": "LocalEnumMemberInMethod",
"kind": "const"
}
]
},
{
"text": "LocalFunctionInMethod",
"kind": "function",
"childItems": [
{
"text": "LocalFunctionInLocalFunctionInMethod",
"kind": "function"
}
]
},
{
"text": "LocalInterfaceInMethod",
"kind": "interface"
}
]
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -39,6 +39,114 @@
////var p: IPoint = new Shapes.Point(3, 4);
////var dist = p.getDist();
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "dist",
"kind": "var"
},
{
"text": "IPoint",
"kind": "interface",
"childItems": [
{
"text": "()",
"kind": "call"
},
{
"text": "new()",
"kind": "construct"
},
{
"text": "[]",
"kind": "index"
},
{
"text": "getDist",
"kind": "method"
},
{
"text": "prop",
"kind": "property"
}
]
},
{
"text": "p",
"kind": "var"
},
{
"text": "Shapes",
"kind": "module",
"childItems": [
{
"text": "Point",
"kind": "class",
"kindModifiers": "export",
"childItems": [
{
"text": "constructor",
"kind": "constructor"
},
{
"text": "getDist",
"kind": "method"
},
{
"text": "getOrigin",
"kind": "method",
"kindModifiers": "private,static"
},
{
"text": "origin",
"kind": "property",
"kindModifiers": "static"
},
{
"text": "value",
"kind": "getter"
},
{
"text": "value",
"kind": "setter"
},
{
"text": "x",
"kind": "property",
"kindModifiers": "public"
},
{
"text": "y",
"kind": "property",
"kindModifiers": "public"
}
]
},
{
"text": "Values",
"kind": "enum",
"childItems": [
{
"text": "value1",
"kind": "const"
},
{
"text": "value2",
"kind": "const"
},
{
"text": "value3",
"kind": "const"
}
]
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -6,6 +6,22 @@ goTo.marker();
edit.insertLine("module A");
edit.insert("export class ");
verify.navigationTree({
"text": "\"navigationBarItemsItems2\"",
"kind": "module",
"childItems": [
{
"text": "<class>",
"kind": "class",
"kindModifiers": "export"
},
{
"text": "A",
"kind": "module"
}
]
});
// should not crash
verify.navigationBar([
{
@@ -4,6 +4,25 @@
//// public s: string;
////}
verify.navigationTree({
"text": "\"navigationBarItemsItemsExternalModules\"",
"kind": "module",
"childItems": [
{
"text": "Bar",
"kind": "class",
"kindModifiers": "export",
"childItems": [
{
"text": "s",
"kind": "property",
"kindModifiers": "public"
}
]
}
]
});
verify.navigationBar([
{
"text": "\"navigationBarItemsItemsExternalModules\"",
@@ -6,6 +6,30 @@
////}
////export var x: number;
verify.navigationTree({
"text": "\"file\"",
"kind": "module",
"childItems": [
{
"text": "Bar",
"kind": "class",
"kindModifiers": "export",
"childItems": [
{
"text": "s",
"kind": "property",
"kindModifiers": "public"
}
]
},
{
"text": "x",
"kind": "var",
"kindModifiers": "export"
}
]
});
verify.navigationBar([
{
"text": "\"file\"",
@@ -6,6 +6,30 @@
////}
////export var x: number;
verify.navigationTree({
"text": "\"my fil\\\"e\"",
"kind": "module",
"childItems": [
{
"text": "Bar",
"kind": "class",
"kindModifiers": "export",
"childItems": [
{
"text": "s",
"kind": "property",
"kindModifiers": "public"
}
]
},
{
"text": "x",
"kind": "var",
"kindModifiers": "export"
}
]
});
verify.navigationBar([
{
"text": "\"my fil\\\"e\"",
@@ -20,6 +20,23 @@
////}
goTo.marker("file1");
// nothing else should show up
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "Module1",
"kind": "module",
"childItems": [
{
"text": "x",
"kind": "var",
"kindModifiers": "export"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -46,6 +63,23 @@ verify.navigationBar([
]);
goTo.marker("file2");
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "Module1.SubModule",
"kind": "module",
"childItems": [
{
"text": "y",
"kind": "var",
"kindModifiers": "export"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -3,6 +3,28 @@
//// foo() {}
////}
verify.navigationTree({
"text": "\"navigationBarItemsMissingName1\"",
"kind": "module",
"childItems": [
{
"text": "<function>",
"kind": "function",
"kindModifiers": "export"
},
{
"text": "C",
"kind": "class",
"childItems": [
{
"text": "foo",
"kind": "method"
}
]
}
]
});
verify.navigationBar([
{
"text": "\"navigationBarItemsMissingName1\"",
@@ -6,6 +6,23 @@
////}
// Anonymous classes are still included.
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "<class>",
"kind": "class",
"childItems": [
{
"text": "foo",
"kind": "method"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -27,6 +27,73 @@
//We have 8 module keywords, and 4 var keywords.
//The declarations of A.B.C.x do not get merged, so the 4 vars are independent.
//The two 'A' modules, however, do get merged, so in reality we have 7 modules.
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "'X2.Y2.Z2'",
"kind": "module",
"kindModifiers": "declare"
},
{
"text": "\"X.Y.Z\"",
"kind": "module",
"kindModifiers": "declare"
},
{
"text": "A",
"kind": "module",
"childItems": [
{
"text": "B",
"kind": "module",
"childItems": [
{
"text": "C",
"kind": "module",
"childItems": [
{
"text": "x",
"kind": "var",
"kindModifiers": "declare"
}
]
}
]
},
{
"text": "z",
"kind": "var",
"kindModifiers": "export"
}
]
},
{
"text": "A.B",
"kind": "module",
"childItems": [
{
"text": "y",
"kind": "var",
"kindModifiers": "export"
}
]
},
{
"text": "A.B.C",
"kind": "module",
"childItems": [
{
"text": "x",
"kind": "var",
"kindModifiers": "export"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -24,6 +24,56 @@
//// }
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "\"Multiline\\\nMadness\"",
"kind": "module",
"kindModifiers": "declare"
},
{
"text": "\"Multiline\\r\\nMadness\"",
"kind": "module",
"kindModifiers": "declare"
},
{
"text": "\"MultilineMadness\"",
"kind": "module",
"kindModifiers": "declare"
},
{
"text": "Bar",
"kind": "class",
"childItems": [
{
"text": "'a1\\\\\\r\\nb'",
"kind": "property"
},
{
"text": "'a2\\\n \\\n b'",
"kind": "method"
}
]
},
{
"text": "Foo",
"kind": "interface",
"childItems": [
{
"text": "\"a1\\\\\\r\\nb\"",
"kind": "property"
},
{
"text": "\"a2\\\n \\\n b\"",
"kind": "method"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -6,6 +6,43 @@
//// }
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "List",
"kind": "class",
"childItems": [
{
"text": "constructor",
"kind": "constructor",
"childItems": [
{
"text": "local",
"kind": "var"
}
]
},
{
"text": "a",
"kind": "property",
"kindModifiers": "public"
},
{
"text": "b",
"kind": "property",
"kindModifiers": "private"
},
{
"text": "c",
"kind": "property"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -6,6 +6,31 @@
//// get [Symbol.isConcatSpreadable]() { }
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "C",
"kind": "class",
"childItems": [
{
"text": "[Symbol.isConcatSpreadable]",
"kind": "getter"
},
{
"text": "[Symbol.isRegExp]",
"kind": "property"
},
{
"text": "[Symbol.iterator]",
"kind": "method"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -5,6 +5,27 @@
//// [Symbol.iterator](): string;
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "I",
"kind": "interface",
"childItems": [
{
"text": "[Symbol.isRegExp]",
"kind": "property"
},
{
"text": "[Symbol.iterator]",
"kind": "method"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -5,6 +5,17 @@
//// [Symbol.isRegExp] = 0
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "E",
"kind": "enum"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -2,6 +2,17 @@
////type T = number | string;
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "T",
"kind": "type"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -5,6 +5,25 @@
/////** @typedef {(string|number)} */
////const x = 0;
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "NumberLike",
"kind": "type"
},
{
"text": "x",
"kind": "const"
},
{
"text": "x",
"kind": "type"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -3,6 +3,18 @@
/////** Test */
////export const Test = {}
verify.navigationTree({
"text": "\"navigationBarJsDocCommentWithNoTags\"",
"kind": "module",
"childItems": [
{
"text": "Test",
"kind": "const",
"kindModifiers": "export"
}
]
});
verify.navigationBar([
{
"text": "\"navigationBarJsDocCommentWithNoTags\"",
@@ -11,6 +11,37 @@
//// function bar() {}
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "a",
"kind": "module",
"childItems": [
{
"text": "bar",
"kind": "function"
},
{
"text": "foo",
"kind": "function"
}
]
},
{
"text": "b",
"kind": "module",
"childItems": [
{
"text": "foo",
"kind": "function"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -60,6 +91,22 @@ verify.navigationBar([
////function a() {}
goTo.file("file2.ts");
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "a",
"kind": "function"
},
{
"text": "a",
"kind": "module"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -101,6 +148,34 @@ verify.navigationBar([
////}
goTo.file("file3.ts");
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "a",
"kind": "module",
"childItems": [
{
"text": "A",
"kind": "interface",
"childItems": [
{
"text": "bar",
"kind": "property"
},
{
"text": "foo",
"kind": "property"
}
]
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -147,6 +222,36 @@ verify.navigationBar([
////module A.B { export var y; }
goTo.file("file4.ts");
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "A",
"kind": "module",
"childItems": [
{
"text": "x",
"kind": "var",
"kindModifiers": "export"
}
]
},
{
"text": "A.B",
"kind": "module",
"childItems": [
{
"text": "y",
"kind": "var",
"kindModifiers": "export"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -1,4 +1,16 @@
////import *{} from 'foo';
verify.navigationTree({
"text": "\"navigationBarNamespaceImportWithNoName\"",
"kind": "module",
"childItems": [
{
"text": "<unknown>",
"kind": "alias"
}
]
});
verify.navigationBar([
{
"text": "\"navigationBarNamespaceImportWithNoName\"",
@@ -4,6 +4,25 @@
////let y = 1;
////const z = 2;
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "x",
"kind": "var"
},
{
"text": "y",
"kind": "let"
},
{
"text": "z",
"kind": "const"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -31,6 +50,26 @@ verify.navigationBar([
////const [c] = 0;
goTo.file("file2.ts");
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "a",
"kind": "var"
},
{
"text": "b",
"kind": "let"
},
{
"text": "c",
"kind": "const"
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -10,6 +10,29 @@
//// /** @type {/*1*/NumberLike} */
//// var numberLike;
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "numberLike",
"kind": "var"
},
{
"text": "NumberLike",
"kind": "type"
},
{
"text": "NumberLike2",
"kind": "var"
},
{
"text": "NumberLike2",
"kind": "type"
}
]
});
verify.navigationBar([
{
"text": "<global>",
+108
View File
@@ -38,6 +38,114 @@
////var p: IPoint = new Shapes.Point(3, 4);
////var dist = p.getDist();
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "dist",
"kind": "var"
},
{
"text": "IPoint",
"kind": "interface",
"childItems": [
{
"text": "()",
"kind": "call"
},
{
"text": "new()",
"kind": "construct"
},
{
"text": "[]",
"kind": "index"
},
{
"text": "getDist",
"kind": "method"
},
{
"text": "prop",
"kind": "property"
}
]
},
{
"text": "p",
"kind": "var"
},
{
"text": "Shapes",
"kind": "module",
"childItems": [
{
"text": "Point",
"kind": "class",
"kindModifiers": "export",
"childItems": [
{
"text": "constructor",
"kind": "constructor"
},
{
"text": "getDist",
"kind": "method"
},
{
"text": "getOrigin",
"kind": "method",
"kindModifiers": "private,static"
},
{
"text": "origin",
"kind": "property",
"kindModifiers": "static"
},
{
"text": "value",
"kind": "getter"
},
{
"text": "value",
"kind": "setter"
},
{
"text": "x",
"kind": "property",
"kindModifiers": "public"
},
{
"text": "y",
"kind": "property",
"kindModifiers": "public"
}
]
},
{
"text": "Values",
"kind": "enum",
"childItems": [
{
"text": "value1",
"kind": "const"
},
{
"text": "value2",
"kind": "const"
},
{
"text": "value3",
"kind": "const"
}
]
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
@@ -2,6 +2,17 @@
//// {| "itemName": "c", "kind": "const", "parentName": "" |}const c = 0;
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "c",
"kind": "const"
}
]
})
verify.navigationBar([
{
"text": "<global>",
@@ -2,6 +2,17 @@
//// {| "itemName": "c", "kind": "const", "parentName": "" |}const c = 0;
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "c",
"kind": "const"
}
]
})
verify.navigationBar([
{
"text": "<global>",