Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vscode] Extend TextEditorLineNumbersStyle with Interval #13458

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## not yet released

- [core] Fix quickpick problems found in IDE testing [#13451](https://github.com/eclipse-theia/theia/pull/13451) - contributed on behalf of STMicroelectronics
- [plugin] Extend TextEditorLineNumbersStyle with Interval [#13458](https://github.com/eclipse-theia/theia/pull/13458) - contributed on behalf of STMicroelectronics

<a name="breaking_changes_not_yet_released">[Breaking Changes:](#breaking_changes_not_yet_released)</a>

Expand Down
8 changes: 7 additions & 1 deletion packages/plugin-ext/src/main/browser/text-editor-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,17 @@ export class TextEditorMain implements Disposable {
}

if (typeof newConfiguration.lineNumbers !== 'undefined') {
let lineNumbers: 'on' | 'off' | 'relative';
let lineNumbers: 'on' | 'off' | 'relative' | 'interval';
switch (newConfiguration.lineNumbers) {
case TextEditorLineNumbersStyle.On:
lineNumbers = 'on';
break;
case TextEditorLineNumbersStyle.Relative:
lineNumbers = 'relative';
break;
case TextEditorLineNumbersStyle.Interval:
lineNumbers = 'interval';
break;
default:
lineNumbers = 'off';
}
Expand Down Expand Up @@ -400,6 +403,9 @@ export class TextEditorPropertiesMain {
case monaco.editor.RenderLineNumbersType.Relative:
lineNumbers = TextEditorLineNumbersStyle.Relative;
break;
case monaco.editor.RenderLineNumbersType.Interval:
lineNumbers = TextEditorLineNumbersStyle.Interval;
break;
default:
lineNumbers = TextEditorLineNumbersStyle.On;
break;
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ export enum StatusBarAlignment {
export enum TextEditorLineNumbersStyle {
Off = 0,
On = 1,
Relative = 2
Relative = 2,
Interval = 3
}

/**
Expand Down
6 changes: 5 additions & 1 deletion packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,11 @@ export module '@theia/plugin' {
/**
* Render the line numbers with values relative to the primary cursor location.
*/
Relative = 2
Relative = 2,
/**
* Render the line numbers on every 10th line number.
*/
Interval = 3
}

/**
Expand Down
Loading