mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Dont include auto type reference directives (#39472)
This commit is contained in:
parent
b100680a3e
commit
c08c059dae
@ -282,6 +282,7 @@ namespace ts.server {
|
||||
this.languageServiceEnabled = true;
|
||||
if (projectService.syntaxOnly) {
|
||||
this.compilerOptions.noResolve = true;
|
||||
this.compilerOptions.types = [];
|
||||
}
|
||||
|
||||
this.setInternalCompilerOptionsForEmittingJsFiles();
|
||||
|
||||
@ -95,5 +95,19 @@ class c { prop = "hello"; foo() { return this.prop; } }`
|
||||
}
|
||||
assert.isTrue(hasException);
|
||||
});
|
||||
|
||||
it("should not include auto type reference directives", () => {
|
||||
const { host, session, file1 } = setup();
|
||||
const atTypes: File = {
|
||||
path: `/node_modules/@types/somemodule/index.d.ts`,
|
||||
content: "export const something = 10;"
|
||||
};
|
||||
host.ensureFileOrFolder(atTypes);
|
||||
const service = session.getProjectService();
|
||||
openFilesForSession([file1], session);
|
||||
checkNumberOfProjects(service, { inferredProjects: 1 });
|
||||
const project = service.inferredProjects[0];
|
||||
checkProjectActualFiles(project, [libFile.path, file1.path]); // Should not contain atTypes
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user