Skip to content

Commit e8c821e

Browse files
authored
Merge branch 'main' into copilot/fix-d26c41ec-2939-4f32-a432-2e2763bd6de8
2 parents 4949904 + 1fe13cd commit e8c821e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+515
-154
lines changed

.github/commands.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,5 +613,15 @@
613613
"action": "close",
614614
"reason": "not_planned",
615615
"comment": "Please look at the following meta issue: https://github.com/microsoft/vscode/issues/253134. Please refer to that issue for updates and discussions. Feel free to open a new issue if you think this is a different problem."
616+
},
617+
{
618+
"type": "label",
619+
"name": "~spam",
620+
"removeLabel": "~spam",
621+
"addLabel": "spam",
622+
"action": "close",
623+
"reason": "not_planned",
624+
"comment": "Thank you for your submission. This issue has been closed as it doesn't meet our community guidelines or appears to be spam.\n\n**If you believe this was closed in error:**\n- Please review our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/)\n- Ensure your issue contains a clear description of the problem or feature request\n- Feel free to open a new issue with appropriate detail if this was a legitimate concern\n\n**For legitimate issues, please include:**\n- Clear description of the problem\n- Steps to reproduce (for bugs)\n- Expected vs actual behavior\n- VS Code version and environment details\n\nThank you for helping us maintain a welcoming and productive community."
616625
}
626+
617627
]

src/vs/base/common/policy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export type PolicyName = string;
88
export enum PolicyTag {
99
Account = 'ACCOUNT',
1010
MCP = 'MCP',
11-
Preview = 'PREVIEW'
11+
Preview = 'PREVIEW',
12+
Agent = 'AGENT',
1213
}
1314

