Community
Participate
Working Groups
Using the ImportURIScopingFragment, file-uris and platform:/plugin-uris won't work in the XtextHyperlink. (while platform:/resource and relative-paths are working). The linking accross file-boundaries do work with every kind of uri, but one cannot STRG-Click references to a imported file. The imported file is then not opened. Sample DSL with mew-setting is given below: --mydsl.xtext------------------------------------------- grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" import "http://www.eclipse.org/emf/2002/Ecore" as ecore Root : (includeFiles+=Include)* ( fragments+=Fragment | templates+=Template)* ; Include : 'include' importURI=STRING; Template : 'template' name =ID (fragments += FragmentRef)* ; Fragment : 'fragment' name=ID; FragmentRef : 'link fragment' fragment=[Fragment] ; --mydsl.mwe2-------------------------------------------- module org.xtext.example.mydsl.MyDsl import org.eclipse.emf.mwe.utils.* import org.eclipse.xtext.generator.* import org.eclipse.xtext.ui.generator.* var grammarURI = "classpath:/org/xtext/example/mydsl/MyDsl.xtext" var file.extensions = "mydsl" var projectName = "org.xtext.example.mydsl" var runtimeProject = "../${projectName}" Workflow { bean = StandaloneSetup { platformUri = "${runtimeProject}/.." } component = DirectoryCleaner { directory = "${runtimeProject}/src-gen" } component = DirectoryCleaner { directory = "${runtimeProject}.ui/src-gen" } component = Generator { pathRtProject = runtimeProject pathUiProject = "${runtimeProject}.ui" projectNameRt = projectName projectNameUi = "${projectName}.ui" language = { uri = grammarURI fileExtensions = file.extensions // Java API to access grammar elements (required by several other fragments) fragment = grammarAccess.GrammarAccessFragment {} // generates Java API for the generated EPackages fragment = ecore.EcoreGeneratorFragment { // referencedGenModels = "uri to genmodel, uri to next genmodel" } // the serialization component fragment = parseTreeConstructor.ParseTreeConstructorFragment {} // a custom ResourceFactory for use with EMF fragment = resourceFactory.ResourceFactoryFragment { fileExtensions = file.extensions } // The antlr parser generator fragment. fragment = parser.antlr.XtextAntlrGeneratorFragment { // options = { // backtrack = true // } } // java-based API for validation fragment = validation.JavaValidatorFragment { composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" //composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" // registerForImportedPackages = true } // scoping and exporting API // fragment = scoping.ImportURIScopingFragment {} // fragment = exporting.SimpleNamesFragment {} // scoping and exporting API //fragment = scoping.ImportNamespacesScopingFragment {} //fragment = exporting.QualifiedNamesFragment {} //fragment = builder.BuilderIntegrationFragment {} fragment = scoping.ImportURIScopingFragment {} fragment = exporting.SimpleNamesFragment {} // formatter API fragment = formatting.FormatterFragment {} // labeling API fragment = labeling.LabelProviderFragment {} // outline API fragment = outline.TransformerFragment {} fragment = outline.OutlineNodeAdapterFactoryFragment {} //fragment = outline.QuickOutlineFragment {} // quickfix API //fragment = quickfix.QuickfixProviderFragment {} // content assist API fragment = contentAssist.JavaBasedContentAssistFragment {} // generates a more lightweight Antlr parser and lexer tailored for content assist fragment = parser.antlr.XtextAntlrUiGeneratorFragment {} // project wizard (optional) // fragment = projectWizard.SimpleProjectWizardFragment { // generatorProjectName = "${projectName}.generator" // modelFileExtension = file.extensions // } } } } ------------------------------------------------------------------ And here are my samle-files: --test.mydsl------------------------------------------------------ fragment External1 fragment External2 --test2.mydsl----------------------------------------------------- //include 'file:/E:/sample/file/test.mydsl' //DOESN'T WORK //include 'platform:/plugin/x.y.z/test.mydsl' //DOESN'T WORK //include 'test.mydsl' //WORKS //include 'platform:/resource/testProject/test.mydsl' //WORKS template x link fragment External2
Any progress?
(In reply to comment #1) > Any progress? The ticket has not been scheduled we do not plan to work on this one in the near future. Note that you are always free to use your own implementation of the hyperlink helper.
See also bug 326506
We won't enhance the ImportURI mechanism in this way, since it has been superseded by the namespace based scoping approach.