@@ -3301,6 +3301,23 @@ namespace ts.projectSystem {
3301
3301
});
3302
3302
});
3303
3303
3304
+ it("dynamic file with reference paths external project", () => {
3305
+ const file: File = {
3306
+ path: "^walkThroughSnippet:/Users/UserName/projects/someProject/out/someFile#1.js",
3307
+ content: `/// <reference path="../../../../../../typings/@epic/Core.d.ts" />
3308
+ /// <reference path="../../../../../../typings/@epic/Shell.d.ts" />
3309
+ var x = 10;`
3310
+ };
3311
+ const host = createServerHost([libFile]);
3312
+ const projectService = createProjectService(host);
3313
+ projectService.openClientFile(file.path, file.content);
3314
+
3315
+ projectService.checkNumberOfProjects({ inferredProjects: 1 });
3316
+ const project = projectService.inferredProjects[0];
3317
+ checkProjectRootFiles(project, [file.path]);
3318
+ checkProjectActualFiles(project, [file.path, libFile.path]);
3319
+ });
3320
+
3304
3321
it("files opened, closed affecting multiple projects", () => {
3305
3322
const file: File = {
3306
3323
path: "/a/b/projects/config/file.ts",
@@ -3893,8 +3910,8 @@ namespace ts.projectSystem {
3893
3910
command: server.CommandNames.Open,
3894
3911
arguments: {
3895
3912
file: untitledFile,
3896
- fileContent: "" ,
3897
- scriptKindName: "JS ",
3913
+ fileContent: `/// <reference path="../../../../../../typings/@epic/Core.d.ts" />` ,
3914
+ scriptKindName: "TS ",
3898
3915
projectRootPath: useProjectRoot ? folderPath : undefined
3899
3916
}
3900
3917
});
@@ -10772,16 +10789,16 @@ fn5();`
10772
10789
const untitledFile = "untitled:^Untitled-1";
10773
10790
executeSessionRequestNoResponse<protocol.OpenRequest>(session, protocol.CommandTypes.Open, {
10774
10791
file: untitledFile,
10775
- fileContent: "let foo = 1;\nfooo/**/" ,
10792
+ fileContent: `/// <reference path="../../../../../../typings/@epic/Core.d.ts" />\nlet foo = 1;\nfooo/**/` ,
10776
10793
scriptKindName: "TS",
10777
10794
projectRootPath: "/proj",
10778
10795
});
10779
10796
10780
10797
const response = executeSessionRequest<protocol.CodeFixRequest, protocol.CodeFixResponse>(session, protocol.CommandTypes.GetCodeFixes, {
10781
10798
file: untitledFile,
10782
- startLine: 2 ,
10799
+ startLine: 3 ,
10783
10800
startOffset: 1,
10784
- endLine: 2 ,
10801
+ endLine: 3 ,
10785
10802
endOffset: 5,
10786
10803
errorCodes: [Diagnostics.Cannot_find_name_0_Did_you_mean_1.code],
10787
10804
});
@@ -10794,8 +10811,8 @@ fn5();`
10794
10811
changes: [{
10795
10812
fileName: untitledFile,
10796
10813
textChanges: [{
10797
- start: { line: 2 , offset: 1 },
10798
- end: { line: 2 , offset: 5 },
10814
+ start: { line: 3 , offset: 1 },
10815
+ end: { line: 3 , offset: 5 },
10799
10816
newText: "foo",
10800
10817
}],
10801
10818
}],
0 commit comments