Skip to content

Commit fea0ee3

Browse files
committed
Fixes microsoft#57411: Rename autoWrapping to autoSurround to avoid confusions related to text wrapping
1 parent 1e16441 commit fea0ee3

7 files changed

Lines changed: 39 additions & 39 deletions

File tree

src/vs/editor/common/config/commonEditorConfig.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,17 +524,17 @@ const editorConfiguration: IConfigurationNode = {
524524
'default': EDITOR_DEFAULTS.autoClosingQuotes,
525525
'description': nls.localize('autoClosingQuotes', "Controls whether the editor should automatically close quotes after the user adds an opening quote.")
526526
},
527-
'editor.autoWrapping': {
527+
'editor.autoSurround': {
528528
type: 'string',
529529
enum: ['always', 'brackets', 'quotes', 'never'],
530530
enumDescriptions: [
531531
'',
532-
nls.localize('editor.autoWrapping.brackets', "Wrap with brackets but not quotes."),
533-
nls.localize('editor.autoWrapping.quotes', "Wrap with quotes but not brackets."),
532+
nls.localize('editor.autoSurround.brackets', "Surround with brackets but not quotes."),
533+
nls.localize('editor.autoSurround.quotes', "Surround with quotes but not brackets."),
534534
''
535535
],
536-
'default': EDITOR_DEFAULTS.autoWrapping,
537-
'description': nls.localize('autoWrapping', "Controls whether the editor should automatically wrap selections.")
536+
'default': EDITOR_DEFAULTS.autoSurround,
537+
'description': nls.localize('autoSurround', "Controls whether the editor should automatically surround selections.")
538538
},
539539
'editor.formatOnType': {
540540
'type': 'boolean',

src/vs/editor/common/config/editorOptions.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export type EditorAutoClosingStrategy = 'always' | 'languageDefined' | 'beforeWh
103103
/**
104104
* Configuration options for auto wrapping quotes and brackets
105105
*/
106-
export type EditorAutoWrappingStrategy = 'always' | 'quotes' | 'brackets' | 'never';
106+
export type EditorAutoSurroundStrategy = 'always' | 'quotes' | 'brackets' | 'never';
107107

108108
/**
109109
* Configuration options for editor minimap
@@ -496,10 +496,10 @@ export interface IEditorOptions {
496496
*/
497497
autoClosingQuotes?: EditorAutoClosingStrategy;
498498
/**
499-
* Options for autowrapping.
500-
* Defaults to always allowing autowrapping.
499+
* Options for auto surrounding.
500+
* Defaults to always allowing auto surrounding.
501501
*/
502-
autoWrapping?: EditorAutoWrappingStrategy;
502+
autoSurround?: EditorAutoSurroundStrategy;
503503
/**
504504
* Enable auto indentation adjustment.
505505
* Defaults to false.
@@ -1002,7 +1002,7 @@ export interface IValidatedEditorOptions {
10021002
readonly wordWrapBreakObtrusiveCharacters: string;
10031003
readonly autoClosingBrackets: EditorAutoClosingStrategy;
10041004
readonly autoClosingQuotes: EditorAutoClosingStrategy;
1005-
readonly autoWrapping: EditorAutoWrappingStrategy;
1005+
readonly autoSurround: EditorAutoSurroundStrategy;
10061006
readonly autoIndent: boolean;
10071007
readonly dragAndDrop: boolean;
10081008
readonly emptySelectionClipboard: boolean;
@@ -1039,7 +1039,7 @@ export class InternalEditorOptions {
10391039
readonly wordSeparators: string;
10401040
readonly autoClosingBrackets: EditorAutoClosingStrategy;
10411041
readonly autoClosingQuotes: EditorAutoClosingStrategy;
1042-
readonly autoWrapping: EditorAutoWrappingStrategy;
1042+
readonly autoSurround: EditorAutoSurroundStrategy;
10431043
readonly autoIndent: boolean;
10441044
readonly useTabStops: boolean;
10451045
readonly tabFocusMode: boolean;
@@ -1068,7 +1068,7 @@ export class InternalEditorOptions {
10681068
wordSeparators: string;
10691069
autoClosingBrackets: EditorAutoClosingStrategy;
10701070
autoClosingQuotes: EditorAutoClosingStrategy;
1071-
autoWrapping: EditorAutoWrappingStrategy;
1071+
autoSurround: EditorAutoSurroundStrategy;
10721072
autoIndent: boolean;
10731073
useTabStops: boolean;
10741074
tabFocusMode: boolean;
@@ -1092,7 +1092,7 @@ export class InternalEditorOptions {
10921092
this.wordSeparators = source.wordSeparators;
10931093
this.autoClosingBrackets = source.autoClosingBrackets;
10941094
this.autoClosingQuotes = source.autoClosingQuotes;
1095-
this.autoWrapping = source.autoWrapping;
1095+
this.autoSurround = source.autoSurround;
10961096
this.autoIndent = source.autoIndent;
10971097
this.useTabStops = source.useTabStops;
10981098
this.tabFocusMode = source.tabFocusMode;
@@ -1122,7 +1122,7 @@ export class InternalEditorOptions {
11221122
&& this.wordSeparators === other.wordSeparators
11231123
&& this.autoClosingBrackets === other.autoClosingBrackets
11241124
&& this.autoClosingQuotes === other.autoClosingQuotes
1125-
&& this.autoWrapping === other.autoWrapping
1125+
&& this.autoSurround === other.autoSurround
11261126
&& this.autoIndent === other.autoIndent
11271127
&& this.useTabStops === other.useTabStops
11281128
&& this.tabFocusMode === other.tabFocusMode
@@ -1153,7 +1153,7 @@ export class InternalEditorOptions {
11531153
wordSeparators: (this.wordSeparators !== newOpts.wordSeparators),
11541154
autoClosingBrackets: (this.autoClosingBrackets !== newOpts.autoClosingBrackets),
11551155
autoClosingQuotes: (this.autoClosingQuotes !== newOpts.autoClosingQuotes),
1156-
autoWrapping: (this.autoWrapping !== newOpts.autoWrapping),
1156+
autoSurround: (this.autoSurround !== newOpts.autoSurround),
11571157
autoIndent: (this.autoIndent !== newOpts.autoIndent),
11581158
useTabStops: (this.useTabStops !== newOpts.useTabStops),
11591159
tabFocusMode: (this.tabFocusMode !== newOpts.tabFocusMode),
@@ -1536,7 +1536,7 @@ export interface IConfigurationChangedEvent {
15361536
readonly wordSeparators: boolean;
15371537
readonly autoClosingBrackets: boolean;
15381538
readonly autoClosingQuotes: boolean;
1539-
readonly autoWrapping: boolean;
1539+
readonly autoSurround: boolean;
15401540
readonly autoIndent: boolean;
15411541
readonly useTabStops: boolean;
15421542
readonly tabFocusMode: boolean;
@@ -1717,16 +1717,16 @@ export class EditorOptionsValidator {
17171717

17181718
let autoClosingBrackets: EditorAutoClosingStrategy;
17191719
let autoClosingQuotes: EditorAutoClosingStrategy;
1720-
let autoWrapping: EditorAutoWrappingStrategy;
1720+
let autoSurround: EditorAutoSurroundStrategy;
17211721
if (typeof opts.autoClosingBrackets === 'boolean' && opts.autoClosingBrackets === false) {
17221722
// backwards compatibility: disable all on boolean false
17231723
autoClosingBrackets = 'never';
17241724
autoClosingQuotes = 'never';
1725-
autoWrapping = 'never';
1725+
autoSurround = 'never';
17261726
} else {
17271727
autoClosingBrackets = _stringSet<EditorAutoClosingStrategy>(opts.autoClosingBrackets, defaults.autoClosingBrackets, ['always', 'languageDefined', 'beforeWhitespace', 'never']);
17281728
autoClosingQuotes = _stringSet<EditorAutoClosingStrategy>(opts.autoClosingQuotes, defaults.autoClosingQuotes, ['always', 'languageDefined', 'beforeWhitespace', 'never']);
1729-
autoWrapping = _stringSet<EditorAutoWrappingStrategy>(opts.autoWrapping, defaults.autoWrapping, ['always', 'brackets', 'quotes', 'never'], );
1729+
autoSurround = _stringSet<EditorAutoSurroundStrategy>(opts.autoSurround, defaults.autoSurround, ['always', 'brackets', 'quotes', 'never'], );
17301730
}
17311731

17321732
return {
@@ -1747,7 +1747,7 @@ export class EditorOptionsValidator {
17471747
wordWrapBreakObtrusiveCharacters: _string(opts.wordWrapBreakObtrusiveCharacters, defaults.wordWrapBreakObtrusiveCharacters),
17481748
autoClosingBrackets,
17491749
autoClosingQuotes,
1750-
autoWrapping,
1750+
autoSurround,
17511751
autoIndent: _boolean(opts.autoIndent, defaults.autoIndent),
17521752
dragAndDrop: _boolean(opts.dragAndDrop, defaults.dragAndDrop),
17531753
emptySelectionClipboard: _boolean(opts.emptySelectionClipboard, defaults.emptySelectionClipboard),
@@ -2030,7 +2030,7 @@ export class InternalEditorOptionsFactory {
20302030
wordWrapBreakObtrusiveCharacters: opts.wordWrapBreakObtrusiveCharacters,
20312031
autoClosingBrackets: opts.autoClosingBrackets,
20322032
autoClosingQuotes: opts.autoClosingQuotes,
2033-
autoWrapping: opts.autoWrapping,
2033+
autoSurround: opts.autoSurround,
20342034
autoIndent: opts.autoIndent,
20352035
dragAndDrop: opts.dragAndDrop,
20362036
emptySelectionClipboard: opts.emptySelectionClipboard,
@@ -2253,7 +2253,7 @@ export class InternalEditorOptionsFactory {
22532253
wordSeparators: opts.wordSeparators,
22542254
autoClosingBrackets: opts.autoClosingBrackets,
22552255
autoClosingQuotes: opts.autoClosingQuotes,
2256-
autoWrapping: opts.autoWrapping,
2256+
autoSurround: opts.autoSurround,
22572257
autoIndent: opts.autoIndent,
22582258
useTabStops: opts.useTabStops,
22592259
tabFocusMode: opts.readOnly ? true : env.tabFocusMode,
@@ -2488,7 +2488,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
24882488
wordWrapBreakObtrusiveCharacters: '.',
24892489
autoClosingBrackets: 'languageDefined',
24902490
autoClosingQuotes: 'languageDefined',
2491-
autoWrapping: 'always',
2491+
autoSurround: 'always',
24922492
autoIndent: true,
24932493
dragAndDrop: true,
24942494
emptySelectionClipboard: true,

src/vs/editor/common/controller/cursorCommon.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo
1515
import { onUnexpectedError } from 'vs/base/common/errors';
1616
import { LanguageIdentifier } from 'vs/editor/common/modes';
1717
import { IAutoClosingPair } from 'vs/editor/common/modes/languageConfiguration';
18-
import { IConfigurationChangedEvent, EditorAutoClosingStrategy, EditorAutoWrappingStrategy } from 'vs/editor/common/config/editorOptions';
18+
import { IConfigurationChangedEvent, EditorAutoClosingStrategy, EditorAutoSurroundStrategy } from 'vs/editor/common/config/editorOptions';
1919
import { IViewModel } from 'vs/editor/common/viewModel/viewModel';
2020
import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents';
2121
import { VerticalRevealType } from 'vs/editor/common/view/viewEvents';
@@ -85,7 +85,7 @@ export class CursorConfiguration {
8585
public readonly multiCursorMergeOverlapping: boolean;
8686
public readonly autoClosingBrackets: EditorAutoClosingStrategy;
8787
public readonly autoClosingQuotes: EditorAutoClosingStrategy;
88-
public readonly autoWrapping: EditorAutoWrappingStrategy;
88+
public readonly autoSurround: EditorAutoSurroundStrategy;
8989
public readonly autoIndent: boolean;
9090
public readonly autoClosingPairsOpen: CharacterMap;
9191
public readonly autoClosingPairsClose: CharacterMap;
@@ -103,7 +103,7 @@ export class CursorConfiguration {
103103
|| e.multiCursorMergeOverlapping
104104
|| e.autoClosingBrackets
105105
|| e.autoClosingQuotes
106-
|| e.autoWrapping
106+
|| e.autoSurround
107107
|| e.useTabStops
108108
|| e.lineHeight
109109
|| e.readOnly
@@ -132,7 +132,7 @@ export class CursorConfiguration {
132132
this.multiCursorMergeOverlapping = c.multiCursorMergeOverlapping;
133133
this.autoClosingBrackets = c.autoClosingBrackets;
134134
this.autoClosingQuotes = c.autoClosingQuotes;
135-
this.autoWrapping = c.autoWrapping;
135+
this.autoSurround = c.autoSurround;
136136
this.autoIndent = c.autoIndent;
137137

138138
this.autoClosingPairsOpen = {};

src/vs/editor/common/controller/cursorTypeOperations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ export class TypeOperations {
589589

590590
private static _shouldSurroundChar(config: CursorConfiguration, ch: string): boolean {
591591
if (isQuote(ch)) {
592-
return (config.autoWrapping === 'quotes' || config.autoWrapping === 'always');
592+
return (config.autoSurround === 'quotes' || config.autoSurround === 'always');
593593
} else {
594594
// Character is a bracket
595-
return (config.autoWrapping === 'brackets' || config.autoWrapping === 'always');
595+
return (config.autoSurround === 'brackets' || config.autoSurround === 'always');
596596
}
597597
}
598598

src/vs/editor/test/browser/controller/cursor.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4277,7 +4277,7 @@ suite('autoClosingPairs', () => {
42774277
],
42784278
languageIdentifier: mode.getLanguageIdentifier(),
42794279
editorOpts: {
4280-
autoWrapping: 'never'
4280+
autoSurround: 'never'
42814281
}
42824282
}, (model, cursor) => {
42834283

@@ -4297,7 +4297,7 @@ suite('autoClosingPairs', () => {
42974297
],
42984298
languageIdentifier: mode.getLanguageIdentifier(),
42994299
editorOpts: {
4300-
autoWrapping: 'quotes'
4300+
autoSurround: 'quotes'
43014301
}
43024302
}, (model, cursor) => {
43034303

@@ -4320,7 +4320,7 @@ suite('autoClosingPairs', () => {
43204320
],
43214321
languageIdentifier: mode.getLanguageIdentifier(),
43224322
editorOpts: {
4323-
autoWrapping: 'brackets'
4323+
autoSurround: 'brackets'
43244324
}
43254325
}, (model, cursor) => {
43264326

src/vs/monaco.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ declare namespace monaco.editor {
24852485
/**
24862486
* Configuration options for auto wrapping quotes and brackets
24872487
*/
2488-
export type EditorAutoWrappingStrategy = 'always' | 'quotes' | 'brackets' | 'never';
2488+
export type EditorAutoSurroundStrategy = 'always' | 'quotes' | 'brackets' | 'never';
24892489

24902490
/**
24912491
* Configuration options for editor minimap
@@ -2870,10 +2870,10 @@ declare namespace monaco.editor {
28702870
*/
28712871
autoClosingQuotes?: EditorAutoClosingStrategy;
28722872
/**
2873-
* Options for autowrapping.
2874-
* Defaults to always allowing autowrapping.
2873+
* Options for auto surrounding.
2874+
* Defaults to always allowing auto surrounding.
28752875
*/
2876-
autoWrapping?: EditorAutoWrappingStrategy;
2876+
autoSurround?: EditorAutoSurroundStrategy;
28772877
/**
28782878
* Enable auto indentation adjustment.
28792879
* Defaults to false.
@@ -3309,7 +3309,7 @@ declare namespace monaco.editor {
33093309
readonly wordSeparators: string;
33103310
readonly autoClosingBrackets: EditorAutoClosingStrategy;
33113311
readonly autoClosingQuotes: EditorAutoClosingStrategy;
3312-
readonly autoWrapping: EditorAutoWrappingStrategy;
3312+
readonly autoSurround: EditorAutoSurroundStrategy;
33133313
readonly autoIndent: boolean;
33143314
readonly useTabStops: boolean;
33153315
readonly tabFocusMode: boolean;
@@ -3449,7 +3449,7 @@ declare namespace monaco.editor {
34493449
readonly wordSeparators: boolean;
34503450
readonly autoClosingBrackets: boolean;
34513451
readonly autoClosingQuotes: boolean;
3452-
readonly autoWrapping: boolean;
3452+
readonly autoSurround: boolean;
34533453
readonly autoIndent: boolean;
34543454
readonly useTabStops: boolean;
34553455
readonly tabFocusMode: boolean;

src/vs/platform/telemetry/common/telemetryUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const configurationValueWhitelist = [
117117
'editor.parameterHints.cycle',
118118
'editor.autoClosingBrackets',
119119
'editor.autoClosingQuotes',
120-
'editor.autoWrapping',
120+
'editor.autoSurround',
121121
'editor.autoIndent',
122122
'editor.formatOnType',
123123
'editor.formatOnPaste',

0 commit comments

Comments
 (0)