Xtext content description identification [message #1799528] |
Sat, 08 December 2018 08:54  |
Eclipse User |
|
|
|
Hi
Xtext introduced the magic ability for a text rather than XML file to be the source for an EMF Resource, but the integration seems sub-optimal. When EMF creates the Resource it locates an appropriate ResourceFactory by inviting a list of known ContentHandlers to handle the URI. This typically involves an extension match, but for unknown extensions it falls back to an XML handler that analyzes the xmlns declarations in the XML pre-amble. This of course fails for a textual source file and eventually the ResourceFactory search gives up on content descriptions and instead uses the file extension where an XtextResourceFactory does the right thing.
So it works, but we waste time on a failed XML analysis.
Surely a ContentHandler should be installed for each Xtext file extension that returns a VALID content description with null content type so that the XML analysis is bypassed accelerating the processing that ends up using the extension registration?
(This will obviously further aggravate use of 'wrong' extensions, but anyone who tries to use "java" as the extension of their DSL is probably doomed to chaos anyway.)
Regards
Ed Willink
|
|
|
|
Powered by
FUDForum. Page generated in 0.16436 seconds