From fd01fd52850e13d4087f4c730c69c5c3c8baa25e Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Mon, 2 Oct 2023 19:22:15 +0200 Subject: [PATCH] placing the check directly in the return statement --- src/vs/workbench/api/common/extHostLanguageFeatures.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index 23765faba91..ecbb00ca959 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -443,7 +443,7 @@ class CodeActionAdapter { this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${codeActionContext.only.value} 'requested but returned code action is of kind '${candidate.kind.value}'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.`); } } - const isCopilot = 'isCopilot' in candidate && typeof candidate.isCopilot === 'boolean' ? candidate.isCopilot : false; + // new school: convert code action actions.push({ cacheId: [cacheId, i], @@ -454,7 +454,7 @@ class CodeActionAdapter { kind: candidate.kind && candidate.kind.value, isPreferred: candidate.isPreferred, disabled: candidate.disabled?.reason, - isCopilot + isCopilot: 'isCopilot' in candidate && typeof candidate.isCopilot === 'boolean' ? candidate.isCopilot : false }); } }