UniFormal / IntelliJ-MMT

An IntelliJ-Plugin for MMT (under development)
3 stars 1 forks source link

Import errors #5

Closed ComFreek closed 4 years ago

ComFreek commented 5 years ago

(No need to look at today, just filing this before I quit working on it for today 😄)

  1. Cloned this repo
  2. Opened the IntelliJ Project, selected OpenJDK 11 as the Project JDK and Scala ??? as the Scala SDK.
  3. Ran run:IDE and got the errors below.

Visual: image

Textual:

16:13:22: Executing task 'runIde -Xmx8g'...

> Task :compileJava UP-TO-DATE

> Task :compileScala
Pruning sources from previous analysis, due to incompatible CompileSetup.
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:9: object MMTTheory is not a member of package info.kwarc.mmt.intellij.language.psi
import info.kwarc.mmt.intellij.language.psi.{MMTTheory, MMTTheoryheader}
       ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:10: object imps is not a member of package info.kwarc.mmt.intellij.language.psi
import info.kwarc.mmt.intellij.language.psi.imps._
                                            ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:20: not found: type MMTNamespace_impl
    val nss = PsiTreeUtil.findChildrenOfType(file,classOf[MMTNamespace_impl])
                                                          ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:22: value getTextRange is not a member of Nothing
      nss.reverse.find(_.getTextRange.getStartOffset < self.getNode.getPsi.getTextRange.getStartOffset).foreach { ns =>
                         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:30: not found: type MMTImport_impl
    val imports = PsiTreeUtil.findChildrenOfType(file,classOf[MMTImport_impl])
                                                              ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:34: value getPname is not a member of Nothing
        (i.getPname.getText,i.getUri.getText)
           ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:34: value getUri is not a member of Nothing
        (i.getPname.getText,i.getUri.getText)
                              ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:45: not found: type MMTRule_impl
  lazy val uri : String = if (this.getParent.isInstanceOf[MMTRule_impl]) {
                                                          ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:92: not found: type MMTTheoryheader
    val head = findNotNullChildByClass(classOf[MMTTheoryheader])
                                               ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:93: value getPname is not a member of Nothing
    val name = head.getPname.getText
                    ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\References.scala:100: not found: type MMTTheoryheader
  def getTheoryheader() : MMTTheoryheader
                          ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:20: object MMTParserTypes is not a member of package info.kwarc.mmt.intellij.language.psi
import info.kwarc.mmt.intellij.language.psi.MMTParserTypes
       ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:21: object imps is not a member of package info.kwarc.mmt.intellij.language.psi
import info.kwarc.mmt.intellij.language.psi.imps._
                                            ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:27: not found: type MMTLexer
class MMTLexerAdapter extends FlexAdapter(new MMTLexer(null))
                                              ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:37: not found: value MMTParserTypes
  override def getWhitespaceTokens: TokenSet = TokenSet.create(MMTParserTypes.WHITESPACE)
                                                               ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:41: not found: value MMTParserTypes
  override def createElement(node: ASTNode): PsiElement = MMTParserTypes.Factory.createElement(node)
                                                          ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:47: not found: type MMTParser
  override def createParser(project: Project): PsiParser = new MMTParser
                                                               ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:82: not found: value MMTParserTypes
    case MMTParserTypes.MD => MD
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:83: not found: value MMTParserTypes
    case MMTParserTypes.DD => DD
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:84: not found: value MMTParserTypes
    case MMTParserTypes.OD => OD
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:86: not found: value MMTParserTypes
    case MMTParserTypes.THEORY_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:87: not found: value MMTParserTypes
         MMTParserTypes.ABBREV_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:88: not found: value MMTParserTypes
         MMTParserTypes.ALIAS_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:89: not found: value MMTParserTypes
         MMTParserTypes.ARROW_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:90: not found: value MMTParserTypes
         MMTParserTypes.EQ_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:91: not found: value MMTParserTypes
         MMTParserTypes.IMPLICIT_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:92: not found: value MMTParserTypes
         MMTParserTypes.IMPORT_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:93: not found: value MMTParserTypes
         MMTParserTypes.INCLUDE_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:94: not found: value MMTParserTypes
         MMTParserTypes.NAMESPACE_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:95: not found: value MMTParserTypes
         MMTParserTypes.NOT_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:96: not found: value MMTParserTypes
         MMTParserTypes.PARAM_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:97: not found: value MMTParserTypes
         MMTParserTypes.ROLE_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:98: not found: value MMTParserTypes
         MMTParserTypes.RULE_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:99: not found: value MMTParserTypes
         MMTParserTypes.STRUCTURE_KEY |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:100: not found: value MMTParserTypes
         MMTParserTypes.COLON_KEY  |
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:101: not found: value MMTParserTypes
         MMTParserTypes.VIEW_KEY
         ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:159: not found: type MMTModcomment_impl
        case _: MMTModcomment_impl | _: MMTDeclComment_impl | _: MMTObjComment_impl  =>
                ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:159: not found: type MMTDeclComment_impl
        case _: MMTModcomment_impl | _: MMTDeclComment_impl | _: MMTObjComment_impl  =>
                                        ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:159: not found: type MMTObjComment_impl
        case _: MMTModcomment_impl | _: MMTDeclComment_impl | _: MMTObjComment_impl  =>
                                                                 ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:161: not found: type MMTNotComp_impl
        case _: MMTNotComp_impl =>
                ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:164: not found: type MMTPname_impl
        case _: MMTPname_impl =>
                ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:166: not found: type MMTTerm_impl
        case _: MMTTerm_impl =>
                ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:168: not found: type MMTUri_impl
        case urie: MMTUri_impl =>
                   ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:170: not found: type MMTDerivedsimple_impl
        case _: MMTDerivedsimple_impl | _: MMTDerivedheader_impl =>
                ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:170: not found: type MMTDerivedheader_impl
        case _: MMTDerivedsimple_impl | _: MMTDerivedheader_impl =>
                                           ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\language\SyntaxHighlighting.scala:172: not found: type MMTError_impl
        case e : MMTError_impl =>
                 ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\ui\Sidekick.scala:70: a pattern match on a refinement type is unchecked
        case Some(n :DefaultMutableTreeNode) if n.getUserObject.isInstanceOf[Element] =>
                                                                            ^
C:\Users\ComFreek\Desktop\IntelliJ-MMT\src\main\scala\info\kwarc\mmt\intellij\ui\Sidekick.scala:119: a pattern match on a refinement type is unchecked
      if (uo.isInstanceOf[Element]) {
                         ^
two warnings found
46 errors found

> Task :compileScala FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileScala'.
> Compilation failed

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 21s
2 actionable tasks: 1 executed, 1 up-to-date
Compilation failed
16:13:45: Task execution finished 'runIde -Xmx8g'.
Jazzpirate commented 5 years ago

Because the grammar needs to be built first by compiling the .bnf and .flex files, see https://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/grammar_and_parser.html and https://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/lexer_and_parser_definition.html

Not sure if this should be documented anywhere, since for now nobody ever needs to build the plugin except for me.

ComFreek commented 4 years ago

I've now documented this in commit e16f647.