|
From: Zach D. <zd...@us...> - 2005-10-17 04:23:53
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1712/src/org/rubypeople/rdt/internal/core Modified Files: RubyScriptStructureBuilder.java Log Message: Added support for aliasing methods using 'alias :new_method :old_method' syntax. This shows up and correctly positions in the outline view. Fixed bug where the currentVisibility was never reset to be public when opening or declaring a new class. Removed a line of unneeded where the assignment was the only area where the local variable was used. Index: RubyScriptStructureBuilder.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RubyScriptStructureBuilder.java 9 Oct 2005 22:14:06 -0000 1.10 --- RubyScriptStructureBuilder.java 17 Oct 2005 04:23:45 -0000 1.11 *************** *** 172,176 **** */ public void visitAliasNode(AliasNode iVisited) { ! handleNode(iVisited); } --- 172,197 ---- */ public void visitAliasNode(AliasNode iVisited) { ! handleNode(iVisited); ! ! String name = iVisited.getNewName(); ! ! Visibility visibility = currentVisibility; ! if( name.equals("initialize") ) visibility = Visibility.PROTECTED; ! ! RubyMethod method = new RubyMethod( getCurrentType(), name ); ! modelStack.push( method ); ! ! RubyElementInfo parentInfo = infoStack.peek(); ! parentInfo.addChild( method ); ! ! RubyMethodElementInfo info = new RubyMethodElementInfo(); ! info.setVisibility( convertVisibility(visibility) ); ! ISourcePosition pos = iVisited.getPosition(); ! setKeywordRange( "alias", pos, info, ":" + name ); ! infoStack.push( info ); ! newElements.put( method, info ); ! ! modelStack.pop(); ! infoStack.pop(); } *************** *** 438,441 **** --- 459,466 ---- public void visitClassNode(ClassNode iVisited) { handleNode(iVisited); + + // This resets the visibility when opening or declaring a class to public + currentVisibility = Visibility.PUBLIC; + String name = iVisited.getCPath().getName(); RubyType handle = new RubyType(modelStack.peek(), name); *************** *** 832,836 **** String arg = getString(node); if (arg != null) { - RubyElementInfo parentInfo = scriptInfo; ImportContainer importContainer = (ImportContainer) script.getImportContainer(); // create the import container and its info --- 857,860 ---- |