Skip to content

"editor.suggestSelection" fix #42795 #43016

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

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions src/vs/editor/common/config/editorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ export interface EditorContribOptions {
readonly acceptSuggestionOnCommitCharacter: boolean;
readonly snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none';
readonly wordBasedSuggestions: boolean;
readonly suggestSelection: 'first' | 'byRecency' | 'byPrefix';
readonly suggestSelection: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';
readonly suggestFontSize: number;
readonly suggestLineHeight: number;
readonly selectionHighlight: boolean;
Expand Down Expand Up @@ -1712,7 +1712,7 @@ export class EditorOptionsValidator {
acceptSuggestionOnCommitCharacter: _boolean(opts.acceptSuggestionOnCommitCharacter, defaults.acceptSuggestionOnCommitCharacter),
snippetSuggestions: _stringSet<'top' | 'bottom' | 'inline' | 'none'>(opts.snippetSuggestions, defaults.snippetSuggestions, ['top', 'bottom', 'inline', 'none']),
wordBasedSuggestions: _boolean(opts.wordBasedSuggestions, defaults.wordBasedSuggestions),
suggestSelection: _stringSet<'first' | 'byRecency' | 'byPrefix'>(opts.suggestSelection, defaults.suggestSelection, ['first', 'byRecency', 'byPrefix']),
suggestSelection: _stringSet<'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'>(opts.suggestSelection, defaults.suggestSelection, ['first', 'recentlyUsed', 'recentlyUsedByPrefix']),
suggestFontSize: _clampedInt(opts.suggestFontSize, defaults.suggestFontSize, 0, 1000),
suggestLineHeight: _clampedInt(opts.suggestLineHeight, defaults.suggestLineHeight, 0, 1000),
selectionHighlight: _boolean(opts.selectionHighlight, defaults.selectionHighlight),
Expand Down Expand Up @@ -2268,7 +2268,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
acceptSuggestionOnCommitCharacter: true,
snippetSuggestions: 'inline',
wordBasedSuggestions: true,
suggestSelection: 'byRecency',
suggestSelection: 'recentlyUsed',
suggestFontSize: 0,
suggestLineHeight: 0,
selectionHighlight: true,
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/suggest/suggestMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class PrefixMemory extends Memory {
}
}

export type MemMode = 'first' | 'byRecency' | 'byPrefix';
export type MemMode = 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';

export class SuggestMemories {

Expand All @@ -188,7 +188,7 @@ export class SuggestMemories {
return;
}
this._mode = mode;
this._strategy = mode === 'byPrefix' ? new PrefixMemory() : mode === 'byRecency' ? new LRUMemory() : new NoMemory();
this._strategy = mode === 'recentlyUsedByPrefix' ? new PrefixMemory() : mode === 'recentlyUsed' ? new LRUMemory() : new NoMemory();

try {
const raw = this._storageService.get(`${this._storagePrefix}/${this._mode}`, StorageScope.WORKSPACE);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3052,7 +3052,7 @@ declare module monaco.editor {
readonly acceptSuggestionOnCommitCharacter: boolean;
readonly snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none';
readonly wordBasedSuggestions: boolean;
readonly suggestSelection: 'first' | 'byRecency' | 'byPrefix';
readonly suggestSelection: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';
readonly suggestFontSize: number;
readonly suggestLineHeight: number;
readonly selectionHighlight: boolean;
Expand Down