Fix issue #115
This commit is contained in:
parent
fae2b6aac7
commit
e40786d727
1 changed files with 13 additions and 6 deletions
|
@ -34,6 +34,7 @@ var _getProperties = function( o ) {
|
||||||
j,
|
j,
|
||||||
isObjectMethod,
|
isObjectMethod,
|
||||||
typeofProperty;
|
typeofProperty;
|
||||||
|
|
||||||
if ( _isJavaObject( o ) ) {
|
if ( _isJavaObject( o ) ) {
|
||||||
propertyLoop:
|
propertyLoop:
|
||||||
for ( i in o ) {
|
for ( i in o ) {
|
||||||
|
@ -103,6 +104,7 @@ var onTabCompleteJS = function( result, cmdSender, pluginCmd, cmdAlias, cmdArgs
|
||||||
if ( pluginCmd.name == 'jsp' ) {
|
if ( pluginCmd.name == 'jsp' ) {
|
||||||
return tabCompleteJSP( result, cmdSender, pluginCmd, cmdAlias, cmdArgs );
|
return tabCompleteJSP( result, cmdSender, pluginCmd, cmdAlias, cmdArgs );
|
||||||
}
|
}
|
||||||
|
|
||||||
global.self = cmdSender; // bring in self just for autocomplete
|
global.self = cmdSender; // bring in self just for autocomplete
|
||||||
|
|
||||||
_globalSymbols = _getProperties(global);
|
_globalSymbols = _getProperties(global);
|
||||||
|
@ -117,6 +119,7 @@ var onTabCompleteJS = function( result, cmdSender, pluginCmd, cmdAlias, cmdArgs
|
||||||
propsOfLastArg = _globalSymbols;
|
propsOfLastArg = _globalSymbols;
|
||||||
} else {
|
} else {
|
||||||
statementSyms = statement.split(/[^\$a-zA-Z0-9_\.]/);
|
statementSyms = statement.split(/[^\$a-zA-Z0-9_\.]/);
|
||||||
|
|
||||||
lastSymbol = statementSyms[statementSyms.length-1];
|
lastSymbol = statementSyms[statementSyms.length-1];
|
||||||
//print('DEBUG: lastSymbol=[' + lastSymbol + ']');
|
//print('DEBUG: lastSymbol=[' + lastSymbol + ']');
|
||||||
//
|
//
|
||||||
|
@ -124,18 +127,22 @@ var onTabCompleteJS = function( result, cmdSender, pluginCmd, cmdAlias, cmdArgs
|
||||||
//
|
//
|
||||||
parts = lastSymbol.split(/\./);
|
parts = lastSymbol.split(/\./);
|
||||||
name = parts[0];
|
name = parts[0];
|
||||||
|
|
||||||
symbol = global[name];
|
symbol = global[name];
|
||||||
|
|
||||||
lastGoodSymbol = symbol;
|
lastGoodSymbol = symbol;
|
||||||
if ( typeof symbol != 'undefined' ) {
|
if ( typeof symbol !== 'undefined' ) {
|
||||||
for ( i = 1; i < parts.length; i++ ) {
|
for ( i = 1; i < parts.length; i++ ) {
|
||||||
name = parts[i];
|
name = parts[i];
|
||||||
symbol = symbol[name];
|
if ( !name ) { // fix issue #115
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
symbol = symbol[name]; // this causes problem in jre8 if name is ''
|
||||||
if ( typeof symbol == 'undefined' ) {
|
if ( typeof symbol == 'undefined' ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lastGoodSymbol = symbol;
|
lastGoodSymbol = symbol;
|
||||||
}
|
}
|
||||||
//print('debug:name['+name+']lastSymbol['+lastSymbol+']symbol['+symbol+']');
|
|
||||||
if ( typeof symbol == 'undefined' ) {
|
if ( typeof symbol == 'undefined' ) {
|
||||||
//
|
//
|
||||||
// look up partial matches against last good symbol
|
// look up partial matches against last good symbol
|
||||||
|
|
Reference in a new issue