An improvement for ImportNormalizers #3152
tfonda-fbk
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'd like to share one improvement I've recently brought to ImportNormalizers inside my project.
I needed to support referencing elements via one of their partially qualified names, assuming the first segment of the partially qualified name corresponds to the simple name of element imported via an import statement (one that uses Xtext's inbuilt support for namespaces imports). To make it clearer, suppose that i have a file with the following content:
Out of the box, Xtext does not allow me to reference
c
in a different file by only importing exactly one of its containers, i.e. without a wildcard. I mean, Xtext supports the following:and the following:
but not the following:
nor the following:
I needed to support the last two scenarios, so I ended hooking up a custom ImportNormalizer implementation. My changes wrt. the original one can be summarized as follows:
I have only changed the code for the
ignoreCase == false
case, as that's the one I'm interested in. What do you think? Is this feature worth implementing in Xtext? If so, I could complete and polish up my implementation, and then open a PR.Cheers!
Beta Was this translation helpful? Give feedback.
All reactions