mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 10:24:47 +00:00
update 'snippetSuggestions' config, #9286
This commit is contained in:
parent
1e27b8226d
commit
8b7906000e
5 changed files with 11 additions and 31 deletions
|
@ -261,7 +261,6 @@ class InternalEditorOptionsHelper {
|
|||
formatOnType: toBoolean(opts.formatOnType),
|
||||
suggestOnTriggerCharacters: toBoolean(opts.suggestOnTriggerCharacters),
|
||||
acceptSuggestionOnEnter: toBoolean(opts.acceptSuggestionOnEnter),
|
||||
snippetOrder: opts.snippetOrder,
|
||||
snippetSuggestions: opts.snippetSuggestions,
|
||||
selectionHighlight: toBoolean(opts.selectionHighlight),
|
||||
referenceInfos: toBoolean(opts.referenceInfos),
|
||||
|
@ -710,15 +709,10 @@ let editorConfiguration:IConfigurationNode = {
|
|||
'description': nls.localize('acceptSuggestionOnEnter', "Controls if suggestions should be accepted 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")
|
||||
},
|
||||
'editor.snippetSuggestions': {
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'description': nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions.")
|
||||
},
|
||||
'editor.snippetOrder': {
|
||||
'type': 'string',
|
||||
'enum': ['top', 'bottom', 'normal'],
|
||||
'default': 'normal',
|
||||
'description': nls.localize('snippetOrder', "Controls how snippets are sorted when shown with other suggestions.")
|
||||
'enum': ['top', 'bottom', 'inline', 'none'],
|
||||
'default': DefaultConfig.editor.snippetSuggestions,
|
||||
'description': nls.localize('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.")
|
||||
},
|
||||
'editor.selectionHighlight' : {
|
||||
'type': 'boolean',
|
||||
|
|
|
@ -83,8 +83,7 @@ class ConfigClass implements IConfiguration {
|
|||
formatOnType: false,
|
||||
suggestOnTriggerCharacters: true,
|
||||
acceptSuggestionOnEnter: true,
|
||||
snippetOrder: 'normal',
|
||||
snippetSuggestions: true,
|
||||
snippetSuggestions: 'inline',
|
||||
selectionHighlight: true,
|
||||
referenceInfos: true,
|
||||
folding: true,
|
||||
|
|
|
@ -391,11 +391,7 @@ export interface IEditorOptions {
|
|||
/**
|
||||
* Enable snippet suggestions. Default to 'true'.
|
||||
*/
|
||||
snippetSuggestions?: boolean;
|
||||
/**
|
||||
* Snippet sort order. Defaults to 'normal'.
|
||||
*/
|
||||
snippetOrder?: 'top' | 'bottom' | 'normal';
|
||||
snippetSuggestions?: 'top' | 'bottom' | 'inline' | 'none';
|
||||
/**
|
||||
* Enable selection highlight.
|
||||
* Defaults to true.
|
||||
|
@ -805,8 +801,7 @@ export class EditorContribOptions {
|
|||
formatOnType:boolean;
|
||||
suggestOnTriggerCharacters: boolean;
|
||||
acceptSuggestionOnEnter: boolean;
|
||||
snippetSuggestions: boolean;
|
||||
snippetOrder: 'top' | 'bottom' | 'normal';
|
||||
snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none';
|
||||
selectionHighlight:boolean;
|
||||
referenceInfos: boolean;
|
||||
folding: boolean;
|
||||
|
@ -825,8 +820,7 @@ export class EditorContribOptions {
|
|||
formatOnType:boolean;
|
||||
suggestOnTriggerCharacters: boolean;
|
||||
acceptSuggestionOnEnter: boolean;
|
||||
snippetSuggestions: boolean;
|
||||
snippetOrder: 'top' | 'bottom' | 'normal';
|
||||
snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none';
|
||||
selectionHighlight:boolean;
|
||||
referenceInfos: boolean;
|
||||
folding: boolean;
|
||||
|
@ -841,8 +835,7 @@ export class EditorContribOptions {
|
|||
this.formatOnType = Boolean(source.formatOnType);
|
||||
this.suggestOnTriggerCharacters = Boolean(source.suggestOnTriggerCharacters);
|
||||
this.acceptSuggestionOnEnter = Boolean(source.acceptSuggestionOnEnter);
|
||||
this.snippetSuggestions = Boolean(source.snippetSuggestions);
|
||||
this.snippetOrder = (source.snippetOrder || 'normal');
|
||||
this.snippetSuggestions = source.snippetSuggestions;
|
||||
this.selectionHighlight = Boolean(source.selectionHighlight);
|
||||
this.referenceInfos = Boolean(source.referenceInfos);
|
||||
this.folding = Boolean(source.folding);
|
||||
|
@ -864,7 +857,6 @@ export class EditorContribOptions {
|
|||
&& this.suggestOnTriggerCharacters === other.suggestOnTriggerCharacters
|
||||
&& this.acceptSuggestionOnEnter === other.acceptSuggestionOnEnter
|
||||
&& this.snippetSuggestions === other.snippetSuggestions
|
||||
&& this.snippetOrder === other.snippetOrder
|
||||
&& this.selectionHighlight === other.selectionHighlight
|
||||
&& this.referenceInfos === other.referenceInfos
|
||||
&& this.folding === other.folding
|
||||
|
|
|
@ -330,7 +330,7 @@ export class SuggestModel implements IDisposable {
|
|||
|
||||
const position = this.editor.getPosition();
|
||||
|
||||
this.requestPromise = provideSuggestionItems(model, position, groups).then(all => {
|
||||
this.requestPromise = provideSuggestionItems(model, position, { groups, snippetConfig: this.editor.getConfiguration().contribInfo.snippetSuggestions }).then(all => {
|
||||
this.requestPromise = null;
|
||||
|
||||
if (this.state === State.Idle) {
|
||||
|
|
9
src/vs/monaco.d.ts
vendored
9
src/vs/monaco.d.ts
vendored
|
@ -1245,11 +1245,7 @@ declare module monaco.editor {
|
|||
/**
|
||||
* Enable snippet suggestions. Default to 'true'.
|
||||
*/
|
||||
snippetSuggestions?: boolean;
|
||||
/**
|
||||
* Snippet sort order. Defaults to 'normal'.
|
||||
*/
|
||||
snippetOrder?: 'top' | 'bottom' | 'normal';
|
||||
snippetSuggestions?: 'top' | 'bottom' | 'inline' | 'none';
|
||||
/**
|
||||
* Enable selection highlight.
|
||||
* Defaults to true.
|
||||
|
@ -1412,8 +1408,7 @@ declare module monaco.editor {
|
|||
formatOnType: boolean;
|
||||
suggestOnTriggerCharacters: boolean;
|
||||
acceptSuggestionOnEnter: boolean;
|
||||
snippetSuggestions: boolean;
|
||||
snippetOrder: 'top' | 'bottom' | 'normal';
|
||||
snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none';
|
||||
selectionHighlight: boolean;
|
||||
referenceInfos: boolean;
|
||||
folding: boolean;
|
||||
|
|
Loading…
Reference in a new issue