This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-24
Channels
- # adventofcode (4)
- # announcements (1)
- # aws (6)
- # babashka (18)
- # babashka-sci-dev (18)
- # beginners (12)
- # calva (43)
- # circleci (3)
- # clj-kondo (96)
- # cljdoc (2)
- # clojure (89)
- # clojure-australia (2)
- # clojure-europe (26)
- # clojure-nl (3)
- # clojure-norway (11)
- # clojure-spec (8)
- # clojure-uk (1)
- # clojurescript (28)
- # cursive (25)
- # datahike (6)
- # datalevin (56)
- # datomic (12)
- # docker (15)
- # emacs (9)
- # events (2)
- # figwheel (3)
- # fulcro (15)
- # gratitude (10)
- # introduce-yourself (8)
- # lsp (16)
- # malli (6)
- # nbb (2)
- # off-topic (23)
- # other-languages (2)
- # pathom (4)
- # portal (25)
- # practicalli (1)
- # re-frame (9)
- # releases (1)
- # shadow-cljs (8)
- # sql (6)
- # timbre (3)
When I ask clojure-lsp to create a new function (that doesn't exist) in a namespace, it puts the arguments beside the funtion name
IIRC if the function is preivar it should create in the next line, so maybe we are not follow the same standard
Yeah, I like the always on next line choice and only create a option for same line if requested that much
Me and @brcosta are considering creating a IntelliJ plugin that fully uses clojure-lsp and only that, with that we'd have all/most used editors option to use clojure-lsp :) More on 🧵
I know there is a new IDEA's editor on the horizon, but it seems it will take some time for most clojure Intellij users migrate to that (if that will happen) About the clojure-lsp plugin, for that to happen, there is a issue: Intellij plugins can only be created in kotlin/java or scala AFAIK, and I'd really like to do it in Clojure. I thought about creating a generic intellij plugin that allows you to create plugins in Clojure, just like exists for Scala (maybe simpler) I tried to first create ahttps://github.com/ericdallo/clojure-idea-plugin-example and build a jar which I could import on Intellij which would be the first step, and couldn't make that work, it seems intellij recognize the plugin properly (plugin.xml on META-INF), but crashes when try to read clojure stack:
com.intellij.diagnostic.PluginException: [Plugin: com.github.ericdallo.clojure_idea_plugin_example]
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.instantiate(ActionManagerImpl.java:251)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(ActionManagerImpl.java:221)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getActionImpl(ActionManagerImpl.java:570)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.java:558)
at com.intellij.openapi.actionSystem.DefaultActionGroup.unStub(DefaultActionGroup.java:393)
at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(DefaultActionGroup.java:352)
at com.intellij.openapi.actionSystem.ActionGroupStub.initGroup(ActionGroupStub.kt:34)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertGroupStub(ActionManagerImpl.java:278)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getActionImpl(ActionManagerImpl.java:570)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.java:558)
at com.intellij.openapi.actionSystem.DefaultActionGroup.unStub(DefaultActionGroup.java:393)
at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(DefaultActionGroup.java:352)
at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(DefaultActionGroup.java:331)
at com.intellij.ide.ui.customization.CustomizationUtil.getReordableChildren(CustomizationUtil.java:67)
at com.intellij.ide.ui.customization.CustomisedActionGroup.getChildren(CustomisedActionGroup.java:43)
at com.intellij.openapi.wm.impl.IdeMenuBar.expandActionGroup(IdeMenuBar.java:466)
at com.intellij.openapi.wm.impl.IdeMenuBar.doUpdateMenuActions(IdeMenuBar.java:371)
at com.intellij.openapi.wm.impl.IdeMenuBar.lambda$addNotify$2(IdeMenuBar.java:275)
at com.intellij.openapi.wm.impl.IdeMenuBar.lambda$doWithLazyActionManager$3(IdeMenuBar.java:288)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:324)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:134)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:190)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:501)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ExceptionInInitializerError
at clojure.lang.Namespace.<init>(Namespace.java:34)
at clojure.lang.Namespace.findOrCreate(Namespace.java:176)
at clojure.lang.Var.internPrivate(Var.java:156)
at com.github.ericdallo.clojure_idea_plugin_example.actions.MyAction.<clinit>(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.instantiate(ActionManagerImpl.java:234)
... 45 more
Caused by: java.io.FileNotFoundException: Could not locate clojure/core__init.class, clojure/core.clj or clojure/core.cljc on classpath.
at clojure.lang.RT.load(RT.java:462)
at clojure.lang.RT.load(RT.java:424)
at clojure.lang.RT.<clinit>(RT.java:338)
... 52 more
which is weird because I built a uberjar with clojure code inside, am I missing anything? I feel like is this close to workAlternative to Cursive?
I was thinking about focusing on static analysis using LSP, so one maybe could use Cursive only for REPL, similar to Cider and lsp-mode for Emacs. Would need to discuss with @U0567Q30W probably if that would work
The IJ plugin for Portal is written mostly in Clojure, so it's certainly possible. https://github.com/djblue/portal/tree/master/extension-intellij
Not exactly the same thing as you’re building, but I figured I’d mention https://github.com/gregsh/Clojure-Kit just in case it comes in handy in building your plug-in. 🙂
@U01GXCWSRMW that's really interesting, it seems it load clojure on the java file, seems like a alternative approach indeed if mine doesn't work in the end, thank you! @UDCGPTV9R thanks, I will surely check that from time to time to check how use IJ apis :)