Skip to content

Commit ad635e6

Browse files
committed
rename setting to matchOnWordStartOnly
1 parent f8a03ae commit ad635e6

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ export interface IEditorOptions {
643643
/**
644644
* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
645645
*/
646-
allowMidWordMatch?: boolean;
646+
matchOnWordStartOnly?: boolean;
647647
/**
648648
* Control the behavior and rendering of the inline hints.
649649
*/
@@ -3936,7 +3936,7 @@ export interface ISuggestOptions {
39363936
/**
39373937
* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
39383938
*/
3939-
allowMidWordMatch?: boolean;
3939+
matchOnWordStartOnly?: boolean;
39403940
/**
39413941
* Show field-suggestions.
39423942
*/
@@ -4058,7 +4058,7 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, ISuggestOptio
40584058
showFunctions: true,
40594059
showConstructors: true,
40604060
showDeprecated: true,
4061-
allowMidWordMatch: false,
4061+
matchOnWordStartOnly: true,
40624062
showFields: true,
40634063
showVariables: true,
40644064
showClasses: true,
@@ -4165,10 +4165,10 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, ISuggestOptio
41654165
default: true,
41664166
markdownDescription: nls.localize('editor.suggest.showDeprecated', "When enabled IntelliSense shows `deprecated`-suggestions.")
41674167
},
4168-
'editor.suggest.allowMidWordMatch': {
4168+
'editor.suggest.matchOnWordStartOnly': {
41694169
type: 'boolean',
41704170
default: false,
4171-
markdownDescription: nls.localize('editor.suggest.allowMidWordMatch', "When enabled suggestions allow a first characer to be matched on a non-capital letter. This will provide more search results that may not be as accurate.")
4171+
markdownDescription: nls.localize('editor.suggest.matchOnWordStartOnly', "When enabled IntelliSense filtering requires that the first character matches on a word start, e.g `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")
41724172
},
41734173
'editor.suggest.showFields': {
41744174
type: 'boolean',
@@ -4319,7 +4319,7 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, ISuggestOptio
43194319
showFunctions: boolean(input.showFunctions, this.defaultValue.showFunctions),
43204320
showConstructors: boolean(input.showConstructors, this.defaultValue.showConstructors),
43214321
showDeprecated: boolean(input.showDeprecated, this.defaultValue.showDeprecated),
4322-
allowMidWordMatch: boolean(input.allowMidWordMatch, this.defaultValue.allowMidWordMatch),
4322+
matchOnWordStartOnly: boolean(input.matchOnWordStartOnly, this.defaultValue.matchOnWordStartOnly),
43234323
showFields: boolean(input.showFields, this.defaultValue.showFields),
43244324
showVariables: boolean(input.showVariables, this.defaultValue.showVariables),
43254325
showClasses: boolean(input.showClasses, this.defaultValue.showClasses),

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,10 @@ export class SuggestModel implements IDisposable {
526526
}
527527

528528
const ctx = new LineContext(model, this._editor.getPosition(), auto, context.shy, context.noSelect);
529-
const allowMidWordMatch = this._editor.getOption(EditorOption.suggest).allowMidWordMatch;
530-
const boostFullMatch = FuzzyScoreOptions.default.boostFullMatch;
531-
const fuzzySearchOptions = { firstMatchCanBeWeak: allowMidWordMatch, boostFullMatch: boostFullMatch };
529+
const fuzzySearchOptions = {
530+
...FuzzyScoreOptions.default,
531+
firstMatchCanBeWeak: this._editor.getOption(EditorOption.suggest).matchOnWordStartOnly
532+
};
532533
this._completionModel = new CompletionModel(items, this._context!.column, {
533534
leadingLineContent: ctx.leadingLineContent,
534535
characterCountDelta: ctx.column - this._context!.column

src/vs/monaco.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,7 +3428,7 @@ declare namespace monaco.editor {
34283428
/**
34293429
* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
34303430
*/
3431-
allowMidWordMatch?: boolean;
3431+
matchOnWordStartOnly?: boolean;
34323432
/**
34333433
* Control the behavior and rendering of the inline hints.
34343434
*/
@@ -4228,7 +4228,7 @@ declare namespace monaco.editor {
42284228
/**
42294229
* Controls whether suggestions allow matches in the middle of the word instead of only at the beginning
42304230
*/
4231-
allowMidWordMatch?: boolean;
4231+
matchOnWordStartOnly?: boolean;
42324232
/**
42334233
* Show field-suggestions.
42344234
*/

src/vs/workbench/services/extensions/common/extensionsApiProposals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const allApiProposals = Object.freeze({
2424
diffCommand: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts',
2525
documentFiltersExclusive: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts',
2626
documentPaste: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts',
27-
editorInsets: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts',
2827
editSessionIdentityProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts',
28+
editorInsets: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts',
2929
extensionRuntime: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts',
3030
extensionsAny: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts',
3131
externalUriOpener: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts',

0 commit comments

Comments
 (0)