Can't use Aardvark Intellij plugin

75 views
Skip to first unread message

Aaron Wieland

unread,
Jan 13, 2013, 2:30:19 PM1/13/13
to aardv...@googlegroups.com
I'm new to both Gosu and Aardvark (perhaps an unwise combination), and decided to try the Aardvark plugin for Intellij. When I create a *.vark file, I get this exception:

Original exception: gw.vark.AardvarkFile in module _globalModule
java.lang.ClassNotFoundException: gw.vark.AardvarkFile in module _globalModule
    at gw.internal.gosu.parser.TypeLoaderAccess.getIntrinsicTypeByFullName(TypeLoaderAccess.java:352)
    at gw.internal.gosu.parser.TypeLoaderAccess.getByFullName(TypeLoaderAccess.java:938)
    at gw.lang.reflect.TypeSystem.getByFullName(TypeSystem.java:161)
    at gw.vark.idea.VarkProgramFileProvider.createParserOptionsInternal(VarkProgramFileProvider.java:74)
    at gw.vark.idea.VarkProgramFileProvider.access$000(VarkProgramFileProvider.java:26)
    at gw.vark.idea.VarkProgramFileProvider$3.createParserOptions(VarkProgramFileProvider.java:65)
    at gw.plugin.ij.lang.psi.impl.GosuProgramFileImpl.parseType(GosuProgramFileImpl.java:98)
    at gw.plugin.ij.lang.psi.impl.GosuProgramFileImpl.parseType(GosuProgramFileImpl.java:42)
    at gw.plugin.ij.lang.psi.impl.AbstractGosuClassFileImpl.parseType(AbstractGosuClassFileImpl.java:262)
    at gw.plugin.ij.lang.psi.impl.AbstractGosuClassFileImpl.reparseFromPsi(AbstractGosuClassFileImpl.java:454)
    at gw.plugin.ij.lang.parser.GosuParserAnnotator.annotate(GosuParserAnnotator.java:83)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:157)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:100)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$8.run(GeneralHighlightingPass.java:595)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:773)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$3600(GeneralHighlightingPass.java:80)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$10.run(GeneralHighlightingPass.java:779)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:84)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:776)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$3600(GeneralHighlightingPass.java:80)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$10.run(GeneralHighlightingPass.java:779)
    at com.intellij.codeInsight.daemon.impl.RefCountHolder.analyze(RefCountHolder.java:250)
    at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.analyze(HighlightVisitorImpl.java:135)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:776)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:641)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:203)
    at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:58)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:61)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:350)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1053)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:342)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:340)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:316)
    at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:134)
    at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:131)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31)
    at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70)
    at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)


And when I reopen Intellij IDEA with a *.vark file already open in the workspace, I also get this exception:

