This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-28
Channels
- # announcements (21)
- # beginners (12)
- # calva (16)
- # cider (3)
- # clj-commons (23)
- # clojure (32)
- # clojure-europe (8)
- # clojure-norway (3)
- # clojure-uk (3)
- # clojurescript (12)
- # conjure (2)
- # cursive (6)
- # data-science (15)
- # datomic (5)
- # dev-tooling (10)
- # emacs (13)
- # events (3)
- # lsp (36)
- # missionary (6)
- # off-topic (22)
- # portal (46)
- # releases (1)
- # shadow-cljs (15)
- # slack-help (7)
- # sql (3)
- # squint (1)
- # timbre (5)
Hi, I am new to Calva coming from Intellij/Cursive. First steps are really promising. But I am facing an issue blocking my move.
My project is a deps
project in a polylith structure.
I start the repl via Calva Jack-In integration. The repl starts well. But when I load my code, I am facing this error:
; Syntax error (FileNotFoundException) compiling at (dev/core.clj:1:1).
; Could not locate portal/api__init.class, portal/api.clj or portal/api.cljc on classpath.
; Evaluation of file romain.clj failed: class clojure.lang.Compiler$CompilerException
In my deps.edn
file, Portal dependency is declared in a debugger alias (I removed most of all dependencies for easy reading purpose):
:aliases {:dev {:extra-paths ["development/src"]
:extra-deps {better-cond/better-cond {:mvn/version "2.1.5"}}}
:debugger {:extra-deps {com.github.jpmonettas/flow-storm-dbg {:mvn/version "3.3.303"}
criterium/criterium {:mvn/version "0.4.5"}
djblue/portal {:mvn/version "0.37.0"}}}
:cider-nrepl {:extra-deps {cider/cider-nrepl {:mvn/version "0.29.0"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"]}}
I tried to put Portal dependency in my ~/.clojure/deps.edn
in the extra-deps
and it solves my issue:
:deps {
djblue/portal {:mvn/version "0.37.0"}
}
My question is: How can I specify to Jack-in to load the :debugger
alias ? I am not so happy to have to put in my profile deps.edn
dependencies of tool all the team is using and declared in the project deps.edn
. Is there a way to configure Jack-in or is it mandatory in that case to start a repl in command line?When Jacking in, Calva request: • the root folder • then the project type And launch without any question regarding aliases
I found a settings.json
file in .vscode
folder where there is this configuration:
{
"calva.replConnectSequences": [
{
"projectType": "deps.edn",
"name": "local",
"cljsType": "none",
"menuSelections": {
"cljAliases": ["dev", "test"]
}
},
{
"projectType": "deps.edn",
"name": "stage",
"cljsType": "none",
"menuSelections": {
"cljAliases": ["dev", "test"]
},
"jackInEnv": {
"ENVIRONMENT": "stage",
"AWS_PROFILE": "stage"
}
},
{
"projectType": "deps.edn",
"name": "iago",
"cljsType": "none",
"menuSelections": {
"cljAliases": ["dev", "test"]
},
"jackInEnv": {
"ENVIRONMENT": "iago",
"AWS_PROFILE": "iago"
}
},
{
"projectType": "deps.edn",
"name": "production",
"cljsType": "none",
"menuSelections": {
"cljAliases": ["dev", "test"]
},
"jackInEnv": {
"ENVIRONMENT": "production",
"AWS_PROFILE": "production"
}
}
]
}
Can modifying it by hand solve my issue? (does I risk side effects?)So maybe somebody in my team created this file but did not update to take into account debugger alias. Many thanks for your help.
@U01BZRQA0ER You say "when [I] load my code" it complains about Portal being missing -- your code depends directly on Portal? Or did you do something else that involved Portal?
Second proposal: we have a dev namespace where is stored command allowing to start portal and other stuff like development stuart sierra component atom...
That's what we do at work with Polylith and Calva/CIDER etc.
We have the following config in the repo:
"calva.replConnectSequences": [
{
"name": "World Singles Backend (Jack-In)",
"projectType": "deps.edn",
"cljsType": "none",
"autoSelectForJackIn": true,
"projectRootPath": ["/var/www/worldsingles"],
"menuSelections": {
"cljAliases": ["build", "dev", "+default", "test", "vscode-calva-jack-in"]
}
},
{
"name": "World Singles Backend (Connect)",
"projectType": "deps.edn",
"cljsType": "none",
"autoSelectForConnect": true,
"projectRootPath": ["/var/www/worldsingles"]
}
and the vscode-calva-jack-in
alias is:
:vscode-calva-jack-in
{:extra-deps {com.datomic/dev.datafy {:git/sha "4a9dffb"
:git/tag "v0.1"
:git/url ""}
djblue/portal {:mvn/version "0.44.0"}
io.github.seancorfield/dot-clojure
{:git/tag "v1.0.2"
:git/sha "6a3f903"}
io.github.stuarthalloway/reflector
{:git/sha "93a0c19b4526c1180959e940202928d35e5c3cef"}
jedi-time/jedi-time {:mvn/version "RELEASE"}
party.donut/dbxray {:mvn/version "RELEASE"}}
:main-opts ["-e" "((requiring-resolve 'org.corfield.dev.repl/start-repl))"]}
See https://github.com/seancorfield/dot-clojure/blob/develop/src/org/corfield/dev/repl.clj for details of what it supports/does.
hi @U04V70XH6, thanks a lot for sharing your configuration.
Has anyone worked out what keybindings to set to make alt-backspace in Calva match MacOS, as well as navigate forward/back by word based on grammar context (i.e. inside a string), and whatever other similar commands
I don't know, I'd have to work it out, hoping someone else already has