提交 9965a5d8 编写于 作者: J Johannes Rieken

tweak setting, update defaut to only suggest outside of comments and strings, #9504

上级 f54be931
......@@ -793,9 +793,9 @@ const editorConfiguration: IConfigurationNode = {
type: 'boolean',
description: nls.localize('wordBasedSuggestions.comments', "Enable word based suggestions inside comments.")
},
default: {
other: {
type: 'boolean',
description: nls.localize('wordBasedSuggestions.default', "Enable word based suggestions outside of strings and comments.")
description: nls.localize('wordBasedSuggestions.other', "Enable word based suggestions outside of strings and comments.")
},
}
}
......
......@@ -98,7 +98,7 @@ class ConfigClass implements IConfiguration {
acceptSuggestionOnCommitCharacter: true,
snippetSuggestions: 'bottom',
emptySelectionClipboard: true,
wordBasedSuggestions: true,
wordBasedSuggestions: { other: true, strings: false, comments: false },
suggestFontSize: 0,
suggestLineHeight: 0,
selectionHighlight: true,
......
......@@ -482,7 +482,7 @@ export interface IEditorOptions {
/**
* Enable word based suggestions. Defaults to 'true'
*/
wordBasedSuggestions?: boolean | { strings?: boolean, comments?: boolean, default?: boolean };
wordBasedSuggestions?: boolean | { strings?: boolean, comments?: boolean, other?: boolean };
/**
* The font size for the suggest widget.
* Defaults to the editor font size.
......
......@@ -105,7 +105,7 @@ class WordBasedCompletionItemProvider implements modes.ISuggestSupport {
const { tokenType } = tokens.findTokenAtOffset(position.column - 1);
const shoudSuggestHere = (tokenType === modes.StandardTokenType.Comment && wordBasedSuggestions.comments)
|| (tokenType === modes.StandardTokenType.String && wordBasedSuggestions.strings)
|| (tokenType === modes.StandardTokenType.Other && wordBasedSuggestions.default);
|| (tokenType === modes.StandardTokenType.Other && wordBasedSuggestions.other);
if (shoudSuggestHere) {
return this._workerManager.withWorker().then(client => client.textualSuggest(model.uri, position));
......
......@@ -1400,7 +1400,7 @@ declare module monaco.editor {
wordBasedSuggestions?: boolean | {
strings?: boolean;
comments?: boolean;
default?: boolean;
other?: boolean;
};
/**
* The font size for the suggest widget.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册