Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9e101ca
fix: to #157015 fix view label command localized
yiliang114 Sep 20, 2023
2b9fb45
Merge branch 'main' into zonal-antlion
yiliang114 Sep 22, 2023
52148ae
chore: save
yiliang114 Sep 20, 2023
c7515e2
Fixes #157015
yiliang114 Sep 22, 2023
98b88b3
Merge pull request #192602 from sandersn/ai-codefixes
jrieken Sep 22, 2023
f98ef49
Merge pull request #191116 from microsoft/isidorn/thick-reindeer
isidorn Sep 22, 2023
19e2249
Merge pull request #193720 from microsoft/merogge/diff
meganrogge Sep 22, 2023
348b842
Merge branch 'main' into ulugbekna/implement-code-mappers-context
ulugbekna Sep 22, 2023
4718459
Merge pull request #193656 from microsoft/ulugbekna/implement-code-ma…
ulugbekna Sep 23, 2023
1c2b2a3
Merge branch 'main' into zonal-antlion
yiliang114 Sep 22, 2023
f1b0fbf
Fixes #157015
yiliang114 Sep 25, 2023
896e2ea
Fixes #157015
yiliang114 Sep 25, 2023
74bf93d
Merge branch 'main' into ulugbekna/implement-code-mappers-context
ulugbekna Sep 22, 2023
4a92285
Merge pull request #193656 from microsoft/ulugbekna/implement-code-ma…
ulugbekna Sep 23, 2023
1c8e12a
Merge branch 'main' into zonal-antlion
yiliang114 Sep 22, 2023
5bd253e
Fixes #157015
yiliang114 Sep 26, 2023
c89cb5a
Fixes #157015
yiliang114 Sep 26, 2023
3a91bfa
Fixes #157015
yiliang114 Sep 30, 2023
5fd1e02
fix: use nls.localize2 to simplified code
yiliang114 Oct 9, 2023
02d0d71
fix: use nls.localize2 to simplified code
yiliang114 Oct 9, 2023
06f2648
fix: use nls.localize2 to simplified code
yiliang114 Oct 9, 2023
9bcc960
Merge branch 'main' into zonal-antlion
yiliang114 Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vs/workbench/api/browser/mainThreadComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments

Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{
id: COMMENTS_VIEW_ID,
name: COMMENTS_VIEW_TITLE,
name: { value: COMMENTS_VIEW_TITLE, original: COMMENTS_VIEW_ORIGINAL_TITLE },
canToggleVisibility: false,
ctorDescriptor: new SyncDescriptor(CommentsPanel),
canMoveView: true,
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/browser/viewsExtensionPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
type: type,
ctorDescriptor: type === ViewType.Tree ? new SyncDescriptor(TreeViewPane) : new SyncDescriptor(WebviewViewPane),
id: item.id,
name: item.name,
name: { value: item.name, original: item.name },
when: ContextKeyExpr.deserialize(item.when),
containerIcon: icon || viewContainer?.icon,
containerTitle: item.contextualTitle || (viewContainer && (typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ suite('MainThreadHostTreeView', function () {
const viewDescriptor: ITreeViewDescriptor = {
id: testTreeViewId,
ctorDescriptor: null!,
name: 'Test View 1',
name: { value: 'Test View 1', original: 'Test View 1' },
treeView: disposables.add(instantiationService.createInstance(CustomTreeView, 'testTree', 'Test Title', 'extension.id')),
};
ViewsRegistry.registerViews([viewDescriptor], container);
Expand Down
8 changes: 4 additions & 4 deletions src/vs/workbench/browser/actions/layoutActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ registerAction2(class extends Action2 {

results.push({
id: viewDescriptor.id,
label: viewDescriptor.name
label: viewDescriptor.name.value
});
}
});
Expand All @@ -707,7 +707,7 @@ registerAction2(class extends Action2 {

results.push({
id: viewDescriptor.id,
label: viewDescriptor.name
label: viewDescriptor.name.value
});
}
});
Expand All @@ -732,7 +732,7 @@ registerAction2(class extends Action2 {

results.push({
id: viewDescriptor.id,
label: viewDescriptor.name
label: viewDescriptor.name.value
});
}
});
Expand Down Expand Up @@ -806,7 +806,7 @@ class MoveFocusedViewAction extends Action2 {

const quickPick = quickInputService.createQuickPick();
quickPick.placeholder = localize('moveFocusedView.selectDestination', "Select a Destination for the View");
quickPick.title = localize({ key: 'moveFocusedView.title', comment: ['{0} indicates the title of the view the user has selected to move.'] }, "View: Move {0}", viewDescriptor.name);
quickPick.title = localize({ key: 'moveFocusedView.title', comment: ['{0} indicates the title of the view the user has selected to move.'] }, "View: Move {0}", viewDescriptor.name.value);

const items: Array<IQuickPickItem | IQuickPickSeparator> = [];
const currentContainer = viewDescriptorService.getViewContainerByViewId(focusedViewId)!;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/parts/views/viewPaneContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
const pane = this.createView(viewDescriptor,
{
id: viewDescriptor.id,
title: viewDescriptor.name,
title: viewDescriptor.name.value,
fromExtensionId: (viewDescriptor as Partial<ICustomViewDescriptor>).extensionId,
expanded: !collapsed
});
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/browser/parts/views/viewsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class ViewsService extends Disposable implements IViewsService {

getFocusedViewName(): string {
const viewId: string = this.contextKeyService.getContextKeyValue(FocusedViewContext.key) ?? '';
return this.viewDescriptorService.getViewDescriptorById(viewId.toString())?.name ?? '';
return this.viewDescriptorService.getViewDescriptorById(viewId.toString())?.name?.value ?? '';
}

async openView<T extends IView>(id: string, focus?: boolean): Promise<T | null> {
Expand Down Expand Up @@ -485,7 +485,7 @@ export class ViewsService extends Disposable implements IViewsService {
private registerFocusViewAction(viewDescriptor: IViewDescriptor, category?: string | ILocalizedString): IDisposable {
return registerAction2(class FocusViewAction extends Action2 {
constructor() {
const title = localize({ key: 'focus view', comment: ['{0} indicates the name of the view to be focused.'] }, "Focus on {0} View", viewDescriptor.name);
const title = localize({ key: 'focus view', comment: ['{0} indicates the name of the view to be focused.'] }, "Focus on {0} View", viewDescriptor.name.value);
super({
id: viewDescriptor.focusCommand ? viewDescriptor.focusCommand.id : `${viewDescriptor.id}.focus`,
title: { original: `Focus on ${viewDescriptor.name} View`, value: title },
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/common/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export interface IViewDescriptor {

readonly id: string;

readonly name: string;
readonly name: ILocalizedString;

readonly ctorDescriptor: SyncDescriptor<IView>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ const container = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.V

Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews([{
id: BulkEditPane.ID,
name: localize('panel', "Refactor Preview"),
name: { value: localize('panel', "Refactor Preview"), original: 'Refactor Preview' },
when: BulkEditPreviewContribution.ctxEnabled,
ctorDescriptor: new SyncDescriptor(BulkEditPane),
containerIcon: refactorPreviewViewIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class ChatExtensionPointHandler implements IWorkbenchContribution {
id: viewId,
containerIcon: this._viewContainer.icon,
containerTitle: this._viewContainer.title.value,
name: providerDescriptor.label,
name: { value: providerDescriptor.label, original: providerDescriptor.label },
canToggleVisibility: false,
canMoveView: true,
ctorDescriptor: new SyncDescriptor(ChatViewPane, [<IChatViewOptions>{ providerId: providerDescriptor.id }]),
Expand Down
14 changes: 7 additions & 7 deletions src/vs/workbench/contrib/debug/browser/debug.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewE

Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{
id: REPL_VIEW_ID,
name: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),
name: { value: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"), original: 'Debug Console' },
containerIcon: icons.debugConsoleViewIcon,
canToggleVisibility: false,
canMoveView: true,
Expand Down Expand Up @@ -407,12 +407,12 @@ const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewCo

// Register default debug views
const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);
viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: nls.localize('variables', "Variables"), containerIcon: icons.variablesViewIcon, ctorDescriptor: new SyncDescriptor(VariablesView), order: 10, weight: 40, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: nls.localize('watch', "Watch"), containerIcon: icons.watchViewIcon, ctorDescriptor: new SyncDescriptor(WatchExpressionsView), order: 20, weight: 10, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: nls.localize('callStack', "Call Stack"), containerIcon: icons.callStackViewIcon, ctorDescriptor: new SyncDescriptor(CallStackView), order: 30, weight: 30, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: nls.localize('breakpoints', "Breakpoints"), containerIcon: icons.breakpointsViewIcon, ctorDescriptor: new SyncDescriptor(BreakpointsView), order: 40, weight: 20, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: ContextKeyExpr.or(CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DEBUG_UX.isEqualTo('default'), CONTEXT_HAS_DEBUGGED) }], viewContainer);
viewsRegistry.registerViews([{ id: WelcomeView.ID, name: WelcomeView.LABEL, containerIcon: icons.runViewIcon, ctorDescriptor: new SyncDescriptor(WelcomeView), order: 1, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], viewContainer);
viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: nls.localize('loadedScripts', "Loaded Scripts"), containerIcon: icons.loadedScriptsViewIcon, ctorDescriptor: new SyncDescriptor(LoadedScriptsView), order: 35, weight: 5, canToggleVisibility: true, canMoveView: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: { value: nls.localize('variables', "Variables"), original: 'Variables' }, containerIcon: icons.variablesViewIcon, ctorDescriptor: new SyncDescriptor(VariablesView), order: 10, weight: 40, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: { value: nls.localize('watch', "Watch"), original: 'Watch' }, containerIcon: icons.watchViewIcon, ctorDescriptor: new SyncDescriptor(WatchExpressionsView), order: 20, weight: 10, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: { value: nls.localize('callStack', "Call Stack"), original: 'Call Stack' }, containerIcon: icons.callStackViewIcon, ctorDescriptor: new SyncDescriptor(CallStackView), order: 30, weight: 30, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: { value: nls.localize('breakpoints', "Breakpoints"), original: 'Breakpoints' }, containerIcon: icons.breakpointsViewIcon, ctorDescriptor: new SyncDescriptor(BreakpointsView), order: 40, weight: 20, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: ContextKeyExpr.or(CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DEBUG_UX.isEqualTo('default'), CONTEXT_HAS_DEBUGGED) }], viewContainer);
viewsRegistry.registerViews([{ id: WelcomeView.ID, name: { value: WelcomeView.LABEL, original: 'Run' }, containerIcon: icons.runViewIcon, ctorDescriptor: new SyncDescriptor(WelcomeView), order: 1, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], viewContainer);
viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: { value: nls.localize('loadedScripts', "Loaded Scripts"), original: 'Loaded Scripts' }, containerIcon: icons.loadedScriptsViewIcon, ctorDescriptor: new SyncDescriptor(LoadedScriptsView), order: 35, weight: 5, canToggleVisibility: true, canMoveView: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);

// Register disassembly view

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati
import { Registry } from 'vs/platform/registry/common/platform';
import { TreeView, TreeViewPane } from 'vs/workbench/browser/parts/views/treeView';
import { Extensions, ITreeItem, ITreeViewDataProvider, ITreeViewDescriptor, IViewsRegistry, TreeItemCollapsibleState, TreeViewItemHandleArg, ViewContainer } from 'vs/workbench/common/views';
import { ChangeType, EDIT_SESSIONS_DATA_VIEW_ID, EDIT_SESSIONS_SCHEME, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_TITLE, EditSession, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions';
import { ChangeType, EDIT_SESSIONS_DATA_VIEW_ID, EDIT_SESSIONS_SCHEME, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_TITLE, EDIT_SESSIONS_ORIGINAL_TITLE, EditSession, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions';
import { URI } from 'vs/base/common/uri';
import { fromNow } from 'vs/base/common/date';
import { Codicon } from 'vs/base/common/codicons';
Expand Down Expand Up @@ -47,7 +47,7 @@ export class EditSessionsDataViews extends Disposable {
const viewsRegistry = Registry.as<IViewsRegistry>(Extensions.ViewsRegistry);
viewsRegistry.registerViews([<ITreeViewDescriptor>{
id: viewId,
name,
name: { value: name, original: EDIT_SESSIONS_ORIGINAL_TITLE },
ctorDescriptor: new SyncDescriptor(TreeViewPane),
canToggleVisibility: true,
canMoveView: false,
Expand Down
Loading