mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
CR feedback
This commit is contained in:
@@ -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);
|
||||
|
||||
17
src/server/protocol.d.ts
vendored
17
src/server/protocol.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user