This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-21
Channels
- # 100-days-of-code (5)
- # announcements (6)
- # beginners (92)
- # cider (39)
- # cljdoc (35)
- # cljsrn (1)
- # clojure (187)
- # clojure-sanfrancisco (2)
- # clojure-spec (26)
- # clojure-sweden (2)
- # clojure-uk (1)
- # clojurescript (27)
- # cursive (19)
- # datascript (3)
- # datomic (19)
- # defnpodcast (1)
- # emacs (11)
- # fulcro (71)
- # incanter (1)
- # lein-figwheel (4)
- # lumo (10)
- # off-topic (19)
- # planck (5)
- # reagent (49)
- # reitit (2)
- # shadow-cljs (25)
- # spacemacs (1)
- # sql (1)
- # unrepl (4)
- # yada (4)
I have cider-auto-test mode running and am testing something that deals with namespaces, so in the test I set up a namespace before the test namespace and every time it loads it adds a (:require... statement to the topmost namespace, which isn't necessary. Even if I use in-ns
it does this.
so i have
(in-ns 'top-level)
(defn...)
(defn...)
(ns my-proj.core-test
(:require [my-project.core :as core]))
and when I do something like core/
<--- insert slash and it does a lookup
it throws a runtime error and does this
(in-ns 'top-level
(:require [my-project.core :as core])
(defn...)
(defn...)
(ns my-proj.core-test
(:require [my-project.core :as core]))
This is almost certainly a bug in clj refactor. I think lots of tooling assume the first form of a file is the ns form
maybe creating a temp namespace is not the proper way to do it, should it just go in it's own file?
yeah, I figured it was the case. but I was thinking there was a variable that can control that behavior, or tell it to ignore in-ns forms
maybe it's this
cider-test-infer-test-ns is a variable defined in ‘cider-test.el’.
Its value is ‘cider-test-default-test-ns-fn’
Documentation:
Function to infer the test namespace for NS.
The default implementation uses the simple Leiningen convention of appending
’-test’ to the namespace name.
I'll just save the headache and do the one ns per file
right, I see my dummy ns doesn't end with -test
It's clj refactor automatically adding a required ns. And also noticing that you lack a ns declaration (according to it's logic)
There’s https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L51
Generally much of the code in clojure-mode
assumes a single ns
form, so using in-ns
is a recipe for problems.
gotcha, I updated my test to avoid it
Is there a way to setup lein with-profile +cljs-dev figwheel
from within my project file? I am trying to use core.matrix from clojurescript, following the instructions, but am running figwheel from within CIDER…Thanks for any advice..
CIDER has defvars that you can set globally or override per project. here are the dir locals for my work project:
((nil . ((cider-lein-global-options . "with-profile dev")
(cider-default-cljs-repl . figwheel))))
more info: http://endlessparentheses.com/a-quick-guide-to-directory-local-variables.html
@dpsutton Actually, I just found out from the shell prompt that cljs-dev profile doesn’t exist. I know this isn’t CIDER related…
Is there a way to find unbalanced parentheses? Last night I was able to run new figwheel-main projects in cider, but now when I start a new project, I get an unmatched delimiter error, with no hint as to where to even look
:thinking_face: it seems like I can still use old-figwheel --- I don't need to do anything fancier than look at generated svg so this probably works for now
does someone know how to inject depdencency (and append it to pre-existing deps) with .dir-locals.el ?
@hlolli there's two parameters which matter with clojure, one of them pertains to "prefix" flags, put -Sdeps
there. I think multiple -Sdeps merge.
@dominicm Do you know which cider variable defines the prefix flags on top of your head? I could theoretically as well append full path to a .jar to the java classpath?