Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c923075943
|
@ -31,7 +31,7 @@ export interface ISuggestionItem {
|
|||
resolve(): TPromise<void>;
|
||||
}
|
||||
|
||||
export type SnippetConfig = 'top' | 'bottom' | 'inline' | 'none' | 'only';
|
||||
export type SnippetConfig = 'top' | 'bottom' | 'inline' | 'none';
|
||||
|
||||
export interface ISuggestOptions {
|
||||
groups?: ISuggestSupport[][];
|
||||
|
@ -122,12 +122,10 @@ function createSuggestionResolver(provider: ISuggestSupport, suggestion: ISugges
|
|||
}
|
||||
|
||||
function createSuggesionFilter(options: ISuggestOptions): (candidate: ISuggestion) => boolean {
|
||||
if (options.snippetConfig === 'only') {
|
||||
return suggestion => suggestion.type === 'snippet';
|
||||
} else if (options.snippetConfig === 'none') {
|
||||
if (options.snippetConfig === 'none') {
|
||||
return suggestion => suggestion.type !== 'snippet';
|
||||
} else {
|
||||
return _ => true;
|
||||
return () => true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,13 +83,4 @@ suite('Suggest', function () {
|
|||
assert.equal(items[0].suggestion.label, 'fff');
|
||||
});
|
||||
});
|
||||
|
||||
test('sort - snippet top', function () {
|
||||
return provideSuggestionItems(model, new Position(1, 1), { snippetConfig: 'only' }).then(items => {
|
||||
assert.equal(items.length, 2);
|
||||
assert.equal(items[0].suggestion.label, 'aaa');
|
||||
assert.equal(items[1].suggestion.label, 'zzz');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in a new issue