Changeset 356

Show
Ignore:
Timestamp:
09/14/08 17:20:03 (4 months ago)
Author:
sergey.kol..@gmail.com
Message:

Sergey Kolos:

  • Fixed bug: sometimes hyperlink for find definition is not activated even though swank has found definition (for some reason it reports both :ERROR and good :LOCATION)
  • Fixed bug: now find definition skips strings and comments when searches for a symbol, this resolves bug #1 reported here: http://groups.google.com/group/cusp-development/msg/3d3b8631d143647e
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/src/jasko/tim/lisp/editors/LispEditor.java

    r354 r356  
    232232                                IDocument doc = editor2.getDocumentProvider() 
    233233                                  .getDocument(editor2.getEditorInput()); 
     234                                 
    234235                                String contents = doc.get(); 
    235                                  
    236236                                if (symbol == null) { 
    237237                                        //System.out.println("A0 " + snippet); 
    238                                          
     238                                        //FIXME: should skip strings and comments 
    239239                                        int offset = contents.indexOf(snippet, position); 
    240240                                        if (offset >= 0) { 
     
    247247                                } else { 
    248248                                        //System.out.println("B0"); 
    249                                         int offset = contents.indexOf(symbol, position); 
     249                                        // skip comments or strings 
     250                                        int iters = 0; 
     251                                        int offset = position; 
     252                                        while( offset >= 0 && offset < doc.getLength() &&  
     253                                                        (doc.getPartition(offset) 
     254                                                                     .getType().equals(LispPartitionScanner.LISP_COMMENT) 
     255                                                                     || doc.getPartition(offset) 
     256                                                                     .getType().equals(LispPartitionScanner.LISP_STRING))){ 
     257                                                offset = contents.indexOf(symbol,offset)+symbol.length(); 
     258                                                ++iters; 
     259                                        } 
     260                                        if( iters > 0 ){ 
     261                                                offset -= symbol.length(); 
     262                                        } 
    250263                                        if (offset >= 0) { 
    251264                                                //System.out.println("B1 " + offset); 
  • jasko.tim.lisp/src/jasko/tim/lisp/swank/SwankInterface.java

    r354 r356  
    755755                String res = sendEvalAndGrab(msg,2000); 
    756756                 
    757                 return (!(res.equalsIgnoreCase("nil") || res.contains(":ERROR"))); 
     757                return (!(res.equalsIgnoreCase("nil") || (res.contains(":ERROR") && !res.contains(":LOCATION")))); 
    758758        } 
    759759