No parse for a non-empty string: ; type=gosu.FILE (gw.plugin.ij.lang.psi.stubs.elements.GosuStubFileElementType)
java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:54)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.e(LazyParseableElement.java:164)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:204)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:32)
    at com.intellij.psi.impl.source.tree.SharedImplUtil.getFirstChild(SharedImplUtil.java:44)
    at com.intellij.psi.impl.source.PsiFileImpl.getFirstChild(PsiFileImpl.java:757)
    at gw.plugin.ij.folding.GosuFoldingBuilder.appendDescriptors(GosuFoldingBuilder.java:191)
    at gw.plugin.ij.folding.GosuFoldingBuilder.buildFoldRegions(GosuFoldingBuilder.java:55)
    at com.intellij.lang.folding.LanguageFolding.buildFoldingDescriptors(LanguageFolding.java:78)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate.a(FoldingUpdate.java:179)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate.a(FoldingUpdate.java:94)
    at com.intellij.codeInsight.folding.impl.FoldingUpdate.updateFoldRegions(FoldingUpdate.java:73)
    at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl.a(CodeFoldingManagerImpl.java:287)
    at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl.access$200(CodeFoldingManagerImpl.java:51)
    at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl$4.run(CodeFoldingManagerImpl.java:211)
    at com.intellij.openapi.editor.impl.FoldingModelImpl.a(FoldingModelImpl.java:210)
    at com.intellij.openapi.editor.impl.FoldingModelImpl.runBatchFoldingOperationDoNotCollapseCaret(FoldingModelImpl.java:225)
    at com.intellij.codeInsight.folding.impl.CodeFoldingManagerImpl.buildInitialFoldings(CodeFoldingManagerImpl.java:228)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.initFolding(PsiAwareTextEditorImpl.java:46)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl3(FileEditorManagerImpl.java:737)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters.readExternalPanel(EditorsSplitters.java:338)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters.openFiles(EditorsSplitters.java:268)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$14$1$1.run(FileEditorManagerImpl.java:1261)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:117)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:93)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:81)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$14$1.run(FileEditorManagerImpl.java:1258)
    at com.intellij.openapi.wm.impl.commands.InvokeLaterCmd.run(InvokeLaterCmd.java:33)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:333)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:646)
    at java.awt.EventQueue.access$000(EventQueue.java:84)
    at java.awt.EventQueue$1.run(EventQueue.java:607)
    at java.awt.EventQueue$1.run(EventQueue.java:605)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:616)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:699)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:538)
    at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:420)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:54)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.e(LazyParseableElement.java:164)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.getLastChildNode(LazyParseableElement.java:210)
    at com.intellij.psi.impl.source.tree.LazyParseableElement.getLastChildNode(LazyParseableElement.java:32)
    at com.intellij.psi.impl.source.tree.SharedImplUtil.getLastChild(SharedImplUtil.java:49)
    at com.intellij.psi.impl.source.PsiFileImpl.getLastChild(PsiFileImpl.java:762)
    at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTreeFor(DefaultStubBuilder.java:71)
    at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTree(DefaultStubBuilder.java:37)
    at gw.plugin.ij.lang.psi.stubs.GosuFileStubBuilder.buildStubTree(GosuFileStubBuilder.java:16)
    at com.intellij.psi.stubs.StubTreeBuilder.buildStubTree(StubTreeBuilder.java:66)
    at com.intellij.psi.stubs.StubUpdatingIndex$3$1.run(StubUpdatingIndex.java:117)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:864)
    at com.intellij.psi.stubs.StubUpdatingIndex$3.map(StubUpdatingIndex.java:114)
    at com.intellij.psi.stubs.StubUpdatingIndex$3.map(StubUpdatingIndex.java:108)
    at com.intellij.util.indexing.MapReduceIndex.update(MapReduceIndex.java:215)
    at com.intellij.util.indexing.FileBasedIndex$24.run(FileBasedIndex.java:1660)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeNonCancelableSection(ProgressManagerImpl.java:136)
    at com.intellij.util.indexing.FileBasedIndex.a(FileBasedIndex.java:1656)
    at com.intellij.util.indexing.FileBasedIndex.indexFileContent(FileBasedIndex.java:1621)
    at com.intellij.util.indexing.UnindexedFilesUpdater.processFile(UnindexedFilesUpdater.java:64)
    at com.intellij.openapi.project.CacheUpdateSession.processFile(CacheUpdateSession.java:102)
    at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable$1.run(CacheUpdateRunner.java:228)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:864)
    at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.run(CacheUpdateRunner.java:232)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:434)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:145)


I can add text to the *.vark file, but pressing Enter has no effect -- newlines are ignored. Suffice it to say, without the ability to type multiple lines, I'm disabling the plugin for now. ;-)

I'm using the latest version of the plugin,  0.5-alpha08, with Intellij IDEA 11.1.4 and version 3.1 of the Gosu plugin. These errors occur under both Windows 7 and Ubuntu 12.10 (64-bit).

Ivan Dubrov

unread,
Jan 14, 2013, 11:34:30 AM1/14/13
to aardv...@googlegroups.com
Hi Aaron,

You need to attach aardvark-core JAR to your module (as a regular third-party library). You can download 0.5-aplha08 aardvark-core here: http://gosu-lang.org/nexus/content/groups/releases/org/gosu-lang/aardvark/aardvark-core/0.5-alpha08/aardvark-core-0.5-alpha08.jar

The full distribution of Aardvark 0.5-aplha08 could be downloaded here: http://gosu-lang.org/nexus/content/groups/releases/org/gosu-lang/aardvark/aardvark/0.5-alpha08/aardvark-0.5-alpha08-bin.zip


