Darkyenus / glsl4idea

A GLSL language plugin for IntelliJ IDEA
GNU Lesser General Public License v3.0
101 stars 31 forks source link

Not able to use with Jetbrains AppCode #74

Closed DHTMLGoodies closed 9 years ago

DHTMLGoodies commented 9 years ago

I get the following error on my Mac when trying to enable the GLSL plugin. I'm not sure if the error is related to AppCode or to the GLSL plugin.

Error message: Plugin 'GLSL' failed to initialize and will be disabled. Please restart AppCode.

java.lang.NoSuchMethodError: com.intellij.ide.fileTemplates.FileTemplateManager.getDefaultInstance()Lcom/intellij/ide/fileTemplates/FileTemplateManager;
    at glslplugin.components.GLSLTemplatesLoader.initComponent(GLSLTemplatesLoader.java:39)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:567)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:609)
    at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:236)
    at com.intellij.util.pico.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:223)
    at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:210)
    at org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer.getComponentInstance(AbstractDelegatingMutablePicoContainer.java:75)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:124)
    at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:358)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:115)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:86)
    at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:110)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:511)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:493)
    at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:158)
    at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:66)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:364)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
agatti commented 9 years ago

AppCode 3.5.1 is built upon the old IntelliJ 13 core, rather than IntelliJ 14 like CLion. Reverting the change described here: https://github.com/Darkyenus/glsl4idea/issues/23#issuecomment-94308940 makes it work for AppCode, albeit breaking it for CLion and so on. A quick and easy workaround using runtime class reflection shouldn't be much of an issue I guess.

AppCode can be detected by calling ApplicationInfo.getInstance().getBuild().getProductCode() and checking if the product code is OC.

Darkyenus commented 9 years ago

Should be fixed in c3559fa84aaab5069b06fe9183c417865787b78b, reopen if more problems arise.