fredvs / ideU

The ide. Universal.
GNU General Public License v2.0
63 stars 9 forks source link

Autocompletion not inserting code #29

Closed circular17 closed 4 years ago

circular17 commented 4 years ago

If I type half of a variable name then press Ctrl-Space, it displays a drop down with the full variable name. If I click on it, it doesn't insert the full name in the code.

Also it displays in the commandor "showsourceitems(edit.editpos)".

fredvs commented 4 years ago

OK, I will check that.

fredvs commented 4 years ago

If I click on it, it doesn't insert the full name in the code.

Ha, yes, indeed, this was the result of hard discussion in MSE mailing list. At the end Martin does convince us, for him a good ide dont have to touch to code. Ok to give infos in a list but not to paste code.

Anyway maybe we could think to add possibility to insert code. But maybe.

Also it displays in the commandor "showsourceitems(edit.editpos)".

Hum, sorry, this one I do not catch. Where in the commandor?

circular17 commented 4 years ago

Well Martin is not obliged to use the code completion.

image

fredvs commented 4 years ago

Sorry but how do you get showsourceitems(edit.editpos) in Commandor?

Could you tell the operations you did? I cannot reproduce it. (Or maybe you discover something than I never seen).

EDIT Ooopps ok, I see, I will study it.

fredvs commented 4 years ago

Also it displays in the commandor "showsourceitems(edit.editpos)".

It is the command used by Shift + Space. I agree it is not needed, I did use for debugging, thanks to note it, I will remove it.

circular17 commented 4 years ago

Ok.

So I suppose the code completion is not for this release.

Something else though, the list is methods is not formatted (it contains $ symbols): image

The font is small by the way, which is kind of ok for this one.

fredvs commented 4 years ago

So I suppose the code completion is not for this release.

I fear that no for insert (even if I already begin the work).

Something else though, the list is methods is not formatted (it contains $ symbols):

Yes it is the universal format used by Martin. I agree if we go foward for code completion, it could be adapted for each prog language.

The font is small by the way, which is kind of ok for this one.

No, no, no the good news is that the size of the list is sized now with the font height.

fredvs commented 4 years ago

If I click on it, it doesn't insert the full name in the code.

OK in commit 035581c : if you 2xclick on a item it will be pasted where is the cursor.

circular17 commented 4 years ago

Gonna check that

circular17 commented 4 years ago

So I suppose the code completion is not for this release.

I fear that no for insert (even if I already begin the work).

OK in commit 035581c : if you 2xclick on a item it will be pasted where is the cursor.

Seems it was possible in fact. I tested it, that's good, though you need to first delete the current word before inserting, like you did with CTRL-T. Otherwise you get repetitions of parts of the word.

Yes it is the universal format used by Martin. I agree if we go foward for code completion, it could be adapted for each prog language.

Hmm to me that's more like an assembler label. Anyway I suggest to format it with brackets and commas, as it is what most languages use. If you ever come across a language that doesn't use that, you can still customize for this language.

Something else: if I press Ctrl-Shift-Space to get info about parameters, it will display the list of procedures in the Pascal format for one second, and then replace the content of the completion drop down with the content for Ctrl-Space.

No, no, no the good news is that the size of the list is sized now with the font height.

Cool!

fredvs commented 4 years ago

Something else: if I press Ctrl-Shift-Space to get info about parameters, it will display the list of > procedures in the Pascal format for one second, and then replace the content of the completion drop down with the content for Ctrl-Space.

Once again, sorry but I cannot reproduce it. Maybe a video will help.

circular17 commented 4 years ago

Here it is: ideu_ctrl_shift_space

I am just pressing Ctrl-Shift-Space once.

fredvs commented 4 years ago

Could you try this, click on the lamp icon, try the same thing with lamp on and off to see if it has something to do with the auto list.

circular17 commented 4 years ago

Indeed, I turned on the lamp and then off again. And now it doesn't display the second list. If I turn back on the lamp, the bug happens.

By the way, what is this lamp about?

fredvs commented 4 years ago

Indeed, I turned on the lamp and then off again. And now it doesn't display the second list. If I turn > back on the lamp, the bug happens.

OK, I can reproduce it, ok, I will fix it.

By the way, what is this lamp about?

When on, a list similar to CTRL + space will appear when you are typing, showing all what could be written.

It must be set to pause if usingCTRL + space or CTRL + shift + space . I will fix it tonight.

Thanks to note it.

circular17 commented 4 years ago

By the way, the lamp icon is displayed as disabled when the program starts, even if it is enabled.

Other problem, when the completion list appears, if I press a key just at this moment, the input is lost, i.e. the character is not added to the code.

fredvs commented 4 years ago

OK, I will check this tonight.

fredvs commented 4 years ago

By the way, the lamp icon is displayed as disabled when the program starts, even if it is enabled.

Yes, thanks to note it, I forget to enable it after changing icon behavior yesterday, I will fix it tonight.

Other problem, when the completion list appears, if I press a key just at this moment, the input is > lost, i.e. the character is not added to the code.

Hum, ok, sometime it appends indeed, I will see what can be done, it is because the list take focus just at moment you typed.

circular17 commented 4 years ago

Hum, ok, sometime it appends indeed, I will see what can be done, it is because the list take focus just at moment you typed.

Maybe redirect key event?

Note: the word is "it happens" not "it appends". Appending means adding at the end of a list.

fredvs commented 4 years ago

OK, all should be fixed with commit f6e127c

circular17 commented 4 years ago

That's fine.

