Skip to main content

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

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.

Back to the top