From e55fbffed6e3a30331ab81ab5b84f486ea049c45 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 5 Mar 2019 14:33:48 -0800 Subject: [PATCH] Rename the request as updateOpen --- src/server/protocol.ts | 12 ++++++------ src/server/session.ts | 2 +- .../unittests/tsserver/applyChangesToOpenFiles.ts | 6 +++--- tests/baselines/reference/api/tsserverlibrary.d.ts | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 3534a991c48..3b7690e2c60 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -92,7 +92,7 @@ namespace ts.server.protocol { SynchronizeProjectList = "synchronizeProjectList", /* @internal */ ApplyChangedToOpenFiles = "applyChangedToOpenFiles", - ApplyChangesToOpenFiles = "applyChangesToOpenFiles", + UpdateOpen = "updateOpen", /* @internal */ EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full", /* @internal */ @@ -1547,15 +1547,15 @@ namespace ts.server.protocol { /** * Request to synchronize list of open files with the client */ - export interface ApplyChangesToOpenFilesRequest extends Request { - command: CommandTypes.ApplyChangesToOpenFiles; - arguments: ApplyChangesToOpenFilesRequestArgs; + export interface UpdateOpenRequest extends Request { + command: CommandTypes.UpdateOpen; + arguments: UpdateOpenRequestArgs; } /** - * Arguments to ApplyChangesToOpenFilesRequest + * Arguments to UpdateOpenRequest */ - export interface ApplyChangesToOpenFilesRequestArgs { + export interface UpdateOpenRequestArgs { /** * List of newly open files */ diff --git a/src/server/session.ts b/src/server/session.ts index af84ffff48a..7cc3f595f82 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -2096,7 +2096,7 @@ namespace ts.server { }); return this.requiredResponse(converted); }, - [CommandNames.ApplyChangesToOpenFiles]: (request: protocol.ApplyChangesToOpenFilesRequest) => { + [CommandNames.UpdateOpen]: (request: protocol.UpdateOpenRequest) => { this.changeSeq++; this.projectService.applyChangesInOpenFiles( request.arguments.openFiles && mapIterator(arrayIterator(request.arguments.openFiles), file => ({ diff --git a/src/testRunner/unittests/tsserver/applyChangesToOpenFiles.ts b/src/testRunner/unittests/tsserver/applyChangesToOpenFiles.ts index 68c3839e789..316ecc8b652 100644 --- a/src/testRunner/unittests/tsserver/applyChangesToOpenFiles.ts +++ b/src/testRunner/unittests/tsserver/applyChangesToOpenFiles.ts @@ -105,10 +105,10 @@ ${file.content}`; ); }); - it("with applyChangesToOpenFiles request", () => { + it("with updateOpen request", () => { verify(session => - session.executeCommandSeq({ - command: protocol.CommandTypes.ApplyChangesToOpenFiles, + session.executeCommandSeq({ + command: protocol.CommandTypes.UpdateOpen, arguments: { openFiles: [ { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index f3fdd5158b4..5f4a400af8f 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5720,7 +5720,7 @@ declare namespace ts.server.protocol { OpenExternalProject = "openExternalProject", OpenExternalProjects = "openExternalProjects", CloseExternalProject = "closeExternalProject", - ApplyChangesToOpenFiles = "applyChangesToOpenFiles", + UpdateOpen = "updateOpen", GetOutliningSpans = "getOutliningSpans", TodoComments = "todoComments", Indentation = "indentation", @@ -6792,14 +6792,14 @@ declare namespace ts.server.protocol { /** * Request to synchronize list of open files with the client */ - interface ApplyChangesToOpenFilesRequest extends Request { - command: CommandTypes.ApplyChangesToOpenFiles; - arguments: ApplyChangesToOpenFilesRequestArgs; + interface UpdateOpenRequest extends Request { + command: CommandTypes.UpdateOpen; + arguments: UpdateOpenRequestArgs; } /** - * Arguments to ApplyChangesToOpenFilesRequest + * Arguments to UpdateOpenRequest */ - interface ApplyChangesToOpenFilesRequestArgs { + interface UpdateOpenRequestArgs { /** * List of newly open files */