| Summary: | Case insensitive imports not completely implemented | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Mark Christiaens <mark.g.j.christiaens> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mark.g.j.christiaens, sebastian.zarnekow, sven.efftinge |
| Version: | 2.0.0 | Flags: | sebastian.zarnekow:
indigo+
|
| Target Milestone: | M7 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Maybe have a look also at ImportedNamespaceAwareLocalScopeProvider.getWildCard(). It returns by default a "*". I think, after that, the "*" is not dealt with in a case-insensitive manner. So if I override the getWildcard to return "all" (which is the wildcard in VHDL) then things seem to go wrong. Pushed to master. I think this bug needs a little more work. When I do two consecutive imports that are identical except for the capitalization of the importedNamespacePrefix then the resulting ImportScopes are different. That in turn results in linking warnings. The culprit is:
@Override
public boolean equals(Object obj) {
if (this==obj)
return true;
if (obj==null)
return false;
if (obj instanceof ImportNormalizer) {
ImportNormalizer other = (ImportNormalizer)obj;
//TODO not ignore case aware
return other.hasWildCard==hasWildCard &&
other.ignoreCase==ignoreCase &&
other.importedNamespacePrefix.equals(importedNamespacePrefix);
}
return false;
}
The final "equals" should convert both the importedNamespacePrefixes to lower or upper case while comparing when dealing with case-insensitive imports.
Pushed to master Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
Build Identifier: I20101028-1441 Case insensitive imports don't seem to be fully supported yet. For example in ImportScope.getLocalElements: ... Function<IEObjectDescription, IEObjectDescription> aliaser = new Function<IEObjectDescription, IEObjectDescription>() { public IEObjectDescription apply(IEObjectDescription from) { final QualifiedName deresolved = normalizer.deresolve(from.getName()); if (deresolved==null) throw new IllegalStateException("Couldn't deresolve "+from.getName()+" with import "+normalizer); return new AliasedEObjectDescription(deresolved, from, ignoreCase); } }; ... The IllegalStateException is thrown. It seems that the ImportNormalizer thinks it can handle the from.getName but then tries to deresolve with a namespace prefix with the wrong case. Reproducible: Always