OK, if this is untypical behavior I'd fully support your opinion to do code complete on Enter only :)
BTW using space as completion makes sense to speed up typing, which I'd suggest for JDT as well:
typical scenarios:
x.myfield = 5;
x.myfield= ...
x.mymeth();
if(x.myfield==...
So insertion of code complete (myXXX) when user types [space], (, =, etc after x.my has much more sense than inserting space after x.my (which will definitely result in error), also this will speed up typing because no [Enter] press required. Why JDT do not behave like this -- that's a question to JDT, I'm just looking at very common use-case.
Kind Regards,
Andrey
----- Original Message -----
From: "Johan Compagner" <jcompagner@xxxxxxxxx>
To: "DLTK Developer Discussions" <dltk-dev@xxxxxxxxxxx>
Sent: Thursday, October 15, 2009 7:31:13 PM GMT +06:00 Almaty, Novosibirsk
Subject: Re: [Dltk-dev] code completion also completes on space
i dont know about this, why should space insert a completion at the first place?
enter is something thats really common there you really select something out of a list
Do remember that the really static typed language we have in eclipse (java) doesnt insert the completion on space it only does it on enter.
On Thu, Oct 15, 2009 at 14:07, Andrey Platov
<andrey@xxxxxxxxx> wrote:
Hi guys,
I guess we should support both modes and control this behavior on per language basis (default property settings and/or within language-specific implementation)
Mode 1) Space, assignment operator ('='), or any other relevant symbol for particular language will perform completion of currently selected element and insert this symbol after completion results.
This is good to speedup code typing for static models (mostly static), and for statically typed (mixed dynamic/static) languages
Mode 2) (mode #1 disabled) -- Like Johan described, which is great for many dynamic languages especially _javascript_ where you do not have formal class definition and should set all the object attributes explicitly.
Also there are languages which have different syntax for static/dynamic invocations, like '.' - static invoke and '->' dynamic invoke. So programmatic control of this behavior would be a plus.
Kind Regards,
Andrey
----- Original Message -----
From: "Johan Compagner" <
jcompagner@xxxxxxxxx>
To: "DLTK Developer Discussions" <
dltk-dev@xxxxxxxxxxx>
Sent: Thursday, October 15, 2009 6:40:39 PM GMT +06:00 Almaty, Novosibirsk
Subject: Re: [Dltk-dev] code completion also completes on space
no it is not about auto insert stuff
i have this
object.aaaaa
object.aaabb
then i do code complete
object.a
then i have 2 choices in the completion list
i dont press enter then but space because i want to add a new variable to object and have this:
object.a = 10;
but the result is that i get
object.aaaaa
because the first completion got inserted and i think that is wrong, i pressed space not enter so i just want a space in the script editor.
johan
On Thu, Oct 15, 2009 at 13:00, Michael Spector
<spektom@xxxxxxxxx> wrote:
The correct place is:
org.eclipse.dltk.ui.text.completion.ScriptOverrideCompletionProposal.isAutoInsertable()
If I understood the question.
On Thu, Oct 15, 2009 at 12:58 PM, Michael Spector
<spektom@xxxxxxxxx> wrote:
It can be configured on the completion engine level ("insert single proposals automatically"), like it's done in PDT.
In java if you have this
object.one
object.two
and you complete object
object.o
then you have a list telling that one is a match.
if i press enter it will insert one.
But if i press space, completion will not do anything
in dltk this is different space also completes this is a bit annoying if you want to create a new variable or something on the object
I think only the enter key should complete. what do you think?
johan
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev