close
Skip to content

fix: make protected members public to resolve mangler build errors#310195

Merged
bpasero merged 2 commits intomicrosoft:mainfrom
CodeEditorLand:fix-310191
Apr 16, 2026
Merged

fix: make protected members public to resolve mangler build errors#310195
bpasero merged 2 commits intomicrosoft:mainfrom
CodeEditorLand:fix-310191

Conversation

@NikolaRHristov
Copy link
Copy Markdown
Contributor

setEditorVisible in editorPane.ts and _enableCommandLineSandboxRewriting in runInTerminalTool.ts were declared as protected but accessed publicly by subclasses (chatDebugEditor.ts and runInTerminalConfirmationTool.ts respectively), causing the mangler to promote them to public and then error with "Protected fields have been made PUBLIC".

Explicitly mark both members as public to satisfy the mangler and allow compile-build-with-mangling to complete successfully.

Fixes #310191

@NikolaRHristov
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="PlayForm"

@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented Apr 15, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/browser/parts/editor/editorPane.ts

@pwang347
Copy link
Copy Markdown
Member

@NikolaRHristov thanks for opening a PR, I think we should just add override to the subclasses though right?

@NikolaRHristov
Copy link
Copy Markdown
Contributor Author

@bpasero bpasero assigned bpasero and unassigned pwang347 Apr 16, 2026
Copy link
Copy Markdown
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding this but the better fix imho is to keep the methods protected and fix the overrides that accidentally make it public. Can you do that instead?

`setEditorVisible` in `editorPane.ts` and `_enableCommandLineSandboxRewriting`
in `runInTerminalTool.ts` were declared as `protected` but accessed publicly
by subclasses (`chatDebugEditor.ts` and `runInTerminalConfirmationTool.ts`
respectively), causing the mangler to promote them to public and then
error with "Protected fields have been made PUBLIC".

Explicitly mark both members as `public` to satisfy the mangler and
allow `compile-build-with-mangling` to complete successfully.

Fixes microsoft#310191
…nsistently

The mangler build was failing with "Protected fields have been made PUBLIC" errors because subclasses were explicitly declaring `override` with different visibility than their parent classes. This commit ensures consistent protected visibility across the inheritance chain:

1. `setEditorVisible()` in `editorPane.ts` - changed from `public` to `protected`, and the override in `chatDebugEditor.ts` changed from `public override` to `protected override`
2. `_enableCommandLineSandboxRewriting` getter in `runInTerminalTool.ts` - changed from `public` to `protected`, and the override in `runInTerminalConfirmationTool.ts` changed to `protected override`
3. `createMainEditorPart()` in `editorParts.ts` - explicitly marked as `protected override` for clarity

These changes allow the `compile-build-with-mangling` task to complete successfully.
@NikolaRHristov
Copy link
Copy Markdown
Contributor Author

@bpasero Done.

@NikolaRHristov NikolaRHristov requested a review from bpasero April 16, 2026 11:14
@bpasero bpasero enabled auto-merge (squash) April 16, 2026 12:10
@bpasero bpasero merged commit 07013e4 into microsoft:main Apr 16, 2026
54 of 56 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.117.0 milestone Apr 16, 2026
@NikolaRHristov NikolaRHristov deleted the fix-310191 branch April 16, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERROR: Protected fields have been made PUBLIC.

4 participants