Remains to replace the current word instead of inserting. As I said previously you could do as you did for CTRL-T to remove the word and then insert.

fredvs commented 4 years ago

Remains to replace the current word instead of inserting.

Should be fixed with commit 9787fdf

circular17 commented 4 years ago

Ok we're getting there.

One final suggestion:

After that, I guess I have no other suggestion for next release.

Regards

fredvs commented 4 years ago

that the word would not be selected in the end and that the completion list would hide when we double click

Should be fixed in commit 412a07e

circular17 commented 4 years ago

Ok I thought that would be it but when one insert a procedure/function definition, it should either:

fredvs commented 4 years ago

Ok I thought that would be it but when one insert a procedure/function definition, it should either:

* format it, so that we can navigate with Ctrl-ArrowLeft and Ctrl-ArrowRight.

* or insert just the name of the function and one bracket.

I fear that formatting procedure/function definitions will be for after the next release.

;-(

circular17 commented 4 years ago

No problemo

fredvs commented 4 years ago

Ok I thought that would be it but when one insert a procedure/function definition, it should either:

* format it, so that we can navigate with Ctrl-ArrowLeft and Ctrl-ArrowRight.

* or insert just the name of the function and one bracket.

I will see if I find some resource to jump into that tonight.

fredvs commented 4 years ago

Sorry, I give it up for now. I dont really catch if you want to paste things from Ctrl+Space or Ctrl+Shift+Space.

circular17 commented 4 years ago

No problemo. Have a good evening/night

fredvs commented 4 years ago

insert just the name of the function and one bracket.

In commit 813926b it has this:

When using Ctrl+Space, 2xclick on the list inserts just the name and one bracket if there is a '$' symbol. Otherwise it just inserts the name.

Using Ctrl+Shift+Space only gives info, 2xclick is disabled (for the moment).

Maybe we can let it like this for this release.

fredvs commented 4 years ago

And I even think that adding the bracket is too much and should be added manually.

But that is a very little detail.

Good night and many thanks for your release.

Fre;D

circular17 commented 4 years ago

That's nice. I noticed yet another thing. After doing Ctrl+Space, when I click an item in the autocompletion list, it scrolls down to the bottom, and I end up clicking another item. I suppose this is the case because the last item of the list is selected by default.

fredvs commented 4 years ago

OK, I will check that.

fredvs commented 4 years ago

OK, fixed in commit 1cbdca6

Thanks to note it.

fredvs commented 4 years ago

I am still not sure that adding always a '('when '$' is found is a ok because if it is a class , it should add a '.' .

circular17 commented 4 years ago

Do you have an example?

fredvs commented 4 years ago

Sans titre

fredvs commented 4 years ago

Done with lamp on.

video

fredvs commented 4 years ago

Hello.

In commit d03f42f, the list is formatted in Pascal flavour.

autocomplete2

autocomplete3

autocomplete4

Your advice is welcome!

fredvs commented 4 years ago

And in commit e284b47:

autocomplete5

autocomplete6

OK, now I really stop.

Have lot of fun!

circular17 commented 4 years ago

Sans titre

Oh so the $ sign was used for "." and for "(". Yeah that's ambiguous.

Looks like you progressed a bit on that, I will have a look.

fredvs commented 4 years ago

Oh so the $ sign was used for "." and for "(". Yeah that's ambiguous.

Huh, even more ambiguous... application() is a procedure too!

circular17 commented 4 years ago

Oh ok indeed I saw that. Then it is fair that the autocomplete would add a parenthesis.

To avoid that, I suppose you could remove the "()" when there are no parameters because anyway it is not necessary in Pascal.

Anyway I think it is quite convenient now.

fredvs commented 4 years ago

To avoid that, I suppose you could remove the "()" when there are no parameters because anyway it is not necessary in Pascal.

Are you talking for case like this?

Sans titre

Hum, ok, but, I already receive warnings in uos forum that said that the good usage in Pascal is to use "()" if no parameters are used for a procedure or function.

So I did add "()" fro each method without parameter, for example:

function Tuos_Init.loadlib(): cint32;

fredvs commented 4 years ago

Re-hum, did you try last commit because it should not have problems with methods without parameters.

fredvs commented 4 years ago

Ok, ok, I get it, you want avoid to oblige people to remove the '()' if they dont want to use a method vs a class. And the example of application is a perfect example.

[EDIT] By the way, apart for application, I did not find any other example.

OK, I will remove the '()'.

fredvs commented 4 years ago

Sorry, I am back again...

OK, to remove '()' but then also the ';' ? So, if a method without parameter is added via the auto-complete list, only the name will be added.

Are you ok with the behavior of now, for methods with parameters, all the methods with kind of parameters is added, with the comas, like this?

video

circular17 commented 4 years ago

OK, to remove '()' but then also the ';' ? So, if a method without parameter is added via the auto-complete list, only the name will be added.

Sounds good

Are you ok with the behavior of now, for methods with parameters, all the methods with kind of parameters is added, with the comas, like this?

Yes. I am not used to it, but it makes sense to me.

fredvs commented 4 years ago

Hello.

Yes. I am not used to it, but it makes sense to me.

Ok, so let do like this, if Ctrl+Space was used, 2xClick will insert, for a method, only themethod(

If it was 2XCliked from the auto-list of lamp-icon, all the method with parameter will be added.

I released ideU 2.2.0 : https://github.com/fredvs/ideU/releases

Many, many thanks Johann for all your perfect ideas, bug fixes and kind support.

Fre;D