fix tslint in hygiene

fixes #38207
This commit is contained in:
Joao Moreno
2017-11-13 11:32:38 +01:00
parent 08d0aa5949
commit 7a01db1b43
10 changed files with 58 additions and 89 deletions

View File

@@ -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);