Frage

I want to access the file generated by Xtext to compile it automatically. So I need its absolute path. It's enough to get the absolute path of the current project at run-time. Any idea how I can get it? I am working inside the "MyDslGenerator" Class. I tried to get it from the "resource" in override void doGenerate(Resource resource, IFileSystemAccess fsa) but couldn't find it.

Help is highly appreciated.

I ended up using this code:

var uri = (fsa as IFileSystemAccessExtension2).getURI(fileName)
War es hilfreich?

Lösung

maybe you can use the Interface org.eclipse.xtext.generator.IFileSystemAccessExtension2. the passed IFileSystemAccess may implement this interface too.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top