Community
Participate
Working Groups
Qualified names are currently plain strings which makes it not that easy to work with them. We should introduce an immutable type for this concept similar to QualifiedName { String toString(); int getSegmentCount(); String getSegment(int); Iterable<String> getSegments(); isPrefixOf(IQualifiedName) endsWithWildcard() getDelimiter() } This would make qualified names more independent from their concrete syntax, e.g. the index representation could be different from the language specific representation. What do others think?
Yeah, that one should be used in IEObjectDescription as well. In case a qualified name is not that "simple" (i.e. URI), one simply can't leverage the segments and delimiter stuff. But that should be rare and also not a big problem. I can imagine that this becomes kind of mandatory in order to solve the outstanding enhancements regarding namespace imports.
The QualifiedName should be an immutable list/array of Strings internally. It should offer factory methods to create new QNs based on existing ones. The QN should be used in the IQualifiedNameProvider and in EObjectDescriptions and in their clients. We have not agreed yet if the separator is integral part of the QN itself or passed in with regard to the context. There should also be an EDataType for QNs to be used e.g. in the EObjectDescriptions, but languages leveraging qualified names should not necessarily depend on this EDataType and rather stick to EString, at least for simple names. We should investigate if we can save memory by pooling the strings.
(In reply to comment #2) > We have not agreed yet if the separator is integral part > of the QN itself or passed in with regard to the context. > Let's start without this information and see whether we are going to miss it.
Pushed to master. QualifiedNames can be created 1) using the IQualifiedNameProvider for global (fully-qualified) names 2) using the IQualifiedNameConverter parsing a String into a QualifiedName respecting the language specific delimiter 3) by appending/triming existing QualifiedNames 4) by using the QualifiedName.create() method when the segments are already known. The new IQualifiedNameConverter also converts QualifiedNames back to String taking the delimiter into account. The delimiter is now an implementation detail of this component only. Similarly, the wildcard has become a property of the ImportedNamespaceAwareScopeProvider. Updated scopes and content assist to use QualifiedNames, as well as the JVM types and MWE. Added a bunch of tests for the new classes.
Closing all bugs that were set to RESOLVED before Neon.0