How to use FileResourceHandler in xtext web for importUri resolution [message #1829600] |
Tue, 07 July 2020 09:22  |
Eclipse User |
|
|
|
i am using xtext web to load dsl files from a custom path using FileResourceHandler, but when the file gets loaded in the ACE editor, the validation of cross references fail. the xtext-service/validate network call fails.
How can I configure dsl runtime to resolve importUri from custom path (for eg: /opt/xtext).
|
|
|
|
Re: How to use FileResourceHandler in xtext web for importUri resolution [message #1829645 is a reply to message #1829623] |
Wed, 08 July 2020 04:47   |
Eclipse User |
|
|
|
Yes, I have checked the examples and have working code where both load and save services work. Using FileResourceHandler, I am able to specify the base directory of the dsl files (/opt/xtext/). I have also added ImportUriGlobalScopeProvider to runtime module, to resolve importUris.
But after the load service loads the file, the validation service does not compile the cross references.
The below is debug information of load/validate services for XtextWebDocument (com/example/dsl/Sample.mydsl). The problem is that the base url (/opt/xtext/) is not resolved in case of validation service, instead uses application launch path. If i copy dsl files to D:/Program%20Files/eclipse/eclipse, the cross referencing works.
Load service
org.eclipse.xtext.linking.lazy.LazyLinkingResource, uri='/opt/xtext/com/example/dsl/Sample.mydsl'
resourceset normalizationmap {/opt/xtext/com/example/dsl/Sample.mydsl=file:/opt/xtext/com/example/dsl/Sample.mydsl}
Validation service
org.eclipse.xtext.linking.lazy.LazyLinkingResource, uri='com/example/dsl/Sample.mydsl'
{com/example/dsl/Sample.mydsl=file:/D:/Program%20Files/eclipse/eclipse/com/example/dsl/Sample.mydsl}
[Updated on: Wed, 08 July 2020 04:52] by Moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.30497 seconds