This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-26
Channels
- # announcements (1)
- # asami (7)
- # aws (3)
- # babashka (30)
- # beginners (21)
- # calva (48)
- # cider (11)
- # clj-commons (5)
- # clj-kondo (12)
- # cljdoc (5)
- # cljfx (1)
- # cljs-dev (32)
- # cljsrn (4)
- # clojure (218)
- # clojure-europe (88)
- # clojure-nl (11)
- # clojure-uk (31)
- # clojurescript (8)
- # cursive (98)
- # data-science (6)
- # datomic (49)
- # emacs (12)
- # events (4)
- # fulcro (47)
- # graalvm (3)
- # graphql (4)
- # introduce-yourself (5)
- # java (13)
- # juxt (9)
- # lsp (74)
- # meander (3)
- # membrane (4)
- # missionary (31)
- # off-topic (24)
- # pathom (41)
- # portal (4)
- # reagent (3)
- # releases (1)
- # remote-jobs (3)
- # rewrite-clj (4)
- # shadow-cljs (10)
- # slack-help (2)
- # testing (20)
- # tools-deps (43)
is it possible to set up cursive to auto-format on save using cljfmt? in emacs, when one uses clojure-lsp, you get lsp-format-buffer, which uses cljfmt under the hood. perhaps cursive uses clojure-lsp and can therefore use cljfmt via lsp?
Not yet, but it’s something I’m looking into as part of a change I’m just about to release.
Or rather, I’m about to release the first version of it, it will need more refinement.
oh wow you answered quick haha - i just amended my question!
Haha, yes. I’m planning to support cljfmt in one of two ways, either modifying Cursive to allow its formatting to be configured from the cljfmt file, or by configuring an external formatter which (I think) will allow what you want.
Are there forms where you can’t get the formatting from Cursive to match cljfmt, or is it just that it’s a pain to maintain the config in two places?
ok great!
so, we have one cursive user and 5 emacs users, and whenever cursive-guy plus anyone else collaborate, the diffs are full of formatting changes
yes! things like datalog's or-join and tufte/p being indented with two spaces rather than at the end of the function line, and that open issue with map values indenting at the end of the key even though its on a new line
I’m interested in cases where Cursive can’t support something that cljfmt does. Otherwise it may just be a matter of configuring his Cursive setup.
Can you give me some examples of the or-join and tufte/p thing? I’ll fix the map value thing in the next EAP (not this one I’m just about to release).
sure! we have this cljfmt config:
{:indents {tufte/p [[:inner 0]]
or-join [[:inner 0]]}}
without the config:
(tufte/p :metric-name
(measured-code-here))
(d/q '[:find ?x :where
(or-join [?x]
[?x :a]
[?x :b])])
with the config:
(tufte/p :metric-name
(measured-code-here))
(d/q '[:find ?x :where
(or-join [?x]
[?x :a]
[?x :b])])
we have more such indentation rules, all applying the same basic rule to lots of forms - compojure, stuartsierra/component, guardrails, etc
ideally we'd maintain one cljfmt config with all of this, and have it in the repo with the code. we've done the same with clj-kondo stuff and it's fantastic
So in Cursive, he should customise the indentation for that form like this: https://cursive-ide.com/userguide/formatting.html#code-style-settings. As described there, he should set the config to “1”, which is one special parameter and the rest just indented.
ok, that's promising! and having that in source control?
Under Preferences | Editor | Code Style | Clojure, set the scheme to “Project”. That will create file in the .idea folder which contains that config for that project.
ok perfect. thanks Colin!
No worries. There’s a section in that doc about matching emacs too, in case there are other cases missing. If you have any other queries, let me know.
will do!
I already havehttps://github.com/Liverm0r/dotfiles/commit/e514831dfdc115d530444874bc2f37bebae8cbc9#diff-2097776acc409b1c4c6a8ab45fd000f47833f462dae606f010ee7bfaa37b9444 locally, so implementing it won’t be hard.
Feature 1.
Idea actions for deleting/selecting a form.
Feature 2.
Idea action to comment out a form.
* form is one of "…", (…), {…}, […]
I need 1 to be able to have something like vim-sexp with idea-vim (an emacs users also can do this). I’ve written here about the problem https://clojurians.slack.com/archives/C0744GXCJ/p1642500532023400
IntelliJ IDEA 2021.3.2 RC (Community Edition)
Build #IC-213.6777.38, built on January 25, 2022
Runtime version: 11.0.13+7-b1751.25 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Registry:
scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins:
org.intellij.plugins.hcl (0.7.14)
net.seesharpsoft.intellij.plugins.csv (2.18.2)
name.kropp.intellij.makefile (213.5744.224)
de.thomasrosenau.diffplugin (2.1.8-imrekoszo)
com.namespace.sort.namespace-sort-plugin (1.7-imrekoszo-2021-3-linebreak)
com.jetbrains.plugins.ini4idea (213.5744.190)
org.jetbrains.kotlin (213-1.6.10-release-944-IJ6461.79)
org.jetbrains.idea.grammar (2021.1.2)
gherkin (213.6461.19)
dev.monogon.cuelang (0.8.3)
StringToolsPlugin (4.0)
String Manipulation (8.25.203.5981.1)
Key Promoter X (2021.3)
mobi.hsz.idea.gitignore (4.3.0)
com.cursiveclojure.cursive (1.12.2-eap2-2021.3)
com.github.shinichy.integrant (0.1.1)
com.github.brcosta.cljstuffplugin (0.5.2)
EDN-JSON Converter (0.0.5)
org.intellij.scala (2021.3.18)
Kotlin: 213-1.6.10-release-944-IJ6461.79
Hi @U0567Q30W, no plans for “Optimize imports” to remove unused imports?
@U0HJNJWJH Yes, there’s a (potentially incomplete) to-do list in the release email, I’m hoping to get to it all over this EAP series.
Hmm interesting error I got at stub generation, perhaps it's to do with me using clojure 1.11.0-alpha4
definitely, clojure.core/abs
is new in alpha4
the warning is correct and fine though (it's ok to overwrite the function)
issue out there for this already looks like https://github.com/dm3/clojure.java-time/issues/82
The stub generation currently assumes that anything output to stderr is an error. I could maybe relax that, but I’d have to ensure that I can be sure that the generation actually terminated correctly.
hello, I was trying to find the setting to auto organize namespaces, but now when I go to the Clojure style part the screen never loads, it just stays in the state demonstrated by the screenshot
@U066U8JQJ Are you seeing the same error? It’s an NPE in FormParameterCodeStylePanel.getPanel
.
I got this error:
java.lang.RuntimeException: Unexpected value null
at cursive.formatter.codeStyle.FormParameterCodeStylePanel.<init>(CodeStyleConfig.kt:195)
at cursive.formatter.codeStyle.ClojureCodeStyleMainPanel.initTabs(CodeStyleConfig.kt:93)
at com.intellij.application.options.TabbedLanguageCodeStylePanel.ensureTabs(TabbedLanguageCodeStylePanel.java:163)
at com.intellij.application.options.TabbedLanguageCodeStylePanel.getPreviewText(TabbedLanguageCodeStylePanel.java:266)
at com.intellij.application.options.CodeStyleAbstractPanel.createEditor(CodeStyleAbstractPanel.java:144)
at com.intellij.application.options.CodeStyleAbstractPanel.<init>(CodeStyleAbstractPanel.java:105)
at com.intellij.application.options.TabbedLanguageCodeStylePanel.<init>(TabbedLanguageCodeStylePanel.java:68)
at cursive.formatter.codeStyle.ClojureCodeStyleMainPanel.<init>(CodeStyleConfig.kt:84)
at cursive.formatter.codeStyle.ClojureCodeStyleConfigurable.createPanel(CodeStyleConfig.kt:446)
at cursive.formatter.codeStyle.ClojureCodeStyleConfigurable.createPanel(CodeStyleConfig.kt:442)
at com.intellij.application.options.CodeStyleAbstractConfigurable.createComponent(CodeStyleAbstractConfigurable.java:36)
at com.intellij.application.options.codeStyle.NewCodeStyleSettingsPanel.<init>(NewCodeStyleSettingsPanel.java:32)
at com.intellij.ConfigurableFactory$createCodeStyleConfigurable$codeStyleConfigurableWrapper$1.createPanel(ConfigurableFactory.kt:32)
at com.intellij.application.options.codeStyle.CodeStyleMainPanel.ensurePanel(CodeStyleMainPanel.java:252)
at com.intellij.application.options.codeStyle.CodeStyleMainPanel.ensureCurrentPanel(CodeStyleMainPanel.java:237)
at com.intellij.application.options.codeStyle.CodeStyleMainPanel.highlightOptions(CodeStyleMainPanel.java:312)
at com.intellij.application.options.CodeStyleConfigurableWrapper.lambda$enableSearch$0(CodeStyleConfigurableWrapper.java:167)
at com.intellij.openapi.options.newEditor.SpotlightPainter.update(SpotlightPainter.java:75)
at com.intellij.openapi.options.newEditor.SettingsEditor$6.updateNow(SettingsEditor.java:272)
at com.intellij.openapi.options.newEditor.SettingsEditor.lambda$updateStatus$3(SettingsEditor.java:470)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:240)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:385)
at com.intellij.util.Alarm$Request.run(Alarm.java:374)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:220)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187)
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:891)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
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.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.desktop/java.awt.Dialog.show(Dialog.java:1070)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:701)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:437)
at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1671)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1629)
at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:90)
at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:50)
at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$initMacApplication$1(MacOSApplicationProvider.java:74)
at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$submit$8(MacOSApplicationProvider.java:172)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187)
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:891)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
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)
Does restarting the IDE or just trying again work for either of you? This seems to be some weird constructor initialisation order problem, but I can’t figure it out.
here its consistently reproducible
It’s very strange, I can’t reproduce it at all. Can you email me your .idea/codeStyles/Project.xml
file?
@U08BJGV6E Could you do that too please? Also if you could include the system info from About IntelliJ IDEA that would be great too, so I can see which plugins you have in common. I’m starting to think this might be related to a plugin conflict.
Also, I’m interested to know if this happens for you in all projects, or just a specific one?
Also consistently reproable here. I don't even need to have a project open for it, same happens from the Idea launch page
I posted my system info yesterday: https://clojurians.slack.com/archives/C0744GXCJ/p1643214178048500?thread_ts=1643183408.046300&cid=C0744GXCJ
@U0567Q30W just the delay, just tried to get my .idea/codeStyles/Project.xml
but I can't find this file (looked at the project and at HOME)
@U08BJGV6E do you get an error?
no, just the Apply button stays grey and if I click on Run my changes don't get picked up
in case it helpers, this is my system info:
IntelliJ IDEA 2021.3.1 (Ultimate Edition)
Build #IU-213.6461.79, built on December 28, 2021
Licensed to Wilker Lucio
Subscription is active until May 7, 2022.
Runtime version: 11.0.13+7-b1751.21 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.1
GC: G1 Young Generation, G1 Old Generation
Memory: 16384M
Cores: 16
Non-Bundled Plugins:
net.sf.opk.avro-schema-support (203.1.2)
net.seesharpsoft.intellij.plugins.csv (2.18.2)
me.ihxq.acejump.lite (1.2)
djblue.portal (0.20.1)
com.wakatime.intellij.plugin (13.1.8)
com.jetbrains.plugins.ini4idea (213.5744.190)
com.intellij.plugins.watcher (213.6461.19)
org.intellij.plugins.hcl (0.7.14)
org.jetbrains.plugins.hocon (2021.1.0)
com.intellij.apacheConfig (213.5744.190)
org.asciidoctor.intellij.asciidoc (0.36.13)
String Manipulation (8.25.203.5981.1)
PlantUML integration (5.10.0)
mobi.hsz.idea.gitignore (4.3.0)
com.cursiveclojure.cursive (1.12.2-eap2-2021.3)
com.github.shinichy.integrant (0.1.1)
mdx.js (1.0.213)
intellij.prettierJS (213.6461.6)
com.intellij.tailwindcss (213.6461.6)
com.intellij.lang.jsgraphql (3.1.2)
aws.toolkit (1.37-213)
com.dmarcotte.handlebars (213.5744.190)
Kotlin: 213-1.5.10-release-949-IJ6461.79
@U0567Q30W is it weird that I can't find the xml config file? seems like its not getting generated here
@U066U8JQJ Maybe, which files do you have in your .idea folder in your project? Also, does this happen in all projects for you? Does it also happen if you don’t have projects open like imre?
just tested: 1. closed IntelliJ 2. open intellij on the Welcome Screen 3. open settings from there 4. navigate to clojure code style
this still had the same issue
Ok, although the exception is slightly different, I think you’re both seeing the same thing somehow.
my .idea in a project
yes, correct
Hi guys, I have published a dev build, 1.12.2-dev1. Could you download it from here: https://plugins.jetbrains.com/plugin/8090-cursive/versions/dev and try it out? I’m pretty sure it will fix Wilker’s problem, and I hope it will fix Imre’s even though I don’t have a good explanation for it.
There is still another problem I’m working on where the settings aren’t serialised properly, but I will have to try to finish that off tomorrow.
Still, that’s great news. I’m still not sure what the problem was, but it’s possibly related to Wilker’s problem (which was something else in the end.
My report yesterday probably wasn't complete: then I only tried to change the value of "allow parallel run" - and when that's the only change it still won't get applied
What is not working at the moment is saving the config when you modify code style settings - I’m working with JetBrains on that. As soon as I get it fixed I’ll get this out.
Probably just that field is missing from the list of things to check to see whether the editor has modified the config.
@U0567Q30W one thing though, I just tried to see if my imports where getting auto-organized, but they are not, the option is checked, but they still getting always add to the end of the :require
(simple require structure, no reader conditions or fancy things)
@U066U8JQJ You’re talking about new ones being added by auto-require, right? Yes, that’s not there yet, it’s on the to-do list. What is new is that you can use the Optimise Imports action and it will sort out the ones that are there.
ah, gotcha, thanks for the clarification