Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ease-dev] Editor code completion

Hi Martin,

Adding getDescription method will be good I think. Then we can add descriptions using getProposals method in CompletionProviderDispatcher. I need to finish this part as soon as possible.  

Thank you. 

On Mon, Aug 17, 2015 at 10:11 PM, Martin Kloesch <martin.kloesch@xxxxxxxxx> wrote:
Hi Vidura,

The problem with the missing methods should be fixed and will hopefully get accepted today, so at least this issue is out of the way.

Regarding the CompletionDescriptionFormatter, I added a new method that gets an ICompletionSource and wraps to the corresponding calls based on the information. I am currently calling the method for the script shell only but I think I will extend the ICompletionSource interface with a getDescription method to have the same information available everywhere.

I'll let you know as soon as the changes are merged.

Best regards,
Martin


Am 2015-08-16 um 21:40 schrieb Vidura Mudalige:
Hi Martin,

I read your "Autocompletion feature sum-up" mail. It is very detailed and interesting. Good job.:) 

As I said before it is really important to set content proposal descriptions using "CompletionDescriptionFormatte". Can't we achieve that by modifying "ICompletionSource" to keep content proposal descriptions?

Thank you.
 

On Wed, Aug 12, 2015 at 11:01 PM, Martin Klösch <martin.kloesch@xxxxxxxxx> wrote:

Okay,

regarding the loaded modules it will probably easiest to get all suggestions using calculatePropoasals and filter for the 2 module types. If this method is too slow we must find another way anyways...

On Aug 12, 2015 19:02, "Vidura Mudalige" <vbmudalige@xxxxxxxxx> wrote:
It will help me a lot.:) It was working with the old implementation. I have used "CompletionDescriptionFormatter " to add content proposal descriptions to fields and modules. At the end I need you to call "ContentProposalModifier" instead of "ContentProposalAdapter" within you engine. Also I need to access all the loaded method and field objects like you had done in "ModuleCompletionProvider" using "fLoadedModules".

On Wed, Aug 12, 2015 at 10:10 PM, Martin Klösch <martin.kloesch@xxxxxxxxx> wrote:

Hi,

if you are using the CompletionDescriptionFormatter we can try this the other way around. If it was working with the old implementation I will simply try to add the code to my implementation and see if it is still working. In the end I guess you only need the IContentProposal with the correct string message or am I missing something?

Regards,
Martin

On Aug 12, 2015 18:21, "Vidura Mudalige" <vbmudalige@xxxxxxxxx> wrote:
Hi Martin,

Thanks for the reply.:)  Since your all commits have not been merged yet I cannot see any code completion suggestion. Therefore I cannot check my previous code which had been used to display help hovers for code completion suggestions. The other problem is I need to set my own content proposal descriptions for all the methods and fields. Earlier I had done it using "CompletionDescriptionFormatter" class. I don't know whether now is it working...

Thank you.

On Wed, Aug 12, 2015 at 8:31 PM, Martin Kloesch <martin.kloesch@xxxxxxxxx> wrote:
Hi Vidura,

sorry for the delay, my initial response never made it out of my outbox...

The actual implementation of the proposals is done in the CompletionProviderDispatcher class (org.eclipse.ease.ui.completion). This class is the basis for all completion calculation and handles everything to get the different providers. It offers the method calculateProposals that returns the suggestions in the format we discussed here. As a convenience I also implement the IContentProposalProvider interface (the one you are using) so the suggestions for the script shell are calculated in the getProposals method.

It seems not all changes have been merged yet. You can check out my changes on gerrit [1]. Although it is not merged yet I am pretty confident that the code mentioned above will not change anymore so you can at least prepare to add your code there as well.

I am not sure what exactly you need to display the suggestions you create. If you only need the class and the actual Method/Field object you are already good to go...

Best regards,
Martin

[1] https://git.eclipse.org/r/#/c/53260/


Am 2015-08-09 um 08:40 schrieb Vidura Mudalige:
Hi Martin,

I have a issue regarding the code completion suggestions.The tooltips I had provided for code completion suggestions was implemented by overriding some methods of "ContentProposalAdapter" and setting tooltip contents as content proposal descriptions. Since you removed the "ModuleCompletionProvider" class I can't find the location of assigning content proposal descriptions. And I don't know how to trigger your engine to get code completion suggestions. Because the previous activationKey("ctrl + space") doesn't work now. Do I have to change my implementation?  

