mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
Always generate configFileDiag if file is going to be added to configured project (#37443)
Fixes #30623
This commit is contained in:
@@ -608,6 +608,10 @@ declare module '@custom/plugin' {
|
||||
path: "/a/b/test.ts",
|
||||
content: "let x = 10"
|
||||
};
|
||||
const file3: File = {
|
||||
path: "/a/b/test2.ts",
|
||||
content: "let xy = 10"
|
||||
};
|
||||
const configFile: File = {
|
||||
path: "/a/b/tsconfig.json",
|
||||
content: `{
|
||||
@@ -618,9 +622,20 @@ declare module '@custom/plugin' {
|
||||
"files": ["app.ts"]
|
||||
}`
|
||||
};
|
||||
const serverEventManager = new TestServerEventManager([file, file2, libFile, configFile]);
|
||||
const serverEventManager = new TestServerEventManager([file, file2, file3, libFile, configFile]);
|
||||
openFilesForSession([file2], serverEventManager.session);
|
||||
serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file2.path, [
|
||||
getUnknownCompilerOptionDiagnostic(configFile, "foo"),
|
||||
getUnknownCompilerOptionDiagnostic(configFile, "allowJS", "allowJs")
|
||||
]);
|
||||
openFilesForSession([file], serverEventManager.session);
|
||||
// We generate only if project is created when opening file from the project
|
||||
serverEventManager.hasZeroEvent("configFileDiag");
|
||||
openFilesForSession([file3], serverEventManager.session);
|
||||
serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file3.path, [
|
||||
getUnknownCompilerOptionDiagnostic(configFile, "foo"),
|
||||
getUnknownCompilerOptionDiagnostic(configFile, "allowJS", "allowJs")
|
||||
]);
|
||||
});
|
||||
|
||||
it("are not generated when the config file has errors but suppressDiagnosticEvents is true", () => {
|
||||
@@ -651,6 +666,10 @@ declare module '@custom/plugin' {
|
||||
path: "/a/b/test.ts",
|
||||
content: "let x = 10"
|
||||
};
|
||||
const file3: File = {
|
||||
path: "/a/b/test2.ts",
|
||||
content: "let xy = 10"
|
||||
};
|
||||
const configFile: File = {
|
||||
path: "/a/b/tsconfig.json",
|
||||
content: `{
|
||||
@@ -658,9 +677,14 @@ declare module '@custom/plugin' {
|
||||
}`
|
||||
};
|
||||
|
||||
const serverEventManager = new TestServerEventManager([file, file2, libFile, configFile]);
|
||||
const serverEventManager = new TestServerEventManager([file, file2, file3, libFile, configFile]);
|
||||
openFilesForSession([file2], serverEventManager.session);
|
||||
serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file2.path, emptyArray);
|
||||
openFilesForSession([file], serverEventManager.session);
|
||||
// We generate only if project is created when opening file from the project
|
||||
serverEventManager.hasZeroEvent("configFileDiag");
|
||||
openFilesForSession([file3], serverEventManager.session);
|
||||
serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file3.path, emptyArray);
|
||||
});
|
||||
|
||||
it("contains the project reference errors", () => {
|
||||
|
||||
Reference in New Issue
Block a user