witspirit/IntelliJBehave

*.story file autocompletion crashes InteliiJ

Closed this issue · 1 comments

Hello

First off, very cool plugin and very helpful.
I am having an issue when the auto completion popup comes up in story files, it just freezes my IntelliJ and makes me force quit the application.
There is nothing in the idea logs but there is however threadDump-freeze-* folder:
threadDumps-freeze-20190204-104700-IU-183.5429.30.zip

The auto-completion happens automatically and cannot be turned off f.e. for certain file types.
You can also turn it off completely in IntelliJ but that is not what I want.

Some more info:

  • IntelliJ version:
    image 10
  • amount of lines in *.story files in our repo: 4500+
  • it doesn't happen on every auto-completion, usually on lines that occur a lot (500+)

Side-note:
I tried reproducing and looking into this by cherry-picking this repo and setting it up as a plugin development project but ran into some issues:

  • Setting this up as a plugin development project is harder than expected. Especially with maven, I switched to gradle where the setup is easier in my opnion.
    My build.gradle looks like this:
buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20"
    }
}

plugins {
    id("org.jetbrains.kotlin.jvm") version "1.3.20"
    id("org.jetbrains.intellij") version "0.3.12"
    id("idea")
}

apply plugin: 'java'
apply plugin: 'maven'

group = 'com.github.witspirit'
version = '1.3-SNAPSHOT'

description = """IntelliJ Behave Dependencies"""

sourceCompatibility = 1.5
targetCompatibility = 1.5
tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

sourceSets {
    main {
        java {
            srcDirs = ['src']
        }
        resources {
            srcDirs = ['resources']
        }
        kotlin {
            srcDirs = ['src']
        }
    }
    test {
        java {
            srcDirs = ['test']
        }
        resources {
            srcDirs = ['testData']
        }
    }
}

intellij {
    version = "2018.2.3"
    setPlugins("org.jetbrains.kotlin:1.3.20-release-IJ2018.2-1")
}

repositories {
        
     maven { url "http://repo.maven.apache.org/maven2" }
}

dependencies {
    compile group: 'org.jbehave', name: 'jbehave-core', version:'3.9.4'
    compile group: 'org.hamcrest', name: 'hamcrest-all', version:'1.3'
    compile group: 'com.google.guava', name: 'guava', version:'18.0'
    testCompile group: 'junit', name: 'junit', version:'4.11'
    testCompile group: 'org.easytesting', name: 'fest-util', version:'1.2.5'
    testCompile group: 'org.easytesting', name: 'fest-assert-core', version:'2.0M10'
    testCompile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
}
  • This does not compile since the plugin seems to be compiled against an older version of the kotlin plugin.
    Error:
14:17:37: Executing task 'verifyPlugin'...

Parallel execution is an incubating feature.

> Task :compileKotlin FAILED
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2018.2.3/5bf630fc05fecf70296acb604313cc71a2134984/ideaIC-2018.2.3/lib/kotlin-stdlib-jdk8.jar (version 1.2)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2018.2.3/5bf630fc05fecf70296acb604313cc71a2134984/ideaIC-2018.2.3/lib/kotlin-stdlib.jar (version 1.2)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2018.2.3/5bf630fc05fecf70296acb604313cc71a2134984/ideaIC-2018.2.3/lib/kotlin-reflect.jar (version 1.2)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2018.2.3/5bf630fc05fecf70296acb604313cc71a2134984/ideaIC-2018.2.3/lib/kotlin-stdlib-jdk7.jar (version 1.2)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/unzipped.com.jetbrains.plugins/org.jetbrains.kotlin-1.3.20-release-IJ2018.2-1/Kotlin/lib/kotlin-stdlib-jdk8.jar (version 1.3)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/unzipped.com.jetbrains.plugins/org.jetbrains.kotlin-1.3.20-release-IJ2018.2-1/Kotlin/lib/kotlin-stdlib-common.jar (version 1.3)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/unzipped.com.jetbrains.plugins/org.jetbrains.kotlin-1.3.20-release-IJ2018.2-1/Kotlin/lib/kotlin-stdlib.jar (version 1.3)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/unzipped.com.jetbrains.plugins/org.jetbrains.kotlin-1.3.20-release-IJ2018.2-1/Kotlin/lib/kotlin-script-runtime.jar (version 1.3)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/unzipped.com.jetbrains.plugins/org.jetbrains.kotlin-1.3.20-release-IJ2018.2-1/Kotlin/lib/kotlin-reflect.jar (version 1.3)
    /Users/jeno/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/unzipped.com.jetbrains.plugins/org.jetbrains.kotlin-1.3.20-release-IJ2018.2-1/Kotlin/lib/kotlin-stdlib-jdk7.jar (version 1.3)
w: Consider providing an explicit dependency on kotlin-reflect 1.3 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/psi/NavigableKotlinPsiAnnotation.kt: (5, 33): Unresolved reference: JetElement
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/psi/NavigableKotlinPsiAnnotation.kt: (12, 21): Unresolved reference: JetElement
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/psi/NavigableKotlinPsiElement.kt: (6, 33): Unresolved reference: JetElement
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/psi/NavigableKotlinPsiElement.kt: (13, 33): Unresolved reference: JetElement
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/psi/NavigableKotlinPsiElement.kt: (22, 34): Unresolved reference: JetElement
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/psi/NavigableKotlinPsiMethod.kt: (5, 33): Unresolved reference: JetElement
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/psi/NavigableKotlinPsiMethod.kt: (12, 21): Unresolved reference: JetElement
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinAnnotationsLoader.kt: (9, 44): Unresolved reference: JetAnnotationsIndex
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinAnnotationsLoader.kt: (10, 33): Unresolved reference: JetFunction
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinAnnotationsLoader.kt: (29, 13): Unresolved reference: JetAnnotationsIndex
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinAnnotationsLoader.kt: (30, 35): Cannot infer a type for this parameter. Please specify it explicitly.
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinAnnotationsLoader.kt: (32, 73): Unresolved reference: JetFunction
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinPsiClassesLoader.kt: (5, 33): Unresolved reference: JetClass
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinPsiClassesLoader.kt: (6, 33): Unresolved reference: JetFile
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinPsiClassesLoader.kt: (21, 58): Unresolved reference: JetFile
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinPsiClassesLoader.kt: (22, 17): Unresolved reference: declarations
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinPsiClassesLoader.kt: (23, 39): Unresolved reference: getPsiClass
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinPsiClassesLoader.kt: (23, 51): Unresolved reference: it
e: /Users/jeno/git/IntelliJBehave/src/com/github/kumaraman21/intellijbehave/kotlin/support/services/KotlinPsiClassesLoader.kt: (23, 58): Unresolved reference: JetClass

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Compilation error. See log for more details

* 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 2s
1 actionable task: 1 executed
Compilation error. See log for more details
14:17:39: Task execution finished 'verifyPlugin'.

Regarding knowing what versions to use I think #44 can be very useful. Gonna try that out