Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Code Assist in DLTK

Hi Andrey,

thanks. One more question:
How do i set the auto insert? That is, if there is only one proposal,
it should inserted automatically (without the window popping up).

greetings
Sebastian Rheinnecker

2011/9/26 Andrey Sobolev <andrey.sobolev@xxxxxxxxx>:
> Hi Sebastian,
>
> For proposal colors:
> Please check your preference initializer class.
> It should call for
> org.eclipse.dltk.ui.PreferenceConstants.PreferenceConstants.initializeDefaultValues(store);
> to initialize default DLTK values for your language.
> Please refer
> to:org.eclipse.dltk.examples.python.internal.ExamplePythonUIPreferenceInitializer
> as example.
>
> Intelligent content assist:
> It very depend on language. For most languages it is very natural to use AST
> to understand proposals.
> So problem of getting correct AST, then code are not complete is quite
> usual.
> ANTLR support error recovery, so it is possible to make some kind of AST in
> situation with errors:
> Some clues are here:
> http://www.antlr.org/wiki/display/ANTLR3/Error+reporting+and+recovery
> http://www.antlr.org/wiki/display/ANTLR3/Custom+Syntax+Error+Recovery
> In our experience we moved to custom hand made parsers:
> - It easier to make it fully recoverable as we want.
> - Handmade parsers a little bit faster and easy maintainable.
>
> Best regards,
> Andrei Sobolev.
>
> 26.09.2011 00:03, Sebastian Rheinnecker пишет:
>>
>> hello,
>>
>> i implemented the example code assist that is given in the tutorial.
>> So far, it acts as expected, except one thing:
>> The background of the proposal window is black. Since the color of the
>> text is also black, you can't read unselected proposals. How can i fix
>> this?
>>
>> also one important question:
>> How can i implement an intelligent content assist system, which
>> provides proposals dependent on the position in the text?
>> I looked into some example codes from the ruby and python plugins. It
>> seems that they are using the AST to determine which proposals have to
>> be used. But: Most of the time, the AST is not complete while editing
>> a file, so this can't be the answer (if it is, please tell me how i
>> cope with incomplete ASTs). I use ANTLR as parser-generator. Is there
>> tutorial available on how to implement a code completion system using
>> ANTLR?
>> I would be grateful for some links to tutorials on that subject in
>> general as well.
>>
>> thanks in advance,
>>
>>
>
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev
>



-- 
Sebastian Rheinnecker
Universität Tübingen


Back to the top