Changeset 1103

Show
Ignore:
Timestamp:
04/12/08 13:23:27 (9 months ago)
Author:
asterite
Message:

Started more serious autocompletion tests, and improving the look&feel (completion labels, for example).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.core/src/descent/core/CompletionProposal.java

    r1102 r1103  
    13191319     
    13201320    public char[] getTypeSignature() { 
    1321         return this.typeName; 
     1321        return this.typeSignature; 
    13221322    } 
    13231323     
  • trunk/descent.core/src/descent/core/Signature.java

    r1099 r1103  
    764764     */ 
    765765    public static final String SIG_DCHAR                                = "w"; 
     766     
     767    /** 
     768     * Kind constant for a primitive type signature. 
     769     * @see #getTypeSignatureKind(String) 
     770     * @since 3.0 
     771     */ 
     772    public static final int PRIMITIVE_TYPE_SIGNATURE = 1; 
     773     
     774    /** 
     775     * Kind constant for a pointer type signature. 
     776     * @see #getTypeSignatureKind(String) 
     777     * @since 3.0 
     778     */ 
     779    public static final int POINTER_TYPE_SIGNATURE = 2; 
     780     
     781    /** 
     782     * Kind constant for a dynamic array type signature. 
     783     * @see #getTypeSignatureKind(String) 
     784     * @since 3.0 
     785     */ 
     786    public static final int DYNAMIC_ARRAY_TYPE_SIGNATURE = 3; 
     787     
     788    /** 
     789     * Kind constant for a static array type signature. 
     790     * @see #getTypeSignatureKind(String) 
     791     * @since 3.0 
     792     */ 
     793    public static final int STATIC_ARRAY_TYPE_SIGNATURE = 4; 
     794     
     795    /** 
     796     * Kind constant for an associative type signature. 
     797     * @see #getTypeSignatureKind(String) 
     798     * @since 3.0 
     799     */ 
     800    public static final int ASSOCIATIVE_ARRAY_TYPE_SIGNATURE = 5; 
     801     
     802    /** 
     803     * Kind constant for a typeof type signature. 
     804     * @see #getTypeSignatureKind(String) 
     805     * @since 3.0 
     806     */ 
     807    public static final int TYPEOF_TYPE_SIGNATURE = 6; 
     808     
     809    /** 
     810     * Kind constant for a slice type signature. 
     811     * @see #getTypeSignatureKind(String) 
     812     * @since 3.0 
     813     */ 
     814    public static final int SLICE_TYPE_SIGNATURE = 7; 
     815     
     816    /** 
     817     * Kind constant for a module signature. 
     818     * @see #getTypeSignatureKind(String) 
     819     * @since 3.0 
     820     */ 
     821    public static final int MODULE_SIGNATURE = 8; 
     822     
     823    /** 
     824     * Kind constant for a class type signature. 
     825     * @see #getTypeSignatureKind(String) 
     826     * @since 3.0 
     827     */ 
     828    public static final int CLASS_TYPE_SIGNATURE = 9; 
     829     
     830    /** 
     831     * Kind constant for a struct type signature. 
     832     * @see #getTypeSignatureKind(String) 
     833     * @since 3.0 
     834     */ 
     835    public static final int STRUCT_TYPE_SIGNATURE = 10; 
     836     
     837    /** 
     838     * Kind constant for a union type signature. 
     839     * @see #getTypeSignatureKind(String) 
     840     * @since 3.0 
     841     */ 
     842    public static final int UNION_TYPE_SIGNATURE = 11; 
     843     
     844    /** 
     845     * Kind constant for an interface type signature. 
     846     * @see #getTypeSignatureKind(String) 
     847     * @since 3.0 
     848     */ 
     849    public static final int INTERFACE_TYPE_SIGNATURE = 12; 
     850     
     851    /** 
     852     * Kind constant for an identifier type signature. 
     853     * @see #getTypeSignatureKind(String) 
     854     * @since 3.0 
     855     */ 
     856    public static final int IDENTIFIER_TYPE_SIGNATURE = 13; 
     857     
     858    /** 
     859     * Kind constant for a function type signature. 
     860     * @see #getTypeSignatureKind(String) 
     861     * @since 3.0 
     862     */ 
     863    public static final int FUNCTION_TYPE_SIGNATURE = 14; 
     864     
     865    /** 
     866     * Kind constant for a delegate type signature. 
     867     * @see #getTypeSignatureKind(String) 
     868     * @since 3.0 
     869     */ 
     870    public static final int DELEGATE_TYPE_SIGNATURE = 15; 
     871     
     872    /** 
     873     * Kind constant for a template type signature. 
     874     * @see #getTypeSignatureKind(String) 
     875     * @since 3.0 
     876     */ 
     877    public static final int TEMPLATE_TYPE_SIGNATURE = 16; 
     878     
     879    /** 
     880     * Kind constant for a template instance type signature. 
     881     * @see #getTypeSignatureKind(String) 
     882     * @since 3.0 
     883     */ 
     884    public static final int TEMPLATE_INSTANCE_TYPE_SIGNATURE = 17; 
     885     
     886    /** 
     887     * Kind constant for a function signature. 
     888     * @see #getTypeSignatureKind(String) 
     889     * @since 3.0 
     890     */ 
     891    public static final int FUNCTION_SIGNATURE = 18; 
     892     
     893    /** 
     894     * Kind constant for a templated class type signature. 
     895     * @see #getTypeSignatureKind(String) 
     896     * @since 3.0 
     897     */ 
     898    public static final int TEMPLATED_CLASS_TYPE_SIGNATURE = 19; 
     899     
     900    /** 
     901     * Kind constant for a templated struct type signature. 
     902     * @see #getTypeSignatureKind(String) 
     903     * @since 3.0 
     904     */ 
     905    public static final int TEMPLATED_STRUCT_TYPE_SIGNATURE = 20; 
     906     
     907    /** 
     908     * Kind constant for a templated union type signature. 
     909     * @see #getTypeSignatureKind(String) 
     910     * @since 3.0 
     911     */ 
     912    public static final int TEMPLATED_UNION_TYPE_SIGNATURE = 21; 
     913     
     914    /** 
     915     * Kind constant for a templated interface type signature. 
     916     * @see #getTypeSignatureKind(String) 
     917     * @since 3.0 
     918     */ 
     919    public static final int TEMPLATED_INTERFACE_TYPE_SIGNATURE = 22; 
     920     
     921    /** 
     922     * Kind constant for a templated function signature. 
     923     * @see #getTypeSignatureKind(String) 
     924     * @since 3.0 
     925     */ 
     926    public static final int TEMPLATED_FUNCTION_SIGNATURE = 23; 
     927     
     928     
    766929         
    767930private Signature() { 
     
    18472010} 
    18482011 
     2012/** 
     2013 * Returns the kind a given signature. 
     2014 * @param signature a signature 
     2015 * @return  the kind of type signature 
     2016 */ 
     2017public static int getTypeSignatureKind(String signature) { 
     2018    final int[] kind = { 0 }; 
     2019    SignatureProcessor.process(signature, false, new SignatureRequestorAdapter() { 
     2020        @Override 
     2021        public void acceptPrimitive(TypeBasic type) { 
     2022            kind[0] = PRIMITIVE_TYPE_SIGNATURE; 
     2023        } 
     2024        @Override 
     2025        public void acceptPointer(String signature) { 
     2026            kind[0] = POINTER_TYPE_SIGNATURE; 
     2027        } 
     2028        @Override 
     2029        public void acceptAssociativeArray(String signature) { 
     2030            kind[0] = ASSOCIATIVE_ARRAY_TYPE_SIGNATURE; 
     2031        } 
     2032        @Override 
     2033        public void acceptDelegate(String signature) { 
     2034            kind[0] = DELEGATE_TYPE_SIGNATURE; 
     2035        } 
     2036        @Override 
     2037        public void acceptDynamicArray(String signature) { 
     2038            kind[0] = DYNAMIC_ARRAY_TYPE_SIGNATURE; 
     2039        } 
     2040        @Override 
     2041        public void acceptIdentifier(char[][] compoundName, String signature) { 
     2042            kind[0] = IDENTIFIER_TYPE_SIGNATURE; 
     2043        } 
     2044        @Override 
     2045        public void acceptModule(char[][] compoundName, String signature) { 
     2046            kind[0] = MODULE_SIGNATURE; 
     2047        } 
     2048        @Override 
     2049        public void acceptSlice(char[] lwr, char[] upr, String signature) { 
     2050            kind[0] = SLICE_TYPE_SIGNATURE; 
     2051        } 
     2052        @Override 
     2053        public void acceptStaticArray(char[] dimension, String signature) { 
     2054            kind[0] = STATIC_ARRAY_TYPE_SIGNATURE; 
     2055        } 
     2056        @Override 
     2057        public void acceptSymbol(char type, char[] name, int startPosition, String signature) { 
     2058            switch(type) { 
     2059            case ISignatureConstants.CLASS: 
     2060                kind[0] = CLASS_TYPE_SIGNATURE; 
     2061                break; 
     2062            case ISignatureConstants.STRUCT: 
     2063                kind[0] = STRUCT_TYPE_SIGNATURE; 
     2064                break; 
     2065            case ISignatureConstants.UNION: 
     2066                kind[0] = UNION_TYPE_SIGNATURE; 
     2067                break; 
     2068            case ISignatureConstants.INTERFACE: 
     2069                kind[0] = INTERFACE_TYPE_SIGNATURE; 
     2070                break; 
     2071            case ISignatureConstants.FUNCTION: 
     2072                kind[0] = FUNCTION_SIGNATURE; 
     2073                break; 
     2074            case ISignatureConstants.TEMPLATE: 
     2075                kind[0] = TEMPLATE_TYPE_SIGNATURE; 
     2076                break; 
     2077            case ISignatureConstants.TEMPLATED_CLASS: 
     2078                kind[0] = TEMPLATED_CLASS_TYPE_SIGNATURE; 
     2079                break; 
     2080            case ISignatureConstants.TEMPLATED_STRUCT: 
     2081                kind[0] = TEMPLATED_STRUCT_TYPE_SIGNATURE; 
     2082                break; 
     2083            case ISignatureConstants.TEMPLATED_UNION: 
     2084                kind[0] = TEMPLATED_UNION_TYPE_SIGNATURE; 
     2085                break; 
     2086            case ISignatureConstants.TEMPLATED_INTERFACE: 
     2087                kind[0] = TEMPLATED_INTERFACE_TYPE_SIGNATURE; 
     2088                break; 
     2089            case ISignatureConstants.TEMPLATED_FUNCTION: 
     2090                kind[0] = TEMPLATED_FUNCTION_SIGNATURE; 
     2091                break; 
     2092            } 
     2093        } 
     2094        @Override 
     2095        public void acceptTypeof(char[] expression, String signature) { 
     2096            kind[0] = TYPEOF_TYPE_SIGNATURE; 
     2097        } 
     2098        @Override 
     2099        public void exitFunctionType(LINK link, char argumentBreak, String signature) { 
     2100            kind[0] = FUNCTION_TYPE_SIGNATURE; 
     2101        } 
     2102        @Override 
     2103        public void exitTemplateInstance(String signature) { 
     2104            kind[0] = TEMPLATE_INSTANCE_TYPE_SIGNATURE; 
     2105        } 
     2106    }); 
     2107    return kind[0]; 
     2108} 
     2109 
     2110/** 
     2111 * Returns the kind a given signature. 
     2112 * @param signature a signature 
     2113 * @return the kind of signature 
     2114 */ 
     2115public static int getTypeSignatureKind(char[] signature) { 
     2116    return getTypeSignatureKind(new String(signature)); 
     2117} 
     2118 
    18492119/* 
    18502120 * Given a string, this method gets it's length, and, seen as a string, 
  • trunk/descent.core/src/descent/internal/codeassist/CompletionEngine.java

    r1102 r1103  
    121121import descent.internal.core.INamingRequestor; 
    122122import descent.internal.core.InternalNamingConventions; 
    123 import descent.internal.core.InternalSignature; 
    124123import descent.internal.core.SearchableEnvironment; 
    125124import descent.internal.core.util.Util; 
     
    471470                            return; 
    472471                        } 
     472                    } else if (isGetter((TypeFunction) type)) { 
     473                        type = ((TypeFunction) type).next; 
     474                        if (type == null) { 
     475                            return; 
     476                        } 
    473477                    } 
    474478                } 
     
    506510        return type != null && type.next == Type.tvoid 
    507511            && type.parameters != null && type.parameters.size() == 1; 
     512    } 
     513     
     514    private boolean isGetter(TypeFunction type) { 
     515        return type != null && type.next != Type.tvoid 
     516            && (type.parameters == null || type.parameters.isEmpty()); 
    508517    } 
    509518 
     
    13681377        proposal.setCompletion(CharOperation.concat(currentName, "()".toCharArray())); 
    13691378        proposal.setSignature(signature); 
    1370         proposal.setTypeName(signature); 
     1379        proposal.setTypeSignature(signature); 
    13711380        proposal.setRelevance(relevance); 
    13721381        proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); 
     
    13831392         
    13841393        if (type.isintegral()) { 
    1385             suggestIntegralProperties(); 
     1394            suggestIntegralProperties(type.getSignature().toCharArray()); 
    13861395        } 
    13871396         
     
    13941403    private void suggestAllTypesProperties(Type type) { 
    13951404        suggestProperties( 
     1405                type.getSignature().toCharArray(), 
    13961406                allTypesProperties,  
    13971407                new Type[] { type, typeInt, typeInt, typeCharArray, typeCharArray },  
     
    14001410     
    14011411    public final static char[][] integralTypesProperties = { Id.max, Id.min }; 
    1402     private void suggestIntegralProperties() { 
     1412    private void suggestIntegralProperties(char[] declarationSignature) { 
    14031413        suggestProperties( 
     1414                declarationSignature, 
    14041415                integralTypesProperties,  
    14051416                new Type[] { typeInt, typeInt }, 
     
    14101421    private void suggestFloatingProperties(Type type) { 
    14111422        suggestProperties( 
     1423                type.getSignature().toCharArray(), 
    14121424                floatingPointTypesProperties,  
    14131425                new Type[] { type, type, typeInt, type, typeInt, typeInt, typeInt, typeInt, typeInt, type, type }, 
     
    14201432        suggestAllTypesProperties(type); 
    14211433        suggestProperties( 
     1434                type.getSignature().toCharArray(), 
    14221435                staticAndDynamicArrayProperties,  
    14231436                new Type[] { type, type, typeInt, typeInt, type }, 
     
    14281441        suggestAllTypesProperties(type); 
    14291442        suggestProperties( 
     1443                type.getSignature().toCharArray(), 
    14301444                staticAndDynamicArrayProperties, 
    14311445                new Type[] { type, type, typeInt, typeInt, type }, 
     
    14371451        suggestAllTypesProperties(type); 
    14381452        suggestProperties( 
     1453                type.getSignature().toCharArray(), 
    14391454                associativeArrayProperties, 
    14401455                new Type[] { typeInt,  
     
    15121527        // If the base type of the enum is integral, also suggest integer properties 
    15131528        if (enumDeclaration.memtype.isintegral()) { 
    1514             suggestIntegralProperties(); 
     1529            suggestIntegralProperties(enumDeclaration.getSignature().toCharArray()); 
    15151530        } 
    15161531    } 
     
    16531668                    proposal.setName(ident); 
    16541669                    proposal.setCompletion(ident); 
    1655                     proposal.setTypeName(typeName); 
     1670                    proposal.setTypeSignature(typeName); 
    16561671                    proposal.setSignature(sig); 
     1672                    proposal.setDeclarationSignature(var.parent.getSignature().toCharArray()); 
    16571673                    proposal.setFlags(flags | var.getFlags()); 
    16581674                    proposal.setRelevance(relevance); 
     
    16951711                    boolean isLocal = alias.parent instanceof FuncDeclaration; 
    16961712                     
    1697                     CompletionProposal proposal = this.createProposal(isLocal ? CompletionProposal.LOCAL_VARIABLE_REF : CompletionProposal.FIELD_REF, this.actualCompletionPosition, alias); 
     1713                    CompletionProposal proposal = this.createProposal(isLocal ? CompletionProposal.LOCAL_VARIABLE_REF : CompletionProposal.TYPE_REF, this.actualCompletionPosition, alias); 
    16981714                    proposal.setName(ident); 
    16991715                    proposal.setCompletion(ident); 
     
    17431759                    relevance += computeRelevanceForExpectedType(type); 
    17441760                     
    1745                     proposal.setTypeName(sigChars); 
     1761                    proposal.setTypeSignature(sigChars); 
    17461762                    proposal.setFlags(flags | alias.getFlags() | Flags.AccAlias); 
    17471763                    proposal.setRelevance(relevance); 
     
    17661782                    boolean isLocal = typedef.parent instanceof FuncDeclaration; 
    17671783                     
    1768                     CompletionProposal proposal = this.createProposal(isLocal ? CompletionProposal.LOCAL_VARIABLE_REF : CompletionProposal.FIELD_REF, this.actualCompletionPosition, typedef); 
     1784                    CompletionProposal proposal = this.createProposal(isLocal ? CompletionProposal.LOCAL_VARIABLE_REF : CompletionProposal.TYPE_REF, this.actualCompletionPosition, typedef); 
    17691785                    proposal.setName(ident); 
    17701786                    proposal.setCompletion(ident); 
    17711787                    proposal.setSignature(sigChars); 
    1772                     proposal.setTypeName(typedef.basetype.getSignature().toCharArray()); 
     1788                    proposal.setTypeSignature(typedef.basetype.getSignature().toCharArray()); 
    17731789                    proposal.setFlags(flags | typedef.getFlags() | Flags.AccTypedef); 
    17741790                    proposal.setRelevance(relevance); 
     
    19151931                        proposal.setSignature(sig.toCharArray()); 
    19161932                    } 
    1917                     proposal.setTypeName(type.getSignature().toCharArray()); 
     1933                    proposal.setTypeSignature(type.getSignature().toCharArray()); 
    19181934                    proposal.setFlags(flags | func.getFlags()); 
    19191935                    proposal.setRelevance(relevance); 
     
    20582074    } 
    20592075 
    2060     private void suggestProperties(  
     2076    private void suggestProperties( 
     2077            char[] declarationSignature, 
    20612078            char[][] properties, 
    20622079            Type[] types, 
     
    20772094                proposal.setName(property); 
    20782095                proposal.setCompletion(property); 
    2079                 proposal.setTypeName(type.getSignature().toCharArray()); 
     2096                proposal.setDeclarationSignature(declarationSignature); 
     2097                proposal.setTypeSignature(type.getSignature().toCharArray()); 
     2098                proposal.setSignature((new String(declarationSignature) + "/" + property.length + new String(property)).toCharArray()); 
    20802099                proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset); 
    20812100                CompletionEngine.this.requestor.accept(proposal); 
  • trunk/descent.core/src/descent/internal/codeassist/InternalCompletionProposal.java

    r1102 r1103  
    4141    protected char[] declarationTypeName; 
    4242    protected char[] packageName; 
    43     protected char[] typeName; 
     43    protected char[] typeSignature; 
    4444    protected char[][] parameterPackageNames; 
    4545    protected char[][] parameterTypeNames; 
     
    158158     
    159159    protected char[] getTypeSignature() { 
    160         return this.typeName; 
     160        return this.typeSignature; 
    161161    } 
    162162     
     
    182182    } 
    183183     
    184     protected void setTypeName(char[] typeName) { 
    185         this.typeName = typeName; 
     184    protected void setTypeSignature(char[] typeSignature) { 
     185        this.typeSignature = typeSignature; 
    186186    } 
    187187     
  • trunk/descent.core/src/descent/internal/compiler/lookup/ModuleBuilder.java

    r1100 r1103  
    8383     * One ring to rule them all.  
    8484     */ 
    85     private final static boolean LAZY = false;  
     85    private final static boolean LAZY = true; 
    8686     
    8787    /* 
     
    204204            time = System.currentTimeMillis() - time; 
    205205            if (time != 0) { 
    206 //                System.out.println("Building module " + module.moduleName + " took: " + time + " milliseconds to complete."); 
     206              System.out.println("Building module " + module.moduleName + " took: " + time + " milliseconds to complete."); 
    207207            } 
    208208        } catch (JavaModelException e) { 
  • trunk/descent.core/src/descent/internal/compiler/lookup/SemanticRest.java

    r1100 r1103  
    2020 
    2121    public void setSemanticContext(Scope scope, SemanticContext context) { 
    22         if (scope == null) { 
    23             System.out.println(1); 
     22        if (scope != null) { 
     23            this.sc = scope; 
     24            this.linkage = scope.linkage; 
    2425        } 
    25          
    26         this.sc = scope; 
    27         this.linkage = scope.linkage; 
    2826        this.context = context; 
    2927    } 
  • trunk/descent.core/src/descent/internal/core/CompilationUnit.java

    r1087 r1103  
    998998    if (buffer == null) return null; 
    999999     
     1000    if (buffer.getOwner() == null) { 
     1001        buffer =  
     1002            isWorkingCopy  
     1003                ? this.owner.createBuffer(this)  
     1004                : BufferManager.getDefaultBufferManager().createBuffer(this); 
     1005    } 
     1006     
    10001007    // set the buffer source 
    10011008    if (buffer.getCharacters() == null) { 
  • trunk/descent.core/src/descent/internal/core/InternalSignature.java

    r1099 r1103  
    405405                    // found it 
    406406                    descent.core.ICompilationUnit unit = pack 
    407                             .getCompilationUnit(filename); 
     407                            .getClassFile(filename); 
    408408                    if (!unit.exists()) { 
    409                         unit = pack.getClassFile(filename); 
     409                        unit = pack.getCompilationUnit(filename); 
    410410                        if (!unit.exists()) 
    411411                            continue; 
  • trunk/descent.tests/descent/tests/assist/AbstractCompletionTest.java

    r1102 r1103  
    9494            assertEquals(end, prop.getReplaceEnd()); 
    9595             
    96             for (int j = 0; j < extras.length; j++, i++) { 
    97                 switch(extras[i]) { 
     96            for (int j = 0; j < extras.length; j++) { 
     97                i++; 
     98                 
     99                switch(extras[j]) { 
    98100                case LABEL: 
    99101                    assertTrue(expectations[i] instanceof String); 
     
    112114                    break; 
    113115                case DECLARATION_SIGNATURE: 
    114                     assertTrue(expectations[i] instanceof String); 
     116                    assertTrue(expectations[i] == null || expectations[i] instanceof String); 
    115117                    String declSignature = (String) expectations[i]; 
    116                     assertEquals(declSignature, new String(prop.getDeclarationSignature())); 
     118                    if (declSignature == null) { 
     119                        assertNull(prop.getDeclarationSignature()); 
     120                    } else { 
     121                        assertEquals(declSignature, new String(prop.getDeclarationSignature())); 
     122                    } 
    117123                    break; 
    118124                } 
  • trunk/descent.ui/src/descent/internal/ui/text/java/AbstractJavaCompletionProposal.java

    r1041 r1103  
    285285     
    286286                // fix for PR #5533. Assumes that no eating takes place. 
    287                 if ((getCursorPosition() > 0 && getCursorPosition() <= buffer.length() && buffer.charAt(getCursorPosition() - 1) != trigger)) { 
     287                if ((getCursorPosition() > 0 && getCursorPosition() <= buffer.length()  
     288                        && buffer.charAt(getCursorPosition() - 1) != trigger 
     289                        && trigger != '=' && trigger != ';')) { 
    288290                    buffer.insert(getCursorPosition(), trigger); 
    289291                    setCursorPosition(getCursorPosition() + 1); 
  • trunk/descent.ui/src/descent/internal/ui/text/java/LazyJavaMethodCompletionProposal.java

    r1102 r1103  
    5454public class LazyJavaMethodCompletionProposal extends LazyJavaCompletionProposal { 
    5555    /** Triggers for types. Do not modify. */ 
    56     protected static final char[] TYPE_TRIGGERS= new char[] { '.', '\t', '[', '(', ' ' }; 
     56    protected static final char[] TYPE_TRIGGERS= new char[] { '.', '\t', '[', '(', '=', ';', ' ' }; 
    5757    /** Triggers for types in javadoc. Do not modify. */ 
    5858    protected static final char[] JDOC_TYPE_TRIGGERS= new char[] { '#', '}', ' ', '.' }; 
     
    6969    private boolean fIsGetter; 
    7070    private boolean fIsGetterComputed= false; 
     71    private boolean fWantProperty = false; 
    7172    private int[] fArgumentOffsets; 
    7273    private int[] fArgumentLengths; 
     
    277278    public void apply(IDocument document, char trigger, int offset) { 
    278279        try { 
    279             boolean insertClosingParenthesis= trigger == '(' && autocloseBrackets(); 
    280             if (insertClosingParenthesis) { 
    281                 updateReplacementWithParentheses(); 
    282                 trigger= '\0'; 
    283             } 
     280            this.fWantProperty = trigger == '=' || trigger == ';'; 
     281             
     282//          boolean insertClosingParenthesis= trigger == '(' && autocloseBrackets(); 
     283//          if (insertClosingParenthesis) { 
     284//              updateReplacementWithParentheses(); 
     285//              trigger= '\0'; 
     286//          } 
    284287             
    285288            super.apply(document, trigger, offset); 
     
    558561     
    559562    private boolean computeIsSetter() throws IllegalArgumentException { 
     563        if (!fWantProperty) { 
     564            return false; 
     565        } 
     566         
    560567        char[] retType = Signature.getReturnType(fProposal.getTypeSignature()); 
    561568        if (retType.length == 1 && retType[0] == 'v') { 
     
    566573     
    567574    private boolean computeIsGetter() throws IllegalArgumentException { 
     575        if (!fWantProperty) { 
     576            return false; 
     577        } 
     578         
    568579        char[] retType = Signature.getReturnType(fProposal.getTypeSignature()); 
    569580        if (retType.length != 1 || retType[0] != 'v') { 
  • trunk/descent.ui/src/descent/ui/text/java/CompletionProposalLabelProvider.java

    r1102 r1103  
    493493        buf.append(proposal.getName()); 
    494494         
    495         char[] typeName = proposal.getTypeSignature(); 
    496         if (typeName != null && typeName.length != 0) { 
     495        char[] typeSignature = proposal.getTypeSignature(); 
     496        if (typeSignature != null && typeSignature.length != 0) { 
    497497            buf.append("    "); //$NON-NLS-1$ 
    498             buf.append(Signature.getSimpleName(Signature.toCharArray(typeName))); 
     498            buf.append(Signature.getSimpleName(Signature.toCharArray(typeSignature))); 
     499        } 
     500         
     501        char[] declSignature = proposal.getDeclarationSignature(); 
     502        if (declSignature != null && declSignature.length != 0) { 
     503            buf.append(JavaElementLabels.CONCAT_STRING); 
     504             
     505            int declKind = Signature.getTypeSignatureKind(declSignature); 
     506            if (declKind == Signature.MODULE_SIGNATURE) { 
     507                buf.append(Signature.toCharArray(declSignature));    
     508            } else { 
     509                buf.append(Signature.getSimpleName(Signature.toCharArray(declSignature))); 
     510            } 
    499511        } 
    500512         
  • trunk/todos.txt

    r1097 r1103  
    22 - Test code select and binding for aliased symbols (i.e. alias Foo.Bar myAlias). 
    33 - See why "Box!(int) box = new |" shrinks icons, etc. 
     4 - Implement ClassFile#buildStructure to use a File to get it's contents.