Add APIs to provide project info for a given file · magic-coder/TypeScript@c597bd6 · GitHub
Skip to content

Commit c597bd6

Browse files
author
Zhengbo Li
committed
Add APIs to provide project info for a given file
Return the path of the config file and the file name list of the project (optionally). This is helpful in differentiate the build command behavior for loose files and configured projects in sublime.
1 parent 57f3e04 commit c597bd6

3 files changed

Lines changed: 49 additions & 2 deletions

File tree

src/server/editorServices.ts

Lines changed: 5 additions & 0 deletions

src/server/protocol.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,28 @@ declare module ts.server.protocol {
8787
file: string;
8888
}
8989

90+
/**
91+
* Arguments for ProjectInfo messages.
92+
*/
93+
export interface ProjectInfoRequestArgs {
94+
/**
95+
* The file for the request (absolute pathname required).
96+
*/
97+
file: string;
98+
/**
99+
* Indicate if the file name list of the project is needed
100+
*/
101+
needFileNameList: boolean;
102+
}
103+
104+
/**
105+
* Response message for "projectInfo" request
106+
*/
107+
export interface ProjectInfo {
108+
configFileName: string;
109+
fileNameList?: string[];
110+
}
111+
90112
/**
91113
* Request whose sole parameter is a file name.
92114
*/

src/server/session.ts

Lines changed: 22 additions & 2 deletions

0 commit comments

Comments
 (0)