This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-26
Channels
- # announcements (4)
- # babashka (8)
- # beginners (75)
- # calva (26)
- # cider (33)
- # circleci (5)
- # clojure (36)
- # clojure-dev (2)
- # clojure-europe (25)
- # clojure-nl (4)
- # clojure-spec (38)
- # clojure-uk (47)
- # clojurescript (15)
- # cloverage (2)
- # conjure (64)
- # core-async (41)
- # cursive (13)
- # data-science (2)
- # datalog (16)
- # datascript (22)
- # datomic (9)
- # duct (2)
- # emacs (81)
- # figwheel-main (1)
- # fulcro (4)
- # jobs (2)
- # jobs-discuss (29)
- # kaocha (3)
- # meander (11)
- # membrane (21)
- # off-topic (1)
- # portal (1)
- # re-frame (1)
- # reitit (1)
- # releases (2)
- # remote-jobs (31)
- # shadow-cljs (26)
- # specter (5)
- # sql (26)
- # tools-deps (19)
- # vim (12)
Is there anything like anakondo (i.e. that can operate without a repl) that will do jump to definition?
dumb-jump is pretty good and works across many languages https://github.com/jacktasia/dumb-jump
@U06SWJ2RH: Interesting… I guess unlike alc.index-defs
though, that it can’t jump to dependencies / git deps etc
still nice to have an option giving broad shallow coverage, rather than narrow but deep.
@U06HHF230 yeah. I really enjoy having it as the backstop. Can open many languages that I'm not set up for and get some amount of jumping within that project.
yeah was looking for something that uses clj-kondo; thanks
for use with emacs: https://github.com/sogaiu/alc.index-defs/blob/master/doc/emacs.md
Cool seems to work on one project but on another it raises an exception…
$ clj -Sdeps '{:deps {alc.index-defs {:git/url "" :sha "4d26c6109fad267839ba10e7144660193a8be9a2"}}}' -m alc.index-defs.etags
* checking specified options
input: {:proj-dir /Users/rick/repos/project, :format :etags}
output: {:proj-dir /Users/rick/repos/project, :format :etags, :out-name TAGS, :overwrite false, :verbose true}
* determining paths to analyze
found shadow-cljs.edn
found deps.edn
>> classpath computation by: shadow-cljs <<
found yarn.lock
found package-lock.json
>> yarn.lock newer <<
chose yarn to invoke shadow-cljs
Execution error (NumberFormatException) at java.lang.Integer/parseInt (Integer.java:542).
null
Full report at:
/var/folders/ln/536xqskd3_g80n5pdbsjkrjw0000gn/T/clojure-7955288199004901369.edn
exception is:
I can open an issue for it if you like
it’s a proprietary project, so not really 😞
yeah it’s clj and cljs/cljc combined in the same source tree
shadow-cljs build for clojurescript side, deps.edn project
shadow-cljs reports: cli version: 2.8.26 node: v13.7.0
the ability for shadow-cljs to do classpath computation was 2.8.53 or so and above iiuc
will try bumping it and see if it resolves it… we normally keep it pretty up to date, but shadow moves pretty quick
for reference you can choose to use clj do the classpath computation: https://github.com/sogaiu/alc.index-defs/blob/master/doc/technical-details.md
will that still index the cljs?
so the classpath computation is used by clj-kondo to decide what to index (iirc, it's been a while since i've looked at the code 😅 )
yeah in that case it should work
hmm so firstly I think I’ve upgraded shadow-cljs now, and I still seem to get the same error
2.11.0
cool… secondly adding the '{:method :deps}'
arguments also fails
* checking specified options
input: {:proj-dir /Users/rick/repos/muttnik, :method :deps, :format :etags}
output: {:proj-dir /Users/rick/repos/muttnik, :method :deps, :format :etags, :out-name TAGS, :overwrite false, :verbose true}
* determining paths to analyze
found shadow-cljs.edn
found deps.edn
>> classpath computation by: deps <<
Execution error (IllegalArgumentException) at alc.index-defs.impl.analyze/study-project-and-deps (analyze.clj:104).
No method in multimethod 'get-lint-paths' for dispatch value: :deps
Full report at:
/var/folders/ln/536xqskd3_g80n5pdbsjkrjw0000gn/T/clojure-6386543814520584285.edn
very sorry it hasn't worked for you 😞 i will investigate. thanks for trying things out.
@sogaiu: Not at all, I’m sorry for giving you a hard time 🙂
It seems to work on a different project
yeah was just about to take a look myself
ok it’s doing something this time 🤞
well I’ll only commit it, if it is 🙂
A colleague of mine is usually pretty fastidious at keeping that dependency upgraded… he’s obviously been slacking this time 😆
he’ll be on it if it does, he’s pretty good at working through those issues
ok this seems to have worked… thanks a tonne for the help, and great project. It’ll save me starting a REPL when I want to do a casual code review on small PRs, or help colleagues understand what is going on
thanks for trying things out! please let me know if you have any problems / suggestions 🙂
I have one suggestion actually…
Adding support for the new -F
/ -X
params
Oh actually you already basically do… aic/do-it
takes a map of opts already :thinking_face:
Ok I’ve just set it up this way in my ~/.clojure/deps.edn
:
:build-tags {:deps {alc.index-defs {:git/url "" :sha "4d26c6109fad267839ba10e7144660193a8be9a2"}}
:fn alc.index-defs.core/do-it!
:args {:format :etags
:proj-dir "."
:method :clj}}
You can then call it from any project with:
clj -A:build-deps -X:build-deps
(IIRC a newer (future) version of tools.deps will mean you won’t need to also pass -A:build-deps
, just -X:build-deps
would be enough)
@sogaiu take a look at https://github.com/snoe/clojure-lsp using https://emacs-lsp.github.io/lsp-mode/, you can have multiple features like go-to-definition, find references, code actions, clj-kondo analysis, breadcrumb, modeline diagnostics and a lot more 🙂 You can see the major features https://emacs-lsp.github.io/lsp-mode/page/main-features/