Skip to main content



      Home
Home » Modeling » TMF (Xtext) » generateTracedFile is undefined for the type IFileSystemAccess2
generateTracedFile is undefined for the type IFileSystemAccess2 [message #1815981] Wed, 16 October 2019 09:23 Go to next message
Eclipse UserFriend
Hello again,

I am trying to modify my generator according to TypeFox demo, but I am struggling really hard.

First, the generateTracedFile method is not recognised in my project, even with TracingSugar imported (no typo, I have tried to copy-paste the name).

The following code fails:
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) 
	{	
	  fsa.generateTracedFile("TracedFile.h", resource.contents.head as MyLanguage, '''Hurray''') //here MyLanguage is the equivalent of 'Model' in demo
	}


with the following message:
"The method generateTracedFile(String, MyLanguage, String) is undefined for the type IFileSystemAccess2"

When I create a TracingSugar instance, then the following code does not give error:
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) 
	{	
	  val tracer = new TracingSugar()
	  tracer.generateTracedFile(fsa, heading.feature.name + "TracedList.h", resource.contents.head as MyLanguage, '''Hurray''')
	}


but it throws NullPointerException for TracingSugar.location.

Can someone point it out what am I doing wrong?
Re: generateTracedFile is undefined for the type IFileSystemAccess2 [message #1815982 is a reply to message #1815981] Wed, 16 October 2019 09:26 Go to previous messageGo to next message
Eclipse UserFriend
if you use the active annotation correct and use the thing as extension then it will be available as extensionmmethod

@tracedaccessors(MyDslFactory)
static class MyDslTraceExtension {

}

@Inject extension MyDslTraceExtension
Re: generateTracedFile is undefined for the type IFileSystemAccess2 [message #1815984 is a reply to message #1815982] Wed, 16 October 2019 09:31 Go to previous message
Eclipse UserFriend
Rookie mistake. It is working now.
Thank you a lot!
Previous Topic:Refactoring command with custom Refactor class fails
Next Topic:JVMModelInferrer code generation
Goto Forum:
  


Current Time: Fri Mar 21 23:53:48 EDT 2025

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

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

Back to the top