Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliJ IDEA 14 and scratch files #611

Closed
e1senh0rn opened this issue Nov 11, 2014 · 5 comments
Closed

IntelliJ IDEA 14 and scratch files #611

e1senh0rn opened this issue Nov 11, 2014 · 5 comments
Milestone

Comments

@e1senh0rn
Copy link

I have IDEA 14 Ultimate, build 139.224. Cursive installed as a plugin, version 0.1.41.
When I go to Tools -> New Scratch File... and select Clojure, new scratch file appears.
I type

(println "hello")

and receive this exception:

null
java.lang.NullPointerException
    at clojure.core$name.invoke(core.clj:1505)
    at plugin.language$with_language.invoke(language.clj:60)
    at plugin.index$var_meta_by_fqn.invoke(index.clj:182)
    at plugin.symbol$var_meta.invoke(symbol.clj:65)
    at plugin.resolve.symbol$resolve_symbol.invoke(symbol.clj:108)
    at clojure.lang.Var.invoke(Var.java:419)
    at cursive.psi.impl.symbols.SymbolReference$MyResolver.resolve(SymbolReference.java:67)
    at cursive.psi.impl.symbols.SymbolReference$MyResolver.resolve(SymbolReference.java:64)
    at com.intellij.psi.impl.source.resolve.ResolveCache.a(ResolveCache.java:141)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:169)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:161)
    at cursive.psi.impl.symbols.SymbolReference.multiResolve(SymbolReference.java:58)
    at plugin.resolve$resolve.invoke(resolve.clj:53)
    at plugin.resolve$resolve_keys.invoke(resolve.clj:196)
    at plugin.formatting$list_blocks.invoke(formatting.clj:226)
    at plugin.formatting$basic_blocks.invoke(formatting.clj:365)
    at plugin.formatting$sub_blocks.invoke(formatting.clj:377)
    at plugin.formatting$sub_blocks.invoke(formatting.clj:374)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.AFn.applyTo(AFn.java:151)
    at clojure.core$apply.invoke(core.clj:617)
    at clojure.core$memoize$fn__5049.doInvoke(core.clj:5735)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at plugin.formatting.ElementBlock.getSubBlocks(formatting.clj:48)
    at com.intellij.formatting.InitialInfoBuilder.a(InitialInfoBuilder.java:177)
    at com.intellij.formatting.InitialInfoBuilder.a(InitialInfoBuilder.java:236)
    at com.intellij.formatting.InitialInfoBuilder.iteration(InitialInfoBuilder.java:110)
    at com.intellij.formatting.FormatProcessor$WrapBlocksState.doIteration(FormatProcessor.java:1335)
    at com.intellij.formatting.FormatProcessor$State.iteration(FormatProcessor.java:1268)
    at com.intellij.formatting.FormatProcessor.iteration(FormatProcessor.java:266)
    at com.intellij.formatting.FormatterImpl.a(FormatterImpl.java:515)
    at com.intellij.formatting.FormatterImpl.adjustLineIndent(FormatterImpl.java:448)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$5.doPerform(CodeStyleManagerImpl.java:360)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$5.doPerform(CodeStyleManagerImpl.java:357)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerRunnable.perform(CodeStyleManagerRunnable.java:112)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.a(CodeStyleManagerImpl.java:357)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.access$500(CodeStyleManagerImpl.java:59)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$3.compute(CodeStyleManagerImpl.java:320)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$3.compute(CodeStyleManagerImpl.java:317)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:119)
    at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.adjustLineIndent(CodeStyleManagerImpl.java:317)
    at com.intellij.codeInsight.editorActions.EnterHandler$DoEnterAction.run(EnterHandler.java:423)
    at com.intellij.codeInsight.editorActions.EnterHandler.a(EnterHandler.java:170)
    at com.intellij.codeInsight.editorActions.EnterHandler.access$000(EnterHandler.java:53)
    at com.intellij.codeInsight.editorActions.EnterHandler$1.run(EnterHandler.java:75)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect$3.compute(PostprocessReformattingAspect.java:110)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:119)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:107)
    at com.intellij.codeInsight.editorActions.EnterHandler.executeWriteAction(EnterHandler.java:72)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:64)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:974)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:47)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:220)
    at com.intellij.codeInsight.template.impl.editorActions.EnterHandler.executeWriteAction(EnterHandler.java:55)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:64)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:974)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:47)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:220)
    at cursive.repl.toolwindow.actions.REPLEnterAction.doExecute(REPLEnterAction.java:32)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3$1.perform(EditorActionHandler.java:204)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:107)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.access$000(EditorActionHandler.java:36)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3.perform(EditorActionHandler.java:201)
    at com.intellij.openapi.editor.impl.CaretModelImpl$3.run(CaretModelImpl.java:355)
    at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:435)
    at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:346)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:198)
    at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:97)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
    at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:108)
    at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:82)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:614)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:663)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.d(IdeKeyEventDispatcher.java:513)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:546)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384)
    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)
@jstaffans
Copy link

👍 I would like to be able to use scratch files as well.

@lenaschoenburg
Copy link

👍 Even cooler If we could evaluate that in a scratch repl.

@cursive-ide
Copy link
Owner

I've investigated this, it appears to be a problem with the way scratch files are implemented. I've created an issue here.

@henryw374
Copy link

wrt evaluating scratch files, create a *.clj file in the scratches directory/area ... ie create via r-click->New-> clojure ns in the scratch area, instead of tools->new scratch

eval works from *.clj files!

@cursive-ide
Copy link
Owner

This exception is fixed, but unfortunately the problems with the way scratch files are implemented remain, which means that it's impossible to create scratch CLJS, CLJC or EDN files. But at least the Clojure ones should be more usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants