placing the check directly in the return statement

This commit is contained in:
Aiday Marlen Kyzy
2023-10-02 19:22:15 +02:00
parent 73f65bb85f
commit fd01fd5285
@@ -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
});
}
}