From 0744e1b296f89564498859b4818c56035a68ff9c Mon Sep 17 00:00:00 2001 From: Jesse Trinity Date: Mon, 21 Sep 2020 18:11:46 -0700 Subject: [PATCH] fix(40640) add missing notApplicableReason in protocol (#40680) * update protocol * fix lint error --- src/server/protocol.ts | 7 +++++++ tests/baselines/reference/api/tsserverlibrary.d.ts | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index b288124049e67..4bb19652ad51b 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -617,6 +617,12 @@ namespace ts.server.protocol { * so this description should make sense by itself if the parent is inlineable=true */ description: string; + + /** + * A message to show to the user if the refactoring cannot be applied in + * the current context. + */ + notApplicableReason?: string; } export interface GetEditsForRefactorRequest extends Request { @@ -3217,6 +3223,7 @@ namespace ts.server.protocol { readonly allowTextChangesInNewFiles?: boolean; readonly lazyConfiguredProjectsFromExternalProject?: boolean; readonly providePrefixAndSuffixTextForRename?: boolean; + readonly provideRefactorNotApplicableReason?: boolean; readonly allowRenameOfImportPath?: boolean; readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index aad052326e024..42c28b30e33e0 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -6881,6 +6881,11 @@ declare namespace ts.server.protocol { * so this description should make sense by itself if the parent is inlineable=true */ description: string; + /** + * A message to show to the user if the refactoring cannot be applied in + * the current context. + */ + notApplicableReason?: string; } interface GetEditsForRefactorRequest extends Request { command: CommandTypes.GetEditsForRefactor; @@ -8902,6 +8907,7 @@ declare namespace ts.server.protocol { readonly allowTextChangesInNewFiles?: boolean; readonly lazyConfiguredProjectsFromExternalProject?: boolean; readonly providePrefixAndSuffixTextForRename?: boolean; + readonly provideRefactorNotApplicableReason?: boolean; readonly allowRenameOfImportPath?: boolean; readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; }