Ignore:
Timestamp:
02/16/06 14:33:48 (19 years ago)
Author:
boris
Message:
  • fixed a bug in code completion that couse it to crash and pop-up uggly dialog warnings
  • removed some trace printouts
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/editor/ModelicaCompletionProcessor.java

    r324 r331  
    255255            catch(BadLocationException e)
    256256            {
     257                System.out.println("shhh, don't say anything");
    257258            }
    258259            if(ch == '\n' || ch == '\t' || ch == ' '
     
    376377            int offset)
    377378    {
    378         IEditorInput input = editor.getEditorInput();
     379//      IEditorInput input = editor.getEditorInput();
    379380        //TODO when eclipse restores the files that where left
    380381        // in the editor area when it was closed last time the
     
    382383        // thus code completion will not work, this should be fixed somehow
    383384
    384         if (input instanceof ModelicaElementEditorInput)
    385         {
    386             IModelicaSourceFile file =
    387                 ((ModelicaElementEditorInput)input).getSourceFile();
    388             System.out.println("we are looking at " + file);
    389             try
    390             {
    391                 IModelicaClass clazz = file.getClassAt(offset);
    392                 if (clazz != null)
    393                 {
    394                     System.out.println("class def is " + clazz.getElementName());
    395                 }
    396                 else
    397                 {
    398                     System.out.println("no class here");
    399                 }
    400             }
    401             catch (Exception e)
    402             {
    403                 System.out.println(e);
    404                 e.printStackTrace();
    405             }
    406         }
     385//      if (input instanceof ModelicaElementEditorInput)
     386//      {
     387//          IModelicaSourceFile file =
     388//              ((ModelicaElementEditorInput)input).getSourceFile();
     389//          System.out.println("we are looking at " + file);
     390//          try
     391//          {
     392//              IModelicaClass clazz = file.getClassAt(offset);
     393//              if (clazz != null)
     394//              {
     395//                  System.out.println("class def is " + clazz.getElementName());
     396//              }
     397//              else
     398//              {
     399//                  System.out.println("no class here");
     400//              }
     401//          }
     402//          catch (Exception e)
     403//          {
     404//              System.out.println(e);
     405//              e.printStackTrace();
     406//          }
     407//      }
    407408       
    408409        String className = findClassName(viewer, offset);
    409 
     410       
     411        if (className == null || className.equals(""))
     412        {
     413            /* bail out without any proposals */
     414            return new ICompletionProposal[0];
     415        }
     416       
    410417        if(className.charAt(className.length() - 1) == '.')
    411418        {
Note: See TracChangeset for help on using the changeset viewer.