Can't run Lua plugin in CLion (IntelliJ IDEA-based C++ IDE)

Issue #163 resolved
clion-support created an issue

It appears that for running files using Lua plugin in CLion (http://www.jetbrains.com/clion/) you need to define Lua SDK. Originally Lua plugin was dedicated for Intellij IDEA and these settings were managed via File -> Project Structure -> Project -> Project SDK there. In CLion, where project configuration actually resides in CMakeLists file, there is no UI for that.

As a workaround one can modify project settings manually in “<project_folder>/.idea/misc.xml” file. Add project-jdk-name and project-jdk-type to the following line: <component name="ProjectRootManager" version="2" project-jdk-name="LuaJ" project-jdk-type="Lua SDK" />

However more convenient option is needed.

Comments (11)

  1. Niklas Voss

    With the RC of CLion you get the following error when enabling the lua plugin (newest version from this repository build with IntelliJ 14.1):

    Plugin 'Lua' failed to initialize and will be disabled.  Please restart CLion.
    
    java.lang.IllegalArgumentException: Argument for @NotNull parameter 'virtualFile' of com/intellij/openapi/projectRoots/impl/ProjectRootContainerImpl.addRoot must not be null
        at com.intellij.openapi.projectRoots.impl.ProjectRootContainerImpl.addRoot(ProjectRootContainerImpl.java)
        at com.intellij.openapi.projectRoots.impl.ProjectJdkImpl.addRoot(ProjectJdkImpl.java:368)
        at com.sylvanaar.idea.Lua.sdk.KahluaSdk.createMockSdk(KahluaSdk.java:169)
        at com.sylvanaar.idea.Lua.sdk.KahluaSdk.initComponent(KahluaSdk.java:120)
        at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:568)
        at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610)
        at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245)
        at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211)
        at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:125)
        at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:359)
        at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:116)
        at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:87)
        at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:101)
        at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:504)
        at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:486)
        at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:170)
        at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:64)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:702)
        at java.awt.EventQueue$3.run(EventQueue.java:696)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:719)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    

    EDIT: forgot to mention the workaround appears to not work anymore.

  2. Chip

    Would love to see this plugin working in CLion. If there is anything I can do to assist please let me know.

  3. clion-support reporter

    Could you please provide this alternative version of plugin? Otherwize it would be difficult to test it with IDE.

    Thanks.

  4. JonA repo owner

    I have updated the plugin. You can update withing CLion to get the latest. Please report any issues, consider this an experimental feature.

  5. Marc Lehmkühler

    This issue reappeared in 1.0.97-145-163 when CLion 2016.2.3 is installed with an initial configuration. A workaround was to downgrade to 1.0.96-145-163 then configure a Lua interpreter and then updating the plugin.

  6. Log in to comment