[php] missing user code auto-complete on 0.10.1 #161

This commit is contained in:
Martin Aeschlimann
2015-12-03 17:38:01 +01:00
parent 3399962d42
commit 2b7dccce56
2 changed files with 27 additions and 12 deletions

View File

@@ -61,7 +61,17 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider
while (match = variableMatch.exec(text)) {
var word = match[0];
if (!added[word]) {
result.push(createNewProposal(CompletionItemKind.Variable, name, null));
added[word] = true;
result.push(createNewProposal(CompletionItemKind.Variable, word, null));
}
}
var functionMatch = /function\s+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*\(/g;
var match : RegExpExecArray = null;
while (match = functionMatch.exec(text)) {
var word = match[1];
if (!added[word]) {
added[word] = true;
result.push(createNewProposal(CompletionItemKind.Function, word, null));
}
}
return Promise.resolve(result);