Ignore:
Timestamp:
02/15/06 18:31:48 (19 years ago)
Author:
boris
Message:
  • changed code to compute actual region of a component/class instead of first line as it was before
  • implemented a mechanism to look up the class definition at a certain location in a modelica source file
Location:
trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/OMCProxy.java

    r310 r317  
    6161import org.modelica.mdt.core.compiler.ModelicaParser;
    6262import org.modelica.mdt.core.compiler.UnexpectedReplyException;
     63import org.modelica.mdt.internal.core.ElementLocation;
    6364import org.modelica.mdt.internal.core.ErrorManager;
    64 import org.modelica.mdt.omc.internal.ElementLocation;
    6565import org.modelica.mdt.omc.internal.ParseResults;
    6666import org.modelica.mdt.omc.internal.OMCParser;
     
    652652         * The getCrefInfo reply have the following format:
    653653         *
    654          * <file path>,<line number>,<column number>
     654         * <file path>,<something>,<start line>,<start column>,<end line>,<end column>
    655655         *
     656         * for example:
     657         * /foo/Modelica/package.mo,writable,1,1,1029,13
    656658         */
    657659
     
    661663
    662664        List tokens = ModelicaParser.parseList(retval);
    663         int line;
     665       
     666        String filePath = tokens.elementAt(0).toString();
     667        int startLine;
     668        int startColumn;
     669        int endLine;
     670        int endColumn;
    664671
    665672        try
    666673        {
    667             line = Integer.parseInt(tokens.elementAt(2).toString());
     674            startLine = Integer.parseInt(tokens.elementAt(2).toString());
     675            startColumn = Integer.parseInt(tokens.elementAt(3).toString());
     676            endLine = Integer.parseInt(tokens.elementAt(4).toString());
     677            endColumn = Integer.parseInt(tokens.elementAt(5).toString());
    668678        }
    669679        catch (NumberFormatException e)
    670680        {
    671681            throw new
    672             UnexpectedReplyException("can't parse getCrefInfo() reply, "+
    673                     "unexpected format");
    674         }
    675        
    676         return new ElementLocation(tokens.elementAt(0).toString(), line);
     682                UnexpectedReplyException("can't parse getCrefInfo() reply, "+
     683                        "unexpected format");
     684        }
     685       
     686        return new ElementLocation(filePath,
     687                    startLine, startColumn, endLine, endColumn);
    677688    }
    678689   
Note: See TracChangeset for help on using the changeset viewer.