Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

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 committed Aug 28, 2017
1 parent 0714912 commit 046a4d7
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 046a4d7

Please sign in to comment.