minor changes which fixes #42795

This commit is contained in:
Benas Svipas 2018-02-06 08:56:44 +02:00 committed by svipben
parent 0c7afa823e
commit f2e1b405ed
3 changed files with 6 additions and 6 deletions

View file

@ -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;
@ -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),
@ -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,

View file

@ -165,7 +165,7 @@ export class PrefixMemory extends Memory {
}
}
export type MemMode = 'first' | 'byRecency' | 'byPrefix';
export type MemMode = 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';
export class SuggestMemories {
@ -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);

2
src/vs/monaco.d.ts vendored
View file

@ -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;