문제

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)
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top