This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-04
Channels
- # announcements (28)
- # asami (12)
- # aws (3)
- # babashka (69)
- # babashka-sci-dev (34)
- # beginners (52)
- # biff (3)
- # calva (20)
- # clj-kondo (4)
- # cljsrn (4)
- # clojars (1)
- # clojure (90)
- # clojure-czech (2)
- # clojure-europe (33)
- # clojure-nl (11)
- # clojure-norway (35)
- # clojure-seattle (1)
- # clojure-uk (5)
- # clojurescript (87)
- # cursive (10)
- # datascript (5)
- # datomic (35)
- # defnpodcast (1)
- # emacs (8)
- # events (4)
- # fulcro (1)
- # google-cloud (2)
- # graphql (2)
- # hispano (2)
- # honeysql (5)
- # hoplon (2)
- # hugsql (1)
- # jobs (7)
- # kaocha (9)
- # lsp (102)
- # meander (13)
- # observability (7)
- # off-topic (56)
- # overtone (2)
- # pathom (47)
- # podcasts-discuss (1)
- # rdf (30)
- # reagent (16)
- # reitit (1)
- # releases (2)
- # remote-jobs (26)
- # rewrite-clj (10)
- # tools-deps (4)
- # vim (5)
- # vscode (4)
- # xtdb (41)
bumping this again! we'd love if you could test this out with us if you can!!
So here’s a weird issue I’m seeing: the “Toggle between implementation and test” command is always asking me if I want to create the file, even if it already exists. Clicking “create” then takes me to the existing file.
It seems to work in other projects than the one I’m seeing the issue in. I’ll dig a little more and try to isolate the problem
I’ve finally gotten back to looking into this! The issue appears consistently when using a multi-root workspace. You can replicate it with the following steps: • open a clojure project in vscode • run “Workspaces: Add folder to project” with any folder outside the project that contains at least one file • Open a clojure file that has a matching test file in the expected directory • Run “Calva: toggle between implementation and test” Expected behavior; the test file is opened Actual behavior: Calva asks “Create <path to file?” If you click “Create”, it switches to the existing file. If you click “Cancel”, nothing happens (as expected)
I reported this a long time ago -- I believe there's still an open GH issue about it...
Ah, I closed it because no one seemed to be able to repro: https://github.com/BetterThanTomorrow/calva/issues/1219 (and I didn't care about the feature 🙂 )
Do you also have several Workspace folders in your workspace, @U04V70XH6?
I did have when I reported that bug, yes. I do not now. And that toggle feature seems to work now. Which points to multiple folders in the workspace as the contributing factor.
I can reproduce it with your steps, @U01EB0V3H39. Can you add them to the issue? I reopened it. Let's smash this bug!
binds toggle between source and test to cmd-k cmd-t and gets on with his life 🙂
You were just recruited to review the fix, @U037TPXKBGS 😃 https://github.com/BetterThanTomorrow/calva/pull/1672
Hello, I'm using calva with lacinia
and lacinia-pedestal
with integrant
and I configure the resolvers dynamicaly. But when I start repl I have to require
all the namespaces before starting attach resolvers. Is that correct that I have load by hand to all the namespaces been in memory using repl resource?
Things you reference need to be known by the REPL so they need to be loaded/required. I think what people often do is to create a dev user.clj with the requires and setup needed. Then you only need to load this file. You can then also create a custom connect sequence including a code snippet for loading the file upon connect. (I hope I understood your question correct, I'm not very familiar with the libraries you mention. https://calva.io/connect-sequences/
(ns user
(:require [aplicacao.sistema :as sistema]))
(defn get-files-from-folder [folder]
(let [directory ( folder)
dir? #(.isDirectory %)]
(map #(.getPath %)
(filter (comp not dir?)
(tree-seq dir? #(.listFiles %) directory)))))
(defn load-namespaces []
(->>
(get-files-from-folder "src")
(filter (fn [v] (or (.contains v "resolvers") (.contains v "infra"))))
(reduce #(load-file %2) [])))
(defn go []
(load-namespaces)
(sistema/iniciar-sistema :prod))
(defn refresh []
(sistema/finalizar-sistema)
(sistema/iniciar-sistema :prod))
I solved reading the files from source and loading it manual. It worked like a charm.Oh, that's beautiful! And saves you from the boilerplate that I was sort of suggesting. 😃
I’ve finally gotten back to looking into this! The issue appears consistently when using a multi-root workspace. You can replicate it with the following steps: • open a clojure project in vscode • run “Workspaces: Add folder to project” with any folder outside the project that contains at least one file • Open a clojure file that has a matching test file in the expected directory • Run “Calva: toggle between implementation and test” Expected behavior; the test file is opened Actual behavior: Calva asks “Create <path to file?” If you click “Create”, it switches to the existing file. If you click “Cancel”, nothing happens (as expected)