Skip to content

Commit 92ac097

Browse files
committed
work on github issues
1 parent de6741a commit 92ac097

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/vs/workbench/contrib/customEditor/browser/customEditorOutline.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ class CustomEditorExtensionOutline implements IOutline<CustomEditorOutlineEntry>
288288
getContextKeyOverlay: (entry: CustomEditorOutlineEntry) => {
289289
return [['customEditorOutlineItem', entry.contextValue ?? '']];
290290
},
291+
getActionsContext: (entry: CustomEditorOutlineEntry) => {
292+
return { id: entry.id };
293+
},
291294
};
292295

293296
// Listen for outline data changes from the extension provider

src/vs/workbench/contrib/outline/browser/outlinePane.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export class OutlinePane extends ViewPane implements IOutlinePane {
293293
menuActionOptions: { shouldForwardArgs: true },
294294
contextKeyService,
295295
getAnchor: () => e.anchor,
296-
getActionsContext: () => e.element,
296+
getActionsContext: () => newOutline.config.getActionsContext?.(e.element) ?? e.element,
297297
});
298298
}));
299299
}

src/vs/workbench/services/outline/browser/outline.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { FuzzyScore } from '../../../../base/common/filters.js';
1111
import { IDisposable } from '../../../../base/common/lifecycle.js';
1212
import { URI } from '../../../../base/common/uri.js';
1313
import { MenuId } from '../../../../platform/actions/common/actions.js';
14+
import { ContextKeyValue } from '../../../../platform/contextkey/common/contextkey.js';
1415
import { IEditorOptions } from '../../../../platform/editor/common/editor.js';
1516
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
1617
import { IWorkbenchDataTreeOptions } from '../../../../platform/list/browser/listService.js';
@@ -73,7 +74,8 @@ export interface IOutlineListConfig<E> {
7374
readonly options: IWorkbenchDataTreeOptions<E, FuzzyScore>;
7475
readonly quickPickDataSource: IQuickPickDataSource<E>;
7576
readonly contextMenuId?: MenuId;
76-
readonly getContextKeyOverlay?: (element: E) => [string, unknown][];
77+
readonly getContextKeyOverlay?: (element: E) => [string, ContextKeyValue][];
78+
readonly getActionsContext?: (element: E) => unknown;
7779
}
7880

7981
export interface OutlineChangeEvent {

0 commit comments

Comments
 (0)