CR feedback

This commit is contained in:
Zhengbo Li
2015-06-02 15:25:01 -07:00
parent 70675162dc
commit a7550dbba1
3 changed files with 33 additions and 6 deletions

View File

@@ -175,7 +175,7 @@ module ts.server {
getProjectInfo(fileName: string, needFileNameList: boolean): protocol.ProjectInfo {
var args: protocol.ProjectInfoRequestArgs = {
file: fileName,
needFileNameList: !!needFileNameList
needFileNameList: needFileNameList
};
var request = this.processRequest<protocol.ProjectInfoRequest>(CommandNames.ProjectInfo, args);

View File

@@ -88,7 +88,7 @@ declare module ts.server.protocol {
}
/**
* Arguments for ProjectInfoResponse messages.
* Arguments for ProjectInfoRequest request.
*/
export interface ProjectInfoRequestArgs extends FileRequestArgs {
/**
@@ -97,18 +97,31 @@ declare module ts.server.protocol {
needFileNameList: boolean;
}
/**
* A request to get the project information of the current file
*/
export interface ProjectInfoRequest extends Request {
arguments: ProjectInfoRequestArgs
}
/**
* Response message for "projectInfo" request
* Response message body for "projectInfo" request
*/
export interface ProjectInfo {
/**
* For configured project, this is the normalized path of the 'tsconfig.json' file
* For inferred project, this is undefined
*/
configFileName: string;
/**
* The list of normalized file name in the project, including 'lib.d.ts'
*/
fileNameList?: string[];
}
/**
* Response message for "projectInfo" request
*/
export interface ProjectInfoResponse extends Response {
body?: ProjectInfo;
}

View File

@@ -1,10 +1,24 @@
/// <reference path="../fourslash.ts"/>
// @Filename: a.ts
//// import test from "b"
////export var test = "test String"
// @Filename: b.ts
//// export var test = "test String"
////import test from "a"
// @Filename: c.ts
/////// <reference path="a.ts"/>
/////// <reference path="b.ts"/>
// @Filename: d.ts
////console.log("nothing");
goTo.file("a.ts")
verify.ProjectInfo(["lib.d.ts", "b.ts", "a.ts"])
verify.ProjectInfo(["lib.d.ts", "a.ts"])
goTo.file("b.ts")
verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts"])
goTo.file("c.ts")
verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts", "c.ts"])
goTo.file("d.ts")
verify.ProjectInfo(["lib.d.ts", "d.ts"])