Skip to content

Commit a7550db

Browse files
committed
CR feedback
1 parent 7067516 commit a7550db

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

src/server/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ module ts.server {
175175
getProjectInfo(fileName: string, needFileNameList: boolean): protocol.ProjectInfo {
176176
var args: protocol.ProjectInfoRequestArgs = {
177177
file: fileName,
178-
needFileNameList: !!needFileNameList
178+
needFileNameList: needFileNameList
179179
};
180180

181181
var request = this.processRequest<protocol.ProjectInfoRequest>(CommandNames.ProjectInfo, args);

src/server/protocol.d.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ declare module ts.server.protocol {
8888
}
8989

9090
/**
91-
* Arguments for ProjectInfoResponse messages.
91+
* Arguments for ProjectInfoRequest request.
9292
*/
9393
export interface ProjectInfoRequestArgs extends FileRequestArgs {
9494
/**
@@ -97,18 +97,31 @@ declare module ts.server.protocol {
9797
needFileNameList: boolean;
9898
}
9999

100+
/**
101+
* A request to get the project information of the current file
102+
*/
100103
export interface ProjectInfoRequest extends Request {
101104
arguments: ProjectInfoRequestArgs
102105
}
103106

104107
/**
105-
* Response message for "projectInfo" request
108+
* Response message body for "projectInfo" request
106109
*/
107110
export interface ProjectInfo {
111+
/**
112+
* For configured project, this is the normalized path of the 'tsconfig.json' file
113+
* For inferred project, this is undefined
114+
*/
108115
configFileName: string;
116+
/**
117+
* The list of normalized file name in the project, including 'lib.d.ts'
118+
*/
109119
fileNameList?: string[];
110120
}
111121

122+
/**
123+
* Response message for "projectInfo" request
124+
*/
112125
export interface ProjectInfoResponse extends Response {
113126
body?: ProjectInfo;
114127
}
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
/// <reference path="../fourslash.ts"/>
22

33
// @Filename: a.ts
4-
//// import test from "b"
4+
////export var test = "test String"
55

66
// @Filename: b.ts
7-
//// export var test = "test String"
7+
////import test from "a"
8+
9+
// @Filename: c.ts
10+
/////// <reference path="a.ts"/>
11+
/////// <reference path="b.ts"/>
12+
13+
// @Filename: d.ts
14+
////console.log("nothing");
815

916
goTo.file("a.ts")
10-
verify.ProjectInfo(["lib.d.ts", "b.ts", "a.ts"])
17+
verify.ProjectInfo(["lib.d.ts", "a.ts"])
18+
goTo.file("b.ts")
19+
verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts"])
20+
goTo.file("c.ts")
21+
verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts", "c.ts"])
22+
goTo.file("d.ts")
23+
verify.ProjectInfo(["lib.d.ts", "d.ts"])
24+

0 commit comments

Comments
 (0)