diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 6dccc08c4b5cd..e9d97f6e03c02 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -7,7 +7,6 @@ namespace ts.server { export const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground"; export const ProjectLoadingStartEvent = "projectLoadingStart"; export const ProjectLoadingFinishEvent = "projectLoadingFinish"; - export const SurveyReady = "surveyReady"; export const LargeFileReferencedEvent = "largeFileReferenced"; export const ConfigFileDiagEvent = "configFileDiag"; export const ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; @@ -30,11 +29,6 @@ namespace ts.server { data: { project: Project; }; } - export interface SurveyReady { - eventName: typeof SurveyReady; - data: { surveyId: string; }; - } - export interface LargeFileReferencedEvent { eventName: typeof LargeFileReferencedEvent; data: { file: string; fileSize: number; maxFileSize: number; }; @@ -146,7 +140,6 @@ namespace ts.server { } export type ProjectServiceEvent = LargeFileReferencedEvent | - SurveyReady | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | @@ -518,9 +511,6 @@ namespace ts.server { /** Tracks projects that we have already sent telemetry for. */ private readonly seenProjects = createMap(); - /** Tracks projects that we have already sent survey events for. */ - private readonly seenSurveyProjects = createMap(); - /*@internal*/ readonly watchFactory: WatchFactory; @@ -722,14 +712,6 @@ namespace ts.server { this.eventHandler(event); } - /* @internal */ - sendSurveyReadyEvent(surveyId: string) { - if (!this.eventHandler) { - return; - } - this.eventHandler({ eventName: SurveyReady, data: { surveyId } }); - } - /* @internal */ sendLargeFileReferencedEvent(file: string, fileSize: number) { if (!this.eventHandler) { @@ -1611,20 +1593,6 @@ namespace ts.server { return project; } - /*@internal*/ - sendSurveyReady(project: ExternalProject | ConfiguredProject): void { - if (this.seenSurveyProjects.has(project.projectName)) { - return; - } - - if (project.getCompilerOptions().checkJs !== undefined) { - const name = "checkJs"; - this.logger.info(`Survey ${name} is ready`); - this.sendSurveyReadyEvent(name); - this.seenSurveyProjects.set(project.projectName, true); - } - } - /*@internal*/ sendProjectTelemetry(project: ExternalProject | ConfiguredProject): void { if (this.seenProjects.has(project.projectName)) { diff --git a/src/server/project.ts b/src/server/project.ts index b296668e6ae4c..280cedb424d6b 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -1431,7 +1431,6 @@ namespace ts.server { } this.projectService.sendProjectLoadingFinishEvent(this); this.projectService.sendProjectTelemetry(this); - this.projectService.sendSurveyReady(this); return result; } @@ -1627,7 +1626,6 @@ namespace ts.server { updateGraph() { const result = super.updateGraph(); this.projectService.sendProjectTelemetry(this); - this.projectService.sendSurveyReady(this); return result; } diff --git a/src/server/session.ts b/src/server/session.ts index e5b128c984e82..b47dfe6b716e7 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -610,10 +610,6 @@ namespace ts.server { diagnostics: bakedDiags }, ConfigFileDiagEvent); break; - case SurveyReady: - const { surveyId } = event.data; - this.event({ surveyId }, SurveyReady); - break; case ProjectLanguageServiceStateEvent: { const eventName: protocol.ProjectLanguageServiceStateEventName = ProjectLanguageServiceStateEvent; this.event({ diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 7e75c0105a2d3..137e4d8af58b7 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -109,7 +109,6 @@ "unittests/tsserver/events/projectLanguageServiceState.ts", "unittests/tsserver/events/projectLoading.ts", "unittests/tsserver/events/projectUpdatedInBackground.ts", - "unittests/tsserver/events/surveyReady.ts", "unittests/tsserver/externalProjects.ts", "unittests/tsserver/forceConsistentCasingInFileNames.ts", "unittests/tsserver/formatSettings.ts", diff --git a/src/testRunner/unittests/tsserver/events/surveyReady.ts b/src/testRunner/unittests/tsserver/events/surveyReady.ts deleted file mode 100644 index b04746800d0cd..0000000000000 --- a/src/testRunner/unittests/tsserver/events/surveyReady.ts +++ /dev/null @@ -1,111 +0,0 @@ -namespace ts.projectSystem { - describe("unittests:: tsserver:: events:: SurveyReady", () => { - function createSessionWithEventHandler(host: TestServerHost) { - const { session, events: surveyEvents } = createSessionWithEventTracking(host, server.SurveyReady); - - return { session, verifySurveyReadyEvent }; - - function verifySurveyReadyEvent(numberOfEvents: number) { - assert.equal(surveyEvents.length, numberOfEvents); - const expectedEvents = numberOfEvents === 0 ? [] : [{ - eventName: server.SurveyReady, - data: { surveyId: "checkJs" } - }]; - assert.deepEqual(surveyEvents, expectedEvents); - } - } - - it("doesn't log an event when checkJs isn't set", () => { - const projectRoot = "/user/username/projects/project"; - const file: File = { - path: `${projectRoot}/src/file.ts`, - content: "export var y = 10;" - }; - const tsconfig: File = { - path: `${projectRoot}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: {} }), - }; - const host = createServerHost([file, tsconfig]); - const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); - const service = session.getProjectService(); - openFilesForSession([file], session); - checkNumberOfProjects(service, { configuredProjects: 1 }); - const project = service.configuredProjects.get(tsconfig.path)!; - checkProjectActualFiles(project, [file.path, tsconfig.path]); - - verifySurveyReadyEvent(0); - }); - - it("logs an event when checkJs is set", () => { - const projectRoot = "/user/username/projects/project"; - const file: File = { - path: `${projectRoot}/src/file.ts`, - content: "export var y = 10;" - }; - const tsconfig: File = { - path: `${projectRoot}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { checkJs: true } }), - }; - const host = createServerHost([file, tsconfig]); - const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); - openFilesForSession([file], session); - - verifySurveyReadyEvent(1); - }); - - it("logs an event when checkJs is set, only the first time", () => { - const projectRoot = "/user/username/projects/project"; - const file: File = { - path: `${projectRoot}/src/file.ts`, - content: "export var y = 10;" - }; - const rando: File = { - path: `/rando/calrissian.ts`, - content: "export function f() { }" - }; - const tsconfig: File = { - path: `${projectRoot}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { checkJs: true } }), - }; - const host = createServerHost([file, tsconfig]); - const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); - openFilesForSession([file], session); - - verifySurveyReadyEvent(1); - - closeFilesForSession([file], session); - openFilesForSession([rando], session); - openFilesForSession([file], session); - - verifySurveyReadyEvent(1); - }); - - it("logs an event when checkJs is set after closing and reopening", () => { - const projectRoot = "/user/username/projects/project"; - const file: File = { - path: `${projectRoot}/src/file.ts`, - content: "export var y = 10;" - }; - const rando: File = { - path: `/rando/calrissian.ts`, - content: "export function f() { }" - }; - const tsconfig: File = { - path: `${projectRoot}/tsconfig.json`, - content: JSON.stringify({}), - }; - const host = createServerHost([file, tsconfig]); - const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); - openFilesForSession([file], session); - - verifySurveyReadyEvent(0); - - closeFilesForSession([file], session); - openFilesForSession([rando], session); - host.writeFile(tsconfig.path, JSON.stringify({ compilerOptions: { checkJs: true } })); - openFilesForSession([file], session); - - verifySurveyReadyEvent(1); - }); - }); -} diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 025880dc09ebe..36c246c999f23 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8357,7 +8357,6 @@ declare namespace ts.server { const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground"; const ProjectLoadingStartEvent = "projectLoadingStart"; const ProjectLoadingFinishEvent = "projectLoadingFinish"; - const SurveyReady = "surveyReady"; const LargeFileReferencedEvent = "largeFileReferenced"; const ConfigFileDiagEvent = "configFileDiag"; const ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; @@ -8382,12 +8381,6 @@ declare namespace ts.server { project: Project; }; } - interface SurveyReady { - eventName: typeof SurveyReady; - data: { - surveyId: string; - }; - } interface LargeFileReferencedEvent { eventName: typeof LargeFileReferencedEvent; data: { @@ -8472,7 +8465,7 @@ declare namespace ts.server { interface OpenFileInfo { readonly checkJs: boolean; } - type ProjectServiceEvent = LargeFileReferencedEvent | SurveyReady | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent; + type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent; type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void; interface SafeList { [name: string]: { @@ -8589,8 +8582,6 @@ declare namespace ts.server { readonly syntaxOnly?: boolean; /** Tracks projects that we have already sent telemetry for. */ private readonly seenProjects; - /** Tracks projects that we have already sent survey events for. */ - private readonly seenSurveyProjects; constructor(opts: ProjectServiceOptions); toPath(fileName: string): Path; private loadTypesMap; diff --git a/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter b/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter index 40bdb4eadabc9..6b9706810b55a 160000 --- a/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter +++ b/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter @@ -1 +1 @@ -Subproject commit 40bdb4eadabc9fbed7d83e3f26817a931c0763b6 +Subproject commit 6b9706810b55af326a93b9aa59cb17815a30bb32 diff --git a/tests/cases/user/prettier/prettier b/tests/cases/user/prettier/prettier index 67f1c4877ee10..6e0de0812231c 160000 --- a/tests/cases/user/prettier/prettier +++ b/tests/cases/user/prettier/prettier @@ -1 +1 @@ -Subproject commit 67f1c4877ee1090b66d468a847caccca411a6f82 +Subproject commit 6e0de0812231c3a48387d398d092418749aa39f1 diff --git a/tests/cases/user/webpack/webpack b/tests/cases/user/webpack/webpack index 10282ea20648b..a28f44f613276 160000 --- a/tests/cases/user/webpack/webpack +++ b/tests/cases/user/webpack/webpack @@ -1 +1 @@ -Subproject commit 10282ea20648b465caec6448849f24fc34e1ba3e +Subproject commit a28f44f613276446fb764dec7fab38b7cff8a07c