Community
Participate
Working Groups
Build Identifier: git: 0be8a0cd9c433d0e6d4a42f769a5ecb4a7e5d052 In my grammar, I use only simple names which can be arbitrary Strings. When I try to read a document into a slot with a name like "Xtext 2.0 Documentation", the default behavior would be to check if the QualifiedName of an object is matching ["Xtext 2", "0 Documentation"], so it would never match the actual QualifiedName ["Xtext 2.0 Documentation"]. Of course I could change the namespace delimiter to some string that would most likely not be used in a name, but I consider that to be a very ugly solution. In the attached patch I propose to add a boolean property like "useNamespaces", to make that behavior configurable. Please correct me, if this behavior is intended not to be configurable, so I can subclass the reader and add the field in my project. Reproducible: Always Steps to Reproduce: 1. create a new Xdoc project (prior to d60ef2c, i added the aforementioned ugly workaround) 2. name the document something like "foo.bar" 3. try to compile the pdf document
Created attachment 201798 [details] This patch adds a boolean property to the SlotEntry class
We should pass in and use a QualifiedNameConverter from the injector in the checkConfigurationInternal phase of AbstractReader. For now setting a non existent namespaceDelimiter (e.g. '$%§$&§&§') should also work.
If the property 'namespaceDelimiter' is set to an empty string (or null) no delimiter will be used. Instead a comparison by string (using toString() on the EObjectDescription's name) is done. /** * The delimiter to use for the names. When not set the dot (".") is used. * Must be set to an empty string ("") if no delimiter should be used. */ public void setNamespaceDelimiter(String namespaceDelimiter) { this.namespaceDelimiter = namespaceDelimiter; } pushed to master.
Requested via bug 522520. -M.