Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Scope provider and content assist out of sync?
Scope provider and content assist out of sync? [message #654705] Wed, 16 February 2011 13:39 Go to next message
Eclipse UserFriend
Hi all,

I am quite happy with my self-implemented scope provider. Basically it does what I want him to do. Only problem is that content assist does not care about him. SO in eclipse I still get the proposals from the AbstractDeclarativeScopeProvider, but they are not valid any more. If I write down what I implemented as a scope it is valid in the editor.

I am quite sure that I saw content assist also working in sync with the scope provider some hours before. So my feeling is that eclipse somehow caches old content assists??

From my xtext ui project I am clicking on the generated plugin.xml to start another instance of eclipse with the editor working, with a clean workspace.

Any ideas welcome...

Michael
Re: Scope provider and content assist out of sync? [message #654711 is a reply to message #654705] Wed, 16 February 2011 13:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

did you debug whether your scope provider is used during content assist? Note that scoping for linking "can assume" the model to be complete, whereas content assist needs to consider partial models.

A frequent problem is that for scoping you assume a particular context type (polymorphic dispatch), but in content assist, you may not have the same context type (usually a supertype) and then the default mechanism is used.

Try investigating (i.e. debugging) in this direction.

Alex
Re: Scope provider and content assist out of sync? [message #654717 is a reply to message #654711] Wed, 16 February 2011 14:29 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

thanks for the hint. Yes, I did debug. The Scope provider is called, before when I execute content assist in the editor.
At least most of the times, but sometimes not, probably because of some caching deep in eclipse. Sometimes it is also executed 5 times for one content assist.

My scope provider is reusing the polymorphic dispatch of the super class for all contexts except the one I want to program myself.

Michael


PS:
At times I also noticed that the debugger and the sources are out of sync, which could be an indicator that starting second eclipse with the generated plugin.xml is not working smoothly for some reason.
Re: Scope provider and content assist out of sync? [message #654791 is a reply to message #654717] Thu, 17 February 2011 02:55 Go to previous message
Eclipse UserFriend
Hi,

the scope provider is (very probably be) called several times because content assist does not assme a complete model but considers all possible contiuations. Again, when content assist does not work, it is very probable that the context type is different from what you expect.

You can test this, by having your own implementation work on EObject , use your own construction only when the type is correct and otherwise delegate to the default implementation. Then upon invoking content assist, you can see whether the context type is as expected.

Alex
Previous Topic:Problems with the import statement in my grammar
Next Topic:an xtext project
Goto Forum:
  


Current Time: Sat Jul 05 06:22:24 EDT 2025

Powered by FUDForum. Page generated in 0.03168 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top