Changeset 224 for trunk


Ignore:
Timestamp:
12/15/05 10:32:30 (19 years ago)
Author:
remar
Message:
  • fix assignment to copy, proposals and narrowedProposals shouldn't really be the same object
  • some better error handling
  • don't show empty parameter list if there are no in/out parameters
File:
1 edited

Legend:

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

    r221 r224  
    6565//TODO comment the class, remar !
    6666/**
     67 * This class is responsible for proposing completions and giving
     68 * context information about functions. These functions kick in when .
     69 * and ( are typed.
     70 *
     71 * computeCompletionProposals() takes care of proposing classnames when
     72 * typing after a .
     73 *
     74 * computeContextInformation() takes care of showing the definitions of
     75 * the parameters of classes that have parameters.
    6776 *
    6877 * @author Andreas Remar
     
    106115            int pos = stringTyped.indexOf('(');
    107116           
    108             System.out.println(pos);
    109            
    110117            /* Match parens to see if we're done typing. */
    111118            int pardepth = 0;
     
    149156    private void newProposals(String className)
    150157    {
    151         proposals.clear();
    152         narrowedProposals.clear();
     158        if(proposals != null)
     159            proposals.clear();
     160        else
     161            proposals = new Vector<Object>();
     162        if(narrowedProposals != null)
     163            narrowedProposals.clear();
     164        else
     165            narrowedProposals = new Vector<Object>();
     166       
    153167        typeAhead = 0;
    154168
     
    167181        finally
    168182        {
    169             narrowedProposals = proposals;
     183            narrowedProposals.addAll(proposals);
    170184        }
    171185    }
     
    268282            elementsInfo = OMCProxy.getElementsInfo(functionName);
    269283        }
    270         catch (ConnectionException e){e.printStackTrace();}
    271         catch (InvocationError e){e.printStackTrace();}
    272         catch (UnexpectedReplyException e){e.printStackTrace();}
     284        catch (ConnectionException e){ErrorManager.showCompilerError(e);return;}
     285        catch (InvocationError e){/* class wasn't found or something */ return;}
     286        catch (UnexpectedReplyException e){/* strange reply from omc? */return;}
    273287
    274288        functionProposal = functionName;
     
    419433        }
    420434       
     435        if(proposal == "")
     436            return null;
     437       
    421438        IContextInformation[] result = new IContextInformation[1];
    422439       
Note: See TracChangeset for help on using the changeset viewer.