Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] SnipMatch progress


On 25.10.2011, at 06:33, Zi Ye wrote:

There must be a way to just extract local variables from the current source file, right?


We have use an "extended" completion context:


which provides access to 

/**
     * Returns a set of all local variables declared in the method code
     * completion was triggered in.
     * <p>
     * Note, the objects returned by this method are compiler ast nodes. This
     * API is very likely to change!
     * </p>
     */
    @Experimental
    Set<LocalDeclaration> getLocalDeclarations();

    /**
     * Returns a set of all fields declared in the scope of this compilation
     * unit( or just type?) completion was triggered in.
     * <p>
     * Note, the objects returned by this method are compiler ast nodes. This
     * API is very likely to change!
     * </p>
     */
    @Experimental
    Set<FieldDeclaration> getFieldDeclarations();


Is this what you need?

Back to the top