Fix issue #51 - tab completion reporting incorrect globals

This commit is contained in:
walterhiggins 2013-02-02 13:15:32 +00:00
parent 4a586a115c
commit b34d456427

View file

@ -315,7 +315,7 @@ var server = org.bukkit.Bukkit.server;
if (statement.length == 0) if (statement.length == 0)
propsOfLastArg = _globalSymbols; propsOfLastArg = _globalSymbols;
else{ else{
var statementSyms = statement.split(/[^a-zA-Z0-9_\.]/); var statementSyms = statement.split(/[^\$a-zA-Z0-9_\.]/);
var lastSymbol = statementSyms[statementSyms.length-1]; var lastSymbol = statementSyms[statementSyms.length-1];
// //
// try to complete the object ala java IDEs. // try to complete the object ala java IDEs.
@ -359,8 +359,9 @@ var server = org.bukkit.Bukkit.server;
} }
}else{ }else{
var objectProps = _getProperties(symbol); var objectProps = _getProperties(symbol);
for (var i = 0; i < objectProps.length; i++) for (var i = 0; i < objectProps.length; i++){
propsOfLastArg.push(statement + objectProps[i]); propsOfLastArg.push(statement + "." + objectProps[i]);
}
} }
}else{ }else{
// loop thru globalSymbols looking for a good match // loop thru globalSymbols looking for a good match