Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Folding package/ file
Folding package/ file [message #1747425] Mon, 14 November 2016 15:21 Go to next message
Daniel Millard is currently offline Daniel MillardFriend
Messages: 5
Registered: November 2016
Junior Member
Hello forum,
I am relatively new to DSL and am having some issues with some of the features of xtext.

I've generated a grammar which is fine and am beginning to add features such as folding and outline generation.

The outline worked fine however its the folding which is causing an issue.

Within my mwe2 file I have been able to use fragments such as "fragment = ui.outline.OutlineTreeProviderFragment2 auto-inject {}" which auto generated the outline folder in the UI project.

I have had no such luck with the folding package.

Does anyone know how to do the same so the folding package/files are auto generated?

Is there a fragment I am missing or is there another workaround available?
Re: Folding package/ file [message #1747426 is a reply to message #1747425] Mon, 14 November 2016 15:29 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 10320
Registered: July 2009
Senior Member
HI,

there is no need to have a "Fragment" for everything. you can simply add the bindings you need and create the classes you need.
fragments are just "for convenience" and there is not a fragment for EVERY extension point.

so adding a

def Class<? extends IFoldingStructureProvider> bindIFoldingStructureProvider() {
MyDslFoldingStructureProvider
}

with

class MyDslFoldingStructureProvider extends DefaultFoldingStructureProvider {

}

should do the trick
Re: Folding package/ file [message #1747986 is a reply to message #1747426] Thu, 17 November 2016 13:05 Go to previous message
Daniel Millard is currently offline Daniel MillardFriend
Messages: 5
Registered: November 2016
Junior Member
That did work


Thank you for your quick response.
Previous Topic:Another problem with left recursion
Next Topic:Mark errors in the builded with the ant and maven plugins which use xtext
Goto Forum:
  


Current Time: Mon Mar 27 14:53:38 GMT 2017

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

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