提交 04b5988d 编写于 作者: J Johannes Rieken

cleanup

上级 36edf0b5
......@@ -192,19 +192,6 @@ export class SnippetsRegistry {
result.suggestions.push(p);
});
// if (result.suggestions.length > 0) {
// if (word) {
// // Push also the current word as first suggestion, to avoid unexpected snippet acceptance on Enter.
// result.suggestions = result.suggestions.slice(0);
// result.suggestions.unshift({
// codeSnippet: word.word,
// label: word.word,
// type: 'text'
// });
// }
// result.incomplete = true;
// }
return result;
}
......@@ -219,20 +206,16 @@ export class SnippetsRegistry {
let snipppetsByMode = this._snippets[model.getModeId()];
if (snipppetsByMode) {
for (let path in snipppetsByMode) {
SnippetsRegistry._fillInSuggestion(snipppetsByMode[path], prefix, result);
const suggestions = snipppetsByMode[path];
if (suggestions) {
for (const suggestion of suggestions) {
if (strings.endsWith(prefix, suggestion.label)) {
result.push(suggestion);
}
}
}
}
}
return result;
}
private static _fillInSuggestion(suggestions: modes.ISuggestion[], prefix: string, bucket: modes.ISuggestion[]): void {
if (!suggestions) {
return;
}
for (const suggestion of suggestions) {
if (strings.endsWith(prefix, suggestion.label)) {
bucket.push(suggestion);
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册