This reverts commit 1b21350e17
.
PR Close #39322
This commit is contained in:
parent
a93b7fd674
commit
0268b72d2c
|
@ -69,12 +69,6 @@ export const host: ts.server.ServerHost = {
|
|||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructing a project service is expensive (~2.5s on MacBook Pro), so it
|
||||
* should be a singleton service shared throughout all tests.
|
||||
*/
|
||||
let projectService: ts.server.ProjectService;
|
||||
|
||||
/**
|
||||
* Create a ConfiguredProject and an actual program for the test project located
|
||||
* in packages/language-service/test/project. Project creation exercises the
|
||||
|
@ -82,19 +76,17 @@ let projectService: ts.server.ProjectService;
|
|||
* and modify test files.
|
||||
*/
|
||||
export function setup() {
|
||||
if (!projectService) {
|
||||
projectService = new ts.server.ProjectService({
|
||||
host,
|
||||
logger,
|
||||
cancellationToken: ts.server.nullCancellationToken,
|
||||
useSingleInferredProject: true,
|
||||
useInferredProjectPerProjectRoot: true,
|
||||
typingsInstaller: ts.server.nullTypingsInstaller,
|
||||
});
|
||||
// Opening APP_COMPONENT forces a new ConfiguredProject to be created based
|
||||
// on the tsconfig.json in the test project.
|
||||
projectService.openClientFile(APP_COMPONENT);
|
||||
}
|
||||
const projectService = new ts.server.ProjectService({
|
||||
host,
|
||||
logger,
|
||||
cancellationToken: ts.server.nullCancellationToken,
|
||||
useSingleInferredProject: true,
|
||||
useInferredProjectPerProjectRoot: true,
|
||||
typingsInstaller: ts.server.nullTypingsInstaller,
|
||||
});
|
||||
// Opening APP_COMPONENT forces a new ConfiguredProject to be created based
|
||||
// on the tsconfig.json in the test project.
|
||||
projectService.openClientFile(APP_COMPONENT);
|
||||
const project = projectService.findProject(TSCONFIG);
|
||||
if (!project) {
|
||||
throw new Error(`Failed to create project for ${TSCONFIG}`);
|
||||
|
|
Loading…
Reference in New Issue