diff --git a/src/server/protocol.ts b/src/server/protocol.ts index f9f3b1910cd40..6a52afc81757c 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 { @@ -3223,6 +3229,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 621b4141291f3..2b5ca8d1f18f6 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -6956,6 +6956,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; @@ -8983,6 +8988,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"; }