Skip to content

Commit 5b41a13

Browse files
committed
don't make protected inherited properties/method public. this hurts minification.
there is still plenty of cases left: either in tests that make "internals" accessible or in the composite land
1 parent 201e6a3 commit 5b41a13

File tree

32 files changed

+57
-60
lines changed

32 files changed

+57
-60
lines changed

src/vs/base/browser/ui/actionbar/actionViewItems.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,13 @@ export class ActionViewItem extends BaseActionViewItem {
334334
}
335335
}
336336

337-
override updateLabel(): void {
337+
protected override updateLabel(): void {
338338
if (this.options.label && this.label) {
339339
this.label.textContent = this.action.label;
340340
}
341341
}
342342

343-
override getTooltip() {
343+
protected override getTooltip() {
344344
let title: string | null = null;
345345

346346
if (this.action.tooltip) {
@@ -356,7 +356,7 @@ export class ActionViewItem extends BaseActionViewItem {
356356
return title ?? undefined;
357357
}
358358

359-
override updateClass(): void {
359+
protected override updateClass(): void {
360360
if (this.cssClass && this.label) {
361361
this.label.classList.remove(...this.cssClass.split(' '));
362362
}
@@ -377,7 +377,7 @@ export class ActionViewItem extends BaseActionViewItem {
377377
}
378378
}
379379

380-
override updateEnabled(): void {
380+
protected override updateEnabled(): void {
381381
if (this.action.enabled) {
382382
if (this.label) {
383383
this.label.removeAttribute('aria-disabled');
@@ -395,14 +395,14 @@ export class ActionViewItem extends BaseActionViewItem {
395395
}
396396
}
397397

398-
override updateAriaLabel(): void {
398+
protected override updateAriaLabel(): void {
399399
if (this.label) {
400400
const title = this.getTooltip() ?? '';
401401
this.label.setAttribute('aria-label', title);
402402
}
403403
}
404404

405-
override updateChecked(): void {
405+
protected override updateChecked(): void {
406406
if (this.label) {
407407
if (this.action.checked) {
408408
this.label.classList.add('checked');

src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
131131
this.updateEnabled();
132132
}
133133

134-
override getTooltip(): string | undefined {
134+
protected override getTooltip(): string | undefined {
135135
let title: string | null = null;
136136

137137
if (this.action.tooltip) {
@@ -233,5 +233,3 @@ export class ActionWithDropdownActionViewItem extends ActionViewItem {
233233
this.dropdownMenuActionViewItem?.setFocusable(focusable);
234234
}
235235
}
236-
237-

src/vs/base/browser/ui/menu/menu.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
564564
}
565565
}
566566

567-
override updateLabel(): void {
567+
protected override updateLabel(): void {
568568
if (!this.label) {
569569
return;
570570
}
@@ -615,11 +615,11 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
615615
}
616616
}
617617

618-
override updateTooltip(): void {
618+
protected override updateTooltip(): void {
619619
// menus should function like native menus and they do not have tooltips
620620
}
621621

622-
override updateClass(): void {
622+
protected override updateClass(): void {
623623
if (this.cssClass && this.item) {
624624
this.item.classList.remove(...this.cssClass.split(' '));
625625
}
@@ -635,7 +635,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
635635
}
636636
}
637637

638-
override updateEnabled(): void {
638+
protected override updateEnabled(): void {
639639
if (this.action.enabled) {
640640
if (this.element) {
641641
this.element.classList.remove('disabled');
@@ -660,7 +660,7 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
660660
}
661661
}
662662

663-
override updateChecked(): void {
663+
protected override updateChecked(): void {
664664
if (!this.item) {
665665
return;
666666
}
@@ -805,7 +805,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
805805
}));
806806
}
807807

808-
override updateEnabled(): void {
808+
protected override updateEnabled(): void {
809809
// override on submenu entry
810810
// native menus do not observe enablement on sumbenus
811811
// we mimic that behavior

src/vs/base/browser/ui/toggle/toggle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class ToggleActionViewItem extends BaseActionViewItem {
5959
this.element.appendChild(this.toggle.domNode);
6060
}
6161

62-
override updateEnabled(): void {
62+
protected override updateEnabled(): void {
6363
if (this.toggle) {
6464
if (this.isEnabled()) {
6565
this.toggle.enable();
@@ -69,7 +69,7 @@ export class ToggleActionViewItem extends BaseActionViewItem {
6969
}
7070
}
7171

72-
override updateChecked(): void {
72+
protected override updateChecked(): void {
7373
this.toggle.checked = !!this._action.checked;
7474
}
7575

src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ export class MarkerNavigationWidget extends PeekViewWidget {
382382
this._container.style.height = `${heightInPixel}px`;
383383
}
384384

385-
public override _onWidth(widthInPixel: number): void {
385+
protected override _onWidth(widthInPixel: number): void {
386386
this._message.layout(this._heightInPixel, widthInPixel);
387387
}
388388

src/vs/editor/contrib/gotoSymbol/browser/goToCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ CommandsRegistry.registerCommand({
816816

817817
return editor.invokeWithinContext(accessor => {
818818
const command = new class extends GenericGoToLocationAction {
819-
override _getNoResultFoundMessage(info: IWordAtPosition | null) {
819+
protected override _getNoResultFoundMessage(info: IWordAtPosition | null) {
820820
return noResultsMessage || super._getNoResultFoundMessage(info);
821821
}
822822
}({

src/vs/editor/contrib/linesOperations/browser/linesOperations.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
660660
});
661661
}
662662

663-
_getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[] {
663+
protected _getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[] {
664664
let endPrimaryCursor: Selection | null = null;
665665
const endCursorState: Selection[] = [];
666666
let deletedLines = 0;
@@ -690,7 +690,7 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
690690
return endCursorState;
691691
}
692692

693-
_getRangesToDelete(editor: IActiveCodeEditor): Range[] {
693+
protected _getRangesToDelete(editor: IActiveCodeEditor): Range[] {
694694
const selections = editor.getSelections();
695695
if (selections === null) {
696696
return [];
@@ -738,7 +738,7 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
738738
});
739739
}
740740

741-
_getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[] {
741+
protected _getEndCursorState(primaryCursor: Range, rangesToDelete: Range[]): Selection[] {
742742
let endPrimaryCursor: Selection | null = null;
743743
const endCursorState: Selection[] = [];
744744
for (let i = 0, len = rangesToDelete.length, offset = 0; i < len; i++) {
@@ -759,7 +759,7 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
759759
return endCursorState;
760760
}
761761

762-
_getRangesToDelete(editor: IActiveCodeEditor): Range[] {
762+
protected _getRangesToDelete(editor: IActiveCodeEditor): Range[] {
763763
const model = editor.getModel();
764764
if (model === null) {
765765
return [];

src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
1717

1818
class StatusBarViewItem extends MenuEntryActionViewItem {
1919

20-
override updateLabel() {
20+
protected override updateLabel() {
2121
const kb = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService);
2222
if (!kb) {
2323
return super.updateLabel();

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ export class MenuEntryActionViewItem extends ActionViewItem {
195195
}));
196196
}
197197

198-
override updateLabel(): void {
198+
protected override updateLabel(): void {
199199
if (this.options.label && this.label) {
200200
this.label.textContent = this._commandAction.label;
201201
}
202202
}
203203

204-
override getTooltip() {
204+
protected override getTooltip() {
205205
const keybinding = this._keybindingService.lookupKeybinding(this._commandAction.id, this._contextKeyService);
206206
const keybindingLabel = keybinding && keybinding.getLabel();
207207

@@ -222,7 +222,7 @@ export class MenuEntryActionViewItem extends ActionViewItem {
222222
return title;
223223
}
224224

225-
override updateClass(): void {
225+
protected override updateClass(): void {
226226
if (this.options.icon) {
227227
if (this._commandAction !== this._menuItemAction) {
228228
if (this._menuItemAction.alt) {
@@ -382,7 +382,7 @@ export class DropdownWithDefaultActionViewItem extends BaseActionViewItem {
382382
this._defaultAction.dispose();
383383
this._defaultAction = this._instaService.createInstance(MenuEntryActionViewItem, lastAction, { keybinding: this._getDefaultActionKeybindingLabel(lastAction) });
384384
this._defaultAction.actionRunner = new class extends ActionRunner {
385-
override async runAction(action: IAction, context?: unknown): Promise<void> {
385+
protected override async runAction(action: IAction, context?: unknown): Promise<void> {
386386
await action.run(undefined);
387387
}
388388
}();

src/vs/platform/userDataSync/common/globalStateSync.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export class GlobalStateInitializer extends AbstractInitializer {
408408
super(SyncResource.GlobalState, userDataProfilesService, environmentService, logService, fileService, storageService, uriIdentityService);
409409
}
410410

411-
async doInitialize(remoteUserData: IRemoteUserData): Promise<void> {
411+
protected async doInitialize(remoteUserData: IRemoteUserData): Promise<void> {
412412
const remoteGlobalState: IGlobalState = remoteUserData.syncData ? JSON.parse(remoteUserData.syncData.content) : null;
413413
if (!remoteGlobalState) {
414414
this.logService.info('Skipping initializing global state because remote global state does not exist.');
@@ -506,4 +506,3 @@ export class UserDataSyncStoreTypeSynchronizer {
506506
}
507507

508508
}
509-

0 commit comments

Comments
 (0)