Using computed editor options instead of direct values #300868
Merged
Using computed editor options instead of direct values #300868
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors editor line-wrapping / line-break computation to pass around computed editor options (IComputedEditorOptions) instead of individual option values, and updates affected unit tests and view model plumbing accordingly.
Changes:
- Change
ILineBreaksComputerFactory.createLineBreaksComputerto acceptIComputedEditorOptions+tabSize(instead offontInfo/wrapping parameters). - Update view model line wrapping (
ViewModelLinesFromProjectedModel) and configuration-change handling to forward computed options. - Update related browser/common line break computers and tests to use the new API shape.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/editor/test/browser/viewModel/monospaceLineBreaksComputer.test.ts | Updates test setup to construct ComputedEditorOptions for the new factory signature. |
| src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts | Updates ViewModelLinesFromProjectedModel construction to pass computed options. |
| src/vs/editor/common/viewModel/viewModelLines.ts | Refactors wrapping settings handling to use ConfigurationChangedEvent + computed options. |
| src/vs/editor/common/viewModel/viewModelImpl.ts | Updates view model construction and config-change path to pass computed options through. |
| src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts | Refactors monospace line break computation to read needed values from computed options. |
| src/vs/editor/common/modelLineProjectionData.ts | Updates the ILineBreaksComputerFactory interface to the new signature. |
| src/vs/editor/browser/view/domLineBreaksComputer.ts | Refactors DOM-based line break computation to read needed values from computed options. |
Comments suppressed due to low confidence (1)
src/vs/editor/test/browser/viewModel/monospaceLineBreaksComputer.test.ts:80
- This test now sets
EditorOption.wordWrapColumn, but the line breaking code should be driven by the effective wrapping column (EditorOption.wrappingInfo.wrappingColumn). Once the production code is corrected to usewrappingInfo, update the test to write awrappingInfovalue (withwrappingColumn: breakAfter) instead of settingwordWrapColumndirectly.
Yoyokrazy
approved these changes
Mar 11, 2026
justschen
added a commit
that referenced
this pull request
Mar 12, 2026
…)" This reverts commit 446c755.
justschen
added a commit
that referenced
this pull request
Mar 12, 2026
…)" This reverts commit 446c755.
justschen
added a commit
that referenced
this pull request
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.