Thank you.

On Wed, Aug 5, 2015 at 11:40 PM, Vidura Mudalige <vbmudalige@xxxxxxxxx> wrote:
Anyway if I can get the list of loaded modules in ScriptShell.java class I am okay with your implementation plan.:-) I will see your code tomorrow.

On Wed, Aug 5, 2015 at 10:22 PM, Martin Kloesch <martin.kloesch@xxxxxxxxx> wrote:
Hi Vidura,

you understand that correctly but the problem is that this class was removed in my latest commit :-/

While it was working for now it was only a proof of concept for auto completion and could not be extended in a way we need it. Therefore I implemented a new interface that can be reused for both the live shell and the editor. If Christian has time to review the commit today and everything is fine with him, you can check the code out tomorrow. In the end you will get a list of the mentioned ICompletionSource objects and just check their type for MODULE_METHOD or MODULE_VARIABLE enum values.

Best regards,
Martin




Am 2015-08-05 um 18:12 schrieb Vidura Mudalige:
Hi Martin,

Looks like you have considered things deeply. I am not sure whether it is necessary to go that much deep for my part. Because according to my current understanding if there is a way to get the list of loaded modules to ScriptShell.java class I can display tooltips to the editor (the combo box). The collection of all the loaded modules are located in ModuleCompletionProvider.java class. All I need is getting that collection to the ScriptShell.java class. Don't you think is there an easy way to do that? Please correct me if I haven't get the point correctly.

Thank you. 

On Tue, Aug 4, 2015 at 5:24 PM, Martin Kloesch <martin.kloesch@xxxxxxxxx> wrote:
Hi,

I am currently implementing the editor auto-completion and am thinking on how to have a generic solution for both auto-completion and the corresponding help information.

There is (sadly) no single extension point to add auto-completion to any editor and each language has its own interface. Since I already implemented the CompletionProviderDispatcher class for the shell auto-completion I thought it would be nice to offer a similar interface (or even better extend the existing) for editors as well. This interface would offer a way to parse documents for completion and return a generic list of proposals. These proposals could then be parsed by the different scripting languages to the format their completion extension needs. I guess that this generic list could also help simplify Vidura's help tips.

In the end I guess we would need:
  • The class the completion suggestion belongs to
  • The name of the completion suggestion
  • The actual object of the completion suggestion with corresponding type

We already have a ICompletionSource interface that stores basically this information. If we extend/change the ICompletionProvider interface to return a list of these ICompletionSource objects it would be easy to parse them to the corresponding types for different auto-completion. It would further make things for Vidura a lot easier (I guess). Do you agree?

I have been playing around with this solution and I can already reuse the completion providers for loaded modules and in addition the call-chain analysis for them. The actual completion providers are exactly the same, I only use different wrapper methods to have them in the correct format for the live-shell and the JS editor. They are loaded dynamically via an extension point so adding new ones is fairly simple.

Vidura, the ICompletionSource interface should already be upstream so you could have a look at it (org.eclipse.ease). Maybe this will simplify your task a bit and in exchange you can help me with the different type detection features for the editor since we both need them ;-)

Best regards,
Martin


_______________________________________________
ease-dev mailing list
ease-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ease-dev



--
Vidura Mudalige
Undergraduate
Computer Science & Engineering
University of Moratuwa.


_______________________________________________
ease-dev mailing list
ease-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ease-dev


_______________________________________________
ease-dev mailing list
ease-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ease-dev



--
Vidura Mudalige
Undergraduate
Computer Science & Engineering
University of Moratuwa.



--
Vidura Mudalige
Undergraduate
Computer Science & Engineering
University of Moratuwa.


_______________________________________________
ease-dev mailing list
ease-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ease-dev


_______________________________________________
ease-dev mailing list
ease-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ease-dev



--
Vidura Mudalige
Undergraduate
Computer Science & Engineering
University of Moratuwa.

_______________________________________________
ease-dev mailing list
ease-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ease-dev



--
Vidura Mudalige
Undergraduate
Computer Science & Engineering
University of Moratuwa.



--
Vidura Mudalige
Undergraduate
Computer Science & Engineering
University of Moratuwa.




--
Vidura Mudalige
Undergraduate
Computer Science & Engineering
University of Moratuwa.

Back to the top