Skip to content

Commit

Permalink
workaround for IntelliJ model loader bug eclipse-archived/ceylon-ide-…
Browse files Browse the repository at this point in the history
…intellij#649

This is basically rubbish but it was much easier to do it here, and now
I can compile the IDE.

@bjansen @FroMage we'll need a better fix for this.
  • Loading branch information
gavinking authored and Voiteh committed Mar 21, 2020
1 parent 821ac42 commit 718c30d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions model/src/com/redhat/ceylon/model/loader/AbstractModelLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,19 @@ public Declaration call() throws Exception {
// in cases where the supertype is missing, which throws in reflection at class load.
return logModelResolutionException(x.getMessage(), module, "Unable to load type "+typeName).getDeclaration();
}
//work around a bug in the IntelliJ model loader
//see https://github.com/ceylon/ceylon-ide-intellij/issues/649
if (classMirror == null
&& theContainer instanceof ClassOrInterface
&& theDeclarationType == DeclarationType.TYPE) {
int index = typeName.lastIndexOf('.');
if (index>0) {
String name =
typeName.substring(0,index)
+ '$' + typeName.substring(index+1);
classMirror = lookupClassMirror(module, name);
}
}
if (classMirror == null) {
// special case when bootstrapping because we may need to pull the decl from the typechecked model
if(isBootstrap && typeName.startsWith(CEYLON_LANGUAGE+".")){
Expand Down

0 comments on commit 718c30d

Please sign in to comment.