1415
export interface IPolicy {

src/vs/platform/actions/browser/actionViewItemService.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,46 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { IActionViewItemProvider } from '../../../base/browser/ui/actionbar/actionbar.js';
6+
import { IActionViewItem } from '../../../base/browser/ui/actionbar/actionbar.js';
7+
import { IActionViewItemOptions } from '../../../base/browser/ui/actionbar/actionViewItems.js';
8+
import { IAction } from '../../../base/common/actions.js';
79
import { Emitter, Event } from '../../../base/common/event.js';
810
import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js';
911
import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';
10-
import { createDecorator } from '../../instantiation/common/instantiation.js';
12+
import { createDecorator, IInstantiationService } from '../../instantiation/common/instantiation.js';
1113
import { MenuId } from '../common/actions.js';
1214

1315

1416
export const IActionViewItemService = createDecorator<IActionViewItemService>('IActionViewItemService');
1517

18+
19+
export interface IActionViewItemFactory {
20+
(action: IAction, options: IActionViewItemOptions, instaService: IInstantiationService): IActionViewItem | undefined;
21+
}
22+
1623
export interface IActionViewItemService {
1724

1825
_serviceBrand: undefined;
1926

2027
onDidChange: Event<MenuId>;
2128

22-
register(menu: MenuId, submenu: MenuId, provider: IActionViewItemProvider, event?: Event<unknown>): IDisposable;
23-
register(menu: MenuId, commandId: string, provider: IActionViewItemProvider, event?: Event<unknown>): IDisposable;
29+
register(menu: MenuId, submenu: MenuId, provider: IActionViewItemFactory, event?: Event<unknown>): IDisposable;
30+
register(menu: MenuId, commandId: string, provider: IActionViewItemFactory, event?: Event<unknown>): IDisposable;
2431

25-
lookUp(menu: MenuId, submenu: MenuId): IActionViewItemProvider | undefined;
26-
lookUp(menu: MenuId, commandId: string): IActionViewItemProvider | undefined;
32+
lookUp(menu: MenuId, submenu: MenuId): IActionViewItemFactory | undefined;
33+
lookUp(menu: MenuId, commandId: string): IActionViewItemFactory | undefined;
2734
}
2835

2936
export class NullActionViewItemService implements IActionViewItemService {
3037
_serviceBrand: undefined;
3138

3239
onDidChange: Event<MenuId> = Event.None;
3340

34-
register(menu: MenuId, commandId: string | MenuId, provider: IActionViewItemProvider, event?: Event<unknown>): IDisposable {
41+
register(menu: MenuId, commandId: string | MenuId, provider: IActionViewItemFactory, event?: Event<unknown>): IDisposable {
3542
return Disposable.None;
3643
}
3744

38-
lookUp(menu: MenuId, commandId: string | MenuId): IActionViewItemProvider | undefined {
45+
lookUp(menu: MenuId, commandId: string | MenuId): IActionViewItemFactory | undefined {
3946
return undefined;
4047
}
4148
}
@@ -44,7 +51,7 @@ class ActionViewItemService implements IActionViewItemService {
4451

4552
declare _serviceBrand: undefined;
4653

47-
private readonly _providers = new Map<string, IActionViewItemProvider>();
54+
private readonly _providers = new Map<string, IActionViewItemFactory>();
4855

4956
private readonly _onDidChange = new Emitter<MenuId>();
5057
readonly onDidChange: Event<MenuId> = this._onDidChange.event;
@@ -53,7 +60,7 @@ class ActionViewItemService implements IActionViewItemService {
5360
this._onDidChange.dispose();
5461
}
5562

56-
register(menu: MenuId, commandOrSubmenuId: string | MenuId, provider: IActionViewItemProvider, event?: Event<unknown>): IDisposable {
63+
register(menu: MenuId, commandOrSubmenuId: string | MenuId, provider: IActionViewItemFactory, event?: Event<unknown>): IDisposable {
5764
const id = this._makeKey(menu, commandOrSubmenuId);
5865
if (this._providers.has(id)) {
5966
throw new Error(`A provider for the command ${commandOrSubmenuId} and menu ${menu} is already registered.`);
@@ -70,7 +77,7 @@ class ActionViewItemService implements IActionViewItemService {
7077
});
7178
}
7279

73-
lookUp(menu: MenuId, commandOrMenuId: string | MenuId): IActionViewItemProvider | undefined {
80+
lookUp(menu: MenuId, commandOrMenuId: string | MenuId): IActionViewItemFactory | undefined {
7481
return this._providers.get(this._makeKey(menu, commandOrMenuId));
7582
}
7683

src/vs/platform/actions/browser/toolbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export class MenuWorkbenchToolBar extends WorkbenchToolBar {
358358
if (!provider) {
359359
provider = options?.actionViewItemProvider;
360360
}
361-
const viewItem = provider?.(action, opts);
361+
const viewItem = provider?.(action, opts, instaService);
362362
if (viewItem) {
363363
return viewItem;
364364
}

src/vs/platform/observable/common/platformObservableUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { DisposableStore, IDisposable } from '../../../base/common/lifecycle.js';
7-
import { derivedOpts, IObservable, IReader, observableFromEventOpts } from '../../../base/common/observable.js';
7+
import { derivedOpts, IObservable, IReader, observableFromEvent, observableFromEventOpts } from '../../../base/common/observable.js';
88
import { IConfigurationService } from '../../configuration/common/configuration.js';
99
import { ContextKeyValue, IContextKeyService, RawContextKey } from '../../contextkey/common/contextkey.js';
1010

@@ -40,3 +40,7 @@ export function bindContextKey<T extends ContextKeyValue>(key: RawContextKey<T>,
4040
return compute_$show2FramesUp();
4141
}
4242

43+
44+
export function observableContextKey<T>(key: string, contextKeyService: IContextKeyService): IObservable<T | undefined> {
45+
return observableFromEvent(contextKeyService.onDidChangeContext, () => contextKeyService.getContextKeyValue<T>(key));
46+
}

src/vs/platform/quickinput/common/quickInput.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,16 @@ export interface IQuickTree<T extends IQuickTreeItem> extends IQuickInput {
10161016
*/
10171017
activeItems: ReadonlyArray<T>;
10181018

1019+
/**
1020+
* The validation message for the quick pick. This is rendered below the input.
1021+
*/
1022+
validationMessage: string | undefined;
1023+
1024+
/**
1025+
* The severity of the validation message.
1026+
*/
1027+
severity: Severity;
1028+
10191029
/**
10201030
* The items currently displayed in the quick tree.
10211031
* @note modifications to this array directly will not cause updates.

src/vs/workbench/api/browser/mainThreadChatSessions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ export class MainThreadChatSessions extends Disposable implements MainThreadChat
5151
this._proxy = this._extHostContext.getProxy(ExtHostContext.ExtHostChatSessions);
5252
}
5353

54-
$registerChatSessionItemProvider(handle: number, chatSessionType: string, label: string): void {
54+
$registerChatSessionItemProvider(handle: number, chatSessionType: string): void {
5555
// Register the provider handle - this tracks that a provider exists
5656
const provider: IChatSessionItemProvider = {
57-
label,
5857
chatSessionType,
5958
provideChatSessionItems: (token) => this._provideChatSessionItems(handle, token)
6059
};

src/vs/workbench/api/common/extHost.protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3129,7 +3129,7 @@ export interface ChatSessionDto {
31293129

31303130

31313131
export interface MainThreadChatSessionsShape extends IDisposable {
3132-
$registerChatSessionItemProvider(handle: number, chatSessionType: string, label: string): void;
3132+
$registerChatSessionItemProvider(handle: number, chatSessionType: string): void;
31333133
$unregisterChatSessionItemProvider(handle: number): void;
31343134
$onDidChangeChatSessionItems(chatSessionType: string): void;
31353135

src/vs/workbench/api/common/extHostChatSessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class ExtHostChatSessions extends Disposable implements ExtHostChatSessio
8787
const disposables = new DisposableStore();
8888

8989
this._chatSessionItemProviders.set(handle, { provider, extension, disposable: disposables });
90-
this._proxy.$registerChatSessionItemProvider(handle, chatSessionType, provider.label);
90+
this._proxy.$registerChatSessionItemProvider(handle, chatSessionType);
9191
if (provider.onDidChangeChatSessionItems) {
9292
disposables.add(provider.onDidChangeChatSessionItems(() => {
9393
this._proxy.$onDidChangeChatSessionItems(chatSessionType);

src/vs/workbench/contrib/chat/browser/actions/chatActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ export function registerChatActions() {
571571
const providerNSessions: { providerType: string; session: IChatSessionItem }[] = [];
572572

573573
for (const provider of providers) {
574-
const sessions = await chatSessionsService.provideChatSessionItems(provider.id, cancellationToken.token);
575-
providerNSessions.push(...sessions.map(session => ({ providerType: provider.id, session })));
574+
const sessions = await chatSessionsService.provideChatSessionItems(provider.type, cancellationToken.token);
575+
providerNSessions.push(...sessions.map(session => ({ providerType: provider.type, session })));
576576
}
577577

578578
for (const session of providerNSessions) {

0 commit comments

Comments
 (0)