mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-05 15:36:22 +01:00
fixes #3815: [php] autocomplete is not showing user variables
This commit is contained in:
1 parent
4a51ef0742
commit
72e4ba9ae2
1 file changed
+2
-2
@@ -33,7 +33,7 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider
|
||||
};
|
||||
|
||||
var matches = (name:string) => {
|
||||
return prefix.length === 0 || name.length > prefix.length && name.substr(0, prefix.length) === prefix;
|
||||
return prefix.length === 0 || name.length >= prefix.length && name.substr(0, prefix.length) === prefix;
|
||||
};
|
||||
|
||||
for (var name in phpGlobals.globalvariables) {
|
||||
@@ -62,7 +62,7 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider
|
||||
}
|
||||
|
||||
var text = document.getText();
|
||||
if (matches('$')) {
|
||||
if (prefix[0] === '$') {
|
||||
var variableMatch = /\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)/g;
|
||||
var match : RegExpExecArray = null;
|
||||
while (match = variableMatch.exec(text)) {
|
||||
|
||||
Reference in new issue
Block a user