mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
@@ -55,28 +55,28 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider
|
||||
}
|
||||
}
|
||||
|
||||
for (var name in phpGlobals.globalvariables) {
|
||||
if (phpGlobals.globalvariables.hasOwnProperty(name) && matches(name)) {
|
||||
added[name] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Variable, name, phpGlobals.globalvariables[name]));
|
||||
for (var globalvariables in phpGlobals.globalvariables) {
|
||||
if (phpGlobals.globalvariables.hasOwnProperty(globalvariables) && matches(globalvariables)) {
|
||||
added[globalvariables] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Variable, globalvariables, phpGlobals.globalvariables[globalvariables]));
|
||||
}
|
||||
}
|
||||
for (var name in phpGlobals.globalfunctions) {
|
||||
if (phpGlobals.globalfunctions.hasOwnProperty(name) && matches(name)) {
|
||||
added[name] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Function, name, phpGlobals.globalfunctions[name]));
|
||||
for (var globalfunctions in phpGlobals.globalfunctions) {
|
||||
if (phpGlobals.globalfunctions.hasOwnProperty(globalfunctions) && matches(globalfunctions)) {
|
||||
added[globalfunctions] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Function, globalfunctions, phpGlobals.globalfunctions[globalfunctions]));
|
||||
}
|
||||
}
|
||||
for (var name in phpGlobals.compiletimeconstants) {
|
||||
if (phpGlobals.compiletimeconstants.hasOwnProperty(name) && matches(name)) {
|
||||
added[name] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Field, name, phpGlobals.compiletimeconstants[name]));
|
||||
for (var compiletimeconstants in phpGlobals.compiletimeconstants) {
|
||||
if (phpGlobals.compiletimeconstants.hasOwnProperty(compiletimeconstants) && matches(compiletimeconstants)) {
|
||||
added[compiletimeconstants] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Field, compiletimeconstants, phpGlobals.compiletimeconstants[compiletimeconstants]));
|
||||
}
|
||||
}
|
||||
for (var name in phpGlobals.keywords) {
|
||||
if (phpGlobals.keywords.hasOwnProperty(name) && matches(name)) {
|
||||
added[name] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Keyword, name, phpGlobals.keywords[name]));
|
||||
for (var keywords in phpGlobals.keywords) {
|
||||
if (phpGlobals.keywords.hasOwnProperty(keywords) && matches(keywords)) {
|
||||
added[keywords] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Keyword, keywords, phpGlobals.keywords[keywords]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,12 +93,12 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider
|
||||
}
|
||||
}
|
||||
var functionMatch = /function\s+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*\(/g;
|
||||
var match: RegExpExecArray | null = null;
|
||||
while (match = functionMatch.exec(text)) {
|
||||
var word = match[1];
|
||||
if (!added[word]) {
|
||||
added[word] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Function, word, null));
|
||||
var match2: RegExpExecArray | null = null;
|
||||
while (match2 = functionMatch.exec(text)) {
|
||||
var word2 = match2[1];
|
||||
if (!added[word2]) {
|
||||
added[word2] = true;
|
||||
result.push(createNewProposal(CompletionItemKind.Function, word2, null));
|
||||
}
|
||||
}
|
||||
return Promise.resolve(result);
|
||||
|
||||
Reference in New Issue
Block a user