Note that this is new plugin in early stages of development, there is no documentation for it yet and it is far from being feature-complete. It is supposed to work with Aardvark 0.5, which is not officially released yet. Plugin should supports syntax/errors highlighting and code completion for .vark files. However, it does not compile .vark files (so you will see errors only if you open .vark file) and navigation inside .vark files does not work very well.

Aaron Wieland

unread,
Jan 18, 2013, 12:07:04 AM1/18/13
to aardv...@googlegroups.com
Hi Ivan,

Thank you for your explanation. Apologies for the late reply.

I attached the JAR and re-enabled the plugin, but continued to get the same errors as before. I can live without the syntax highlighting, and will try again when the plugin is more complete.

Aaron Wieland

unread,
Jan 18, 2013, 1:35:24 AM1/18/13
to aardv...@googlegroups.com
Oops, never mind. I have limited experience with IntelliJ (I've used it primarily for non-JVM languages), and hadn't added the dependency properly (the Export box wasn't checked). The plugin is working now.

Now I simply need to figure out how to convert certain Ant tasks, such as Ant.waitfor() with its nested condition elements.

Brian Chang

unread,
Jan 18, 2013, 1:49:06 AM1/18/13
to aardv...@googlegroups.com
Ah yes, nested task elements in Aardvark leave a lot to be desired.  I don't know if Ivan has any good ideas coming down the pipe, but when I was thinking this part through, I didn't have any good answers.

You might be able to get a hint of what you can do by looking through IntelliJ assistance with parameter names for your task - look out for the parameters whose names end in "List" or "Blocks".

Source: I'm the original author of Aardvark, but any work done in the last few months has been done by Ivan, and he's arguably the owner nowadays.

Aaron Wieland

unread,
Jan 19, 2013, 2:18:17 AM1/19/13
to aardv...@googlegroups.com
Thanks, Brian. I had figured out the "List"/"Blocks" convention from studying the limited examples and the Aardvark source. I wasn't getting much help from IntelliJ's assistance -- until just now, after an import was added: uses gw.vark.antlibs.Ant. Whoops.

The plugin has been useful for flagging errors, however. That's how I learned that the DefaultTarget property's type is now a method reference instead of a string. I couldn't seem to get the right syntax for the feature literal -- I kept getting the error, "A method with the name build and types was not found" -- and then found that it was actually correct when I ran the script. When I created a minimal test case to reproduce the problem, there was no error. I eventually realized that the error occurred only when the feature literal matched the file name (e.g., DefaultTarget = #build() when the file is named build.vark). The bug isn't specific to Aardvark, so I created an issue for the Gosu plugin: https://github.com/gosu-lang/Gosu-IntelliJ-Plugin/issues/10.

I still haven't figured out how to use the WaitFor task in an Aarvark script. The compiler is happy with this:

uses gw.vark.enums.WaitFor_Unit
uses org.apache.tools.ant.taskdefs.condition.Http
uses gw.vark.antlibs.Ant

function openfireCheck() {
  var http = new Http()
  http.setUrl("http://localhost:9090")
  Ant.waitfor(
    :checkevery = 1,
    :checkeveryunit = WaitFor_Unit.Second,
    :maxwait = 20,
    :timeoutproperty = "openfire.is.down",
    :httpList = {http})
}

(I thought Gosu might let me create the Http instance more succinctly as new Http() {:Url = "http://localhost:9090"}, but the compiler didn't like that. Does the object initializer syntax require a getUrl() method, even though it's setting a property?)

Running the openfireCheck target resulted in this error:

java.lang.ClassCastException: org.apache.tools.ant.taskdefs.WaitFor cannot be cast to org.apache.tools.ant.Task
at gw.vark.typeloader.AntlibTypeInfo$TaskCallHandler.handleCall(AntlibTypeInfo.java:253)
at gw.internal.gosu.runtime.GosuRuntimeMethods.invokeMethodInfo(GosuRuntimeMethods.java:117)
at program_.__Program__0.openfireCheck(Unknown Source)
[...]

So I think I've finally given up on Aardvark for now. My knowledge of Gosu has improved after all this fumbling, but it would probably improve faster if I focused on writing actual application code. ;-)
Reply all
Reply to author
Forward
0 new messages