Skip to content

Commit

Permalink
fix: Close #191880, Repair command cannot be searched by keyword afte…
Browse files Browse the repository at this point in the history
…r localization (#191953)
  • Loading branch information
yiliang114 authored Sep 1, 2023
1 parent a6808a1 commit 3519b13
Show file tree
Hide file tree
Showing 24 changed files with 57 additions and 52 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/api/browser/mainThreadComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/ext
import { ICommentController, ICommentInfo, ICommentService, INotebookCommentInfo } from 'vs/workbench/contrib/comments/browser/commentService';
import { CommentsPanel } from 'vs/workbench/contrib/comments/browser/commentsView';
import { CommentProviderFeatures, ExtHostCommentsShape, ExtHostContext, MainContext, MainThreadCommentsShape, CommentThreadChanges } from '../common/extHost.protocol';
import { COMMENTS_VIEW_ID, COMMENTS_VIEW_STORAGE_ID, COMMENTS_VIEW_TITLE } from 'vs/workbench/contrib/comments/browser/commentsTreeViewer';
import { COMMENTS_VIEW_ID, COMMENTS_VIEW_STORAGE_ID, COMMENTS_VIEW_TITLE, COMMENTS_VIEW_ORIGINAL_TITLE } from 'vs/workbench/contrib/comments/browser/commentsTreeViewer';
import { ViewContainer, IViewContainersRegistry, Extensions as ViewExtensions, ViewContainerLocation, IViewsRegistry, IViewsService, IViewDescriptorService } from 'vs/workbench/common/views';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
Expand Down Expand Up @@ -596,7 +596,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
if (!commentsViewAlreadyRegistered) {
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
id: COMMENTS_VIEW_ID,
title: COMMENTS_VIEW_TITLE,
title: { value: COMMENTS_VIEW_TITLE, original: COMMENTS_VIEW_ORIGINAL_TITLE },
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [COMMENTS_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]),
storageId: COMMENTS_VIEW_STORAGE_ID,
hideIfEmpty: true,
Expand Down
3 changes: 2 additions & 1 deletion src/vs/workbench/api/browser/viewsExtensionPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ class ViewsExtensionHandler implements IWorkbenchContribution {

viewContainer = this.viewContainersRegistry.registerViewContainer({
id,
title, extensionId,
title: { value: title, original: title },
extensionId,
ctorDescriptor: new SyncDescriptor(
ViewPaneContainer,
[id, { mergeViewWithContainerWhenSingleView: true }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ suite('MainThreadHostTreeView', function () {
const instantiationService: TestInstantiationService = <TestInstantiationService>workbenchInstantiationService(undefined, disposables);
const viewDescriptorService = instantiationService.createInstance(ViewDescriptorService);
instantiationService.stub(IViewDescriptorService, viewDescriptorService);
container = Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer({ id: 'testContainer', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
container = Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer({ id: 'testContainer', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
const viewDescriptor: ITreeViewDescriptor = {
id: testTreeViewId,
ctorDescriptor: null!,
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 @@ -75,7 +75,7 @@ export interface IViewContainerDescriptor {
/**
* The title of the view container
*/
readonly title: ILocalizedString | string;
readonly title: ILocalizedString;

/**
* Icon representation of the View container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codic

const container = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: BulkEditPane.ID,
title: localize('panel', "Refactor Preview"),
title: { value: localize('panel', "Refactor Preview"), original: 'Refactor Preview' },
hideIfEmpty: true,
ctorDescriptor: new SyncDescriptor(
ViewPaneContainer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class ChatContributionService implements IChatContributionService {
const viewContainerId = CHAT_SIDEBAR_PANEL_ID + '.' + providerDescriptor.id;
const viewContainer: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
id: viewContainerId,
title,
title: { value: title, original: 'Chat' },
icon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [viewContainerId, { mergeViewWithContainerWhenSingleView: true }]),
storageId: viewContainerId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { IListStyles } from 'vs/base/browser/ui/list/listWidget';

export const COMMENTS_VIEW_ID = 'workbench.panel.comments';
export const COMMENTS_VIEW_STORAGE_ID = 'Comments';
export const COMMENTS_VIEW_ORIGINAL_TITLE = 'Comments';
export const COMMENTS_VIEW_TITLE = nls.localize('comments.view.title', "Comments");

interface IResourceTemplateData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class TestViewDescriptorService implements Partial<IViewDescriptorService
getViewContainerByViewId(id: string): ViewContainer | null {
return {
id: 'comments',
title: 'Comments',
title: { value: 'Comments', original: 'Comments' },
ctorDescriptor: {} as any
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarDebugMenu, {

const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
id: DEBUG_PANEL_ID,
title: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"),
title: { value: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, "Debug Console"), original: 'Debug Console' },
icon: icons.debugConsoleViewIcon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [DEBUG_PANEL_ID, { mergeViewWithContainerWhenSingleView: true }]),
storageId: DEBUG_PANEL_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ILifecycleService, LifecyclePhase, ShutdownReason } from 'vs/workbench/
import { Action2, IAction2Options, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
import { ServicesAccessor } from 'vs/editor/browser/editorExtensions';
import { localize } from 'vs/nls';
import { IEditSessionsStorageService, Change, ChangeType, Folder, EditSession, FileType, EDIT_SESSION_SYNC_CATEGORY, EDIT_SESSIONS_CONTAINER_ID, EditSessionSchemaVersion, IEditSessionsLogService, EDIT_SESSIONS_VIEW_ICON, EDIT_SESSIONS_TITLE, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_DATA_VIEW_ID, decodeEditSessionFileContent, hashedEditSessionId, editSessionsLogId, EDIT_SESSIONS_PENDING } from 'vs/workbench/contrib/editSessions/common/editSessions';
import { IEditSessionsStorageService, Change, ChangeType, Folder, EditSession, FileType, EDIT_SESSION_SYNC_CATEGORY, EDIT_SESSIONS_CONTAINER_ID, EditSessionSchemaVersion, IEditSessionsLogService, EDIT_SESSIONS_VIEW_ICON, EDIT_SESSIONS_TITLE, EDIT_SESSIONS_ORIGINAL_TITLE, EDIT_SESSIONS_SHOW_VIEW, EDIT_SESSIONS_DATA_VIEW_ID, decodeEditSessionFileContent, hashedEditSessionId, editSessionsLogId, EDIT_SESSIONS_PENDING } from 'vs/workbench/contrib/editSessions/common/editSessions';
import { ISCMRepository, ISCMService } from 'vs/workbench/contrib/scm/common/scm';
import { IFileService } from 'vs/platform/files/common/files';
import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
Expand Down Expand Up @@ -274,7 +274,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
const container = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer(
{
id: EDIT_SESSIONS_CONTAINER_ID,
title: EDIT_SESSIONS_TITLE,
title: { value: EDIT_SESSIONS_TITLE, original: EDIT_SESSIONS_ORIGINAL_TITLE },
ctorDescriptor: new SyncDescriptor(
ViewPaneContainer,
[EDIT_SESSIONS_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export const EDIT_SESSIONS_PENDING = new RawContextKey<boolean>(EDIT_SESSIONS_PE

export const EDIT_SESSIONS_CONTAINER_ID = 'workbench.view.editSessions';
export const EDIT_SESSIONS_DATA_VIEW_ID = 'workbench.views.editSessions.data';
export const EDIT_SESSIONS_ORIGINAL_TITLE = 'Cloud Changes';
export const EDIT_SESSIONS_TITLE = localize('cloud changes', 'Cloud Changes');

export const EDIT_SESSIONS_VIEW_ICON = registerIcon('edit-sessions-view-icon', Codicon.cloudDownload, localize('editSessionViewIcon', 'View icon of the cloud changes view.'));
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/files/browser/explorerViewlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const viewContainerRegistry = Registry.as<IViewContainersRegistry>(Extensions.Vi
*/
export const VIEW_CONTAINER: ViewContainer = viewContainerRegistry.registerViewContainer({
id: VIEWLET_ID,
title: localize('explore', "Explorer"),
title: { value: localize('explore', "Explorer"), original: 'Explorer' },
ctorDescriptor: new SyncDescriptor(ExplorerViewPaneContainer),
storageId: 'workbench.explorer.views.state',
icon: explorerViewIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const markersViewIcon = registerIcon('markers-view-icon', Codicon.warning, local
// markers view container
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: Markers.MARKERS_CONTAINER_ID,
title: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
title: { value: Messages.MARKERS_PANEL_TITLE_PROBLEMS, original: Messages.MARKERS_PANEL_ORIGINAL_TITLE_PROBLEMS },
icon: markersViewIcon,
hideIfEmpty: true,
order: 0,
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/markers/browser/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default class Messages {
public static PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_SEVERITY: string = nls.localize('problems.panel.configuration.compareOrder.severity', "Navigate problems ordered by severity");
public static PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_POSITION: string = nls.localize('problems.panel.configuration.compareOrder.position', "Navigate problems ordered by position");

public static MARKERS_PANEL_ORIGINAL_TITLE_PROBLEMS: string = 'Problems';
public static MARKERS_PANEL_TITLE_PROBLEMS: string = nls.localize('markers.panel.title.problems', "Problems");

public static MARKERS_PANEL_NO_PROBLEMS_BUILT: string = nls.localize('markers.panel.no.problems.build', "No problems have been detected in the workspace.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ModesRegistry.registerLanguage({
const outputViewIcon = registerIcon('output-view-icon', Codicon.output, nls.localize('outputViewIcon', 'View icon of the output view.'));
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: OUTPUT_VIEW_ID,
title: nls.localize('output', "Output"),
title: { value: nls.localize('output', "Output"), original: 'Output' },
icon: outputViewIcon,
order: 1,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [OUTPUT_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]),
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ForwardedPortsView extends Disposable implements IWorkbenchContribu
private async getViewContainer(): Promise<ViewContainer | null> {
return Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer({
id: TUNNEL_VIEW_CONTAINER_ID,
title: nls.localize('ports', "Ports"),
title: { value: nls.localize('ports', "Ports"), original: 'Ports' },
icon: portsViewIcon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [TUNNEL_VIEW_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]),
storageId: TUNNEL_VIEW_CONTAINER_ID,
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/scm/browser/scm.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const sourceControlViewIcon = registerIcon('source-control-view-icon', Codicon.s

const viewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: VIEWLET_ID,
title: localize('source control', "Source Control"),
title: { value: localize('source control', "Source Control"), original: 'Source Control' },
ctorDescriptor: new SyncDescriptor(SCMViewPaneContainer),
storageId: 'workbench.scm.views.state',
icon: sourceControlViewIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Registry.as<IDragAndDropContributionRegistry>(DragAndDropExtensions.DragAndDropC
// Register views
const VIEW_CONTAINER = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: TERMINAL_VIEW_ID,
title: nls.localize('terminal', "Terminal"),
title: { value: nls.localize('terminal', "Terminal"), original: 'Terminal' },
icon: terminalViewIcon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [TERMINAL_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]),
storageId: TERMINAL_VIEW_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ registerSingleton(ITestingDecorationsService, TestingDecorationService, Instanti

const viewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: Testing.ViewletId,
title: localize('test', "Testing"),
title: { value: localize('test', "Testing"), original: 'Testing' },
ctorDescriptor: new SyncDescriptor(TestingViewPaneContainer),
icon: testingViewIcon,
alwaysUseContainerInfo: true,
Expand All @@ -74,7 +74,7 @@ const viewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensio

const testResultsViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
id: Testing.ResultsPanelId,
title: localize('testResultsPanelName', "Test Results"),
title: { value: localize('testResultsPanelName', "Test Results"), original: 'Test Results' },
icon: testingResultsIcon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [Testing.ResultsPanelId, { mergeViewWithContainerWhenSingleView: true }]),
hideIfEmpty: true,
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { ViewContainerLocation, IViewContainersRegistry, Extensions, ViewContainer } from 'vs/workbench/common/views';
import { UserDataSyncDataViews } from 'vs/workbench/contrib/userDataSync/browser/userDataSyncViews';
import { IUserDataSyncWorkbenchService, getSyncAreaLabel, AccountStatus, CONTEXT_SYNC_STATE, CONTEXT_SYNC_ENABLEMENT, CONTEXT_ACCOUNT_STATE, CONFIGURE_SYNC_COMMAND_ID, SHOW_SYNC_LOG_COMMAND_ID, SYNC_VIEW_CONTAINER_ID, SYNC_TITLE, SYNC_VIEW_ICON, CONTEXT_HAS_CONFLICTS } from 'vs/workbench/services/userDataSync/common/userDataSync';
import { IUserDataSyncWorkbenchService, getSyncAreaLabel, AccountStatus, CONTEXT_SYNC_STATE, CONTEXT_SYNC_ENABLEMENT, CONTEXT_ACCOUNT_STATE, CONFIGURE_SYNC_COMMAND_ID, SHOW_SYNC_LOG_COMMAND_ID, SYNC_VIEW_CONTAINER_ID, SYNC_TITLE, SYNC_ORIGINAL_TITLE, SYNC_VIEW_ICON, CONTEXT_HAS_CONFLICTS } from 'vs/workbench/services/userDataSync/common/userDataSync';
import { Codicon } from 'vs/base/common/codicons';
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { Categories } from 'vs/platform/action/common/actionCommonCategories';
Expand Down Expand Up @@ -1134,7 +1134,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
return Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer(
{
id: SYNC_VIEW_CONTAINER_ID,
title: SYNC_TITLE,
title: { value: SYNC_TITLE, original: SYNC_ORIGINAL_TITLE },
ctorDescriptor: new SyncDescriptor(
ViewPaneContainer,
[SYNC_VIEW_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export interface IUserDataSyncConflictsView extends IView {
open(conflict: IResourcePreview): Promise<void>;
}

export const SYNC_ORIGINAL_TITLE = 'Settings Sync';
export const SYNC_TITLE = localize('sync category', "Settings Sync");

export const SYNC_VIEW_ICON = registerIcon('settings-sync-view-icon', Codicon.sync, localize('syncViewIcon', 'View icon of the Settings Sync view.'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
const container = this.viewContainersRegistry.registerViewContainer({
id,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [id, { mergeViewWithContainerWhenSingleView: true }]),
title: id, // we don't want to see this so using id
title: { value: id, original: id }, // we don't want to see this so using id
icon: location === ViewContainerLocation.Sidebar ? defaultViewIcon : undefined,
storageId: getViewContainerStorageId(id),
hideIfEmpty: true
Expand Down
Loading

0 comments on commit 3519b13

Please sign in to comment.