Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Folding package/ file
Folding package/ file [message #1747425] Mon, 14 November 2016 10:21 Go to next message
Eclipse UserFriend
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 10:29 Go to previous messageGo to next message
Eclipse UserFriend
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 08:05 Go to previous message
Eclipse UserFriend
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: Sat Aug 23 01:08:07 EDT 2025

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

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

Back to the top