Skip to content

Commit

Permalink
Land #904: Soft-dependency for MockProjectEx
Browse files Browse the repository at this point in the history
  • Loading branch information
KronicDeth committed Nov 7, 2017
2 parents bba8c76 + 4c7b125 commit 46934db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/org/elixir_lang/parser/ExternalRules.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.elixir_lang.parser;

import com.intellij.lang.PsiBuilder;
import com.intellij.mock.MockProjectEx;
import com.intellij.openapi.project.Project;
import org.elixir_lang.sdk.elixir.Release;
import org.elixir_lang.sdk.elixir.Type;
Expand All @@ -15,7 +14,11 @@ static boolean ifVersion(@NotNull PsiBuilder psiBuilder,
Project project = psiBuilder.getProject();
Release release = Type.getRelease(project);

assert !(release == null && project instanceof MockProjectEx) :

assert !(release == null &&
/* `project instanceof MockProjectEx`, but in a way that safe for IDEs that don't ship with
`MockProjectEx` */
project.getClass().getCanonicalName().equals("com.intellij.mock.MockProjectEx")) :
"Release MUST be set during testing of ifVersion rules:\n" +
"Call `setProjectSdkFromEbinDirectory();` to setup the Release.";

Expand Down

0 comments on commit 46934db

Please sign in to comment.