disable-copilot.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts
  2. index d5aa998..dab534b 100644
  3. --- a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts
  4. +++ b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts
  5. @@ -1876,3 +1876,3 @@ MenuRegistry.appendMenuItem(MenuId.EditorContext, {
  6. ChatContextKeys.Setup.disabled.negate(),
  7. - ChatContextKeys.Setup.installed.negate(),
  8. + ChatContextKeys.Setup.installed,
  9. );
  10. diff --git a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts
  11. index dbd2125..bceed38 100644
  12. --- a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts
  13. +++ b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts
  14. @@ -696,3 +696,3 @@ configurationRegistry.registerConfiguration({
  15. description: nls.localize('chat.disableAIFeatures', "Disable and hide built-in AI features provided by GitHub Copilot, including chat, code completions and next edit suggestions."),
  16. - default: false,
  17. + default: true,
  18. scope: ConfigurationScope.WINDOW
  19. diff --git a/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.ts b/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.ts
  20. index 391a4de..a1489b2 100644
  21. --- a/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.ts
  22. +++ b/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.ts
  23. @@ -67,9 +67,8 @@ const chatViewDescriptor: IViewDescriptor[] = [{
  24. ctorDescriptor: new SyncDescriptor(ChatViewPane, [{ location: ChatAgentLocation.Chat }]),
  25. - when: ContextKeyExpr.or(
  26. - ContextKeyExpr.or(
  27. - ChatContextKeys.Setup.hidden,
  28. - ChatContextKeys.Setup.disabled
  29. - )?.negate(),
  30. + when: ContextKeyExpr.and(
  31. + ChatContextKeys.Setup.installed,
  32. + ChatContextKeys.Setup.disabled.negate(),
  33. + ChatContextKeys.Setup.hidden.negate(),
  34. ChatContextKeys.panelParticipantRegistered,
  35. - ChatContextKeys.extensionInvalid
  36. + ChatContextKeys.extensionInvalid.negate()
  37. )
  38. diff --git a/src/vs/workbench/contrib/chat/browser/chatStatus.ts b/src/vs/workbench/contrib/chat/browser/chatStatus.ts
  39. index 05f6f0e..7fe62fd 100644
  40. --- a/src/vs/workbench/contrib/chat/browser/chatStatus.ts
  41. +++ b/src/vs/workbench/contrib/chat/browser/chatStatus.ts
  42. @@ -132,2 +132,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
  43. + const context = chatEntitlementService.context?.value;
  44. + if (!context) {
  45. + return; // disabled
  46. + }
  47. +
  48. this.update();