This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-17
Channels
- # bangalore-clj (4)
- # beginners (60)
- # boot (63)
- # cider (2)
- # cljs-dev (22)
- # cljsrn (3)
- # clojars (32)
- # clojure (133)
- # clojure-gamedev (1)
- # clojure-germany (17)
- # clojure-italy (1)
- # clojure-russia (11)
- # clojure-serbia (16)
- # clojure-spec (35)
- # clojure-uk (75)
- # clojurebridge (1)
- # clojurescript (83)
- # community-development (25)
- # core-async (43)
- # cursive (15)
- # datomic (28)
- # emacs (2)
- # fulcro (108)
- # graphql (5)
- # hoplon (15)
- # lein-figwheel (6)
- # leiningen (39)
- # lumo (106)
- # new-channels (1)
- # off-topic (4)
- # om (26)
- # om-next (53)
- # onyx (46)
- # other-languages (2)
- # perun (1)
- # protorepl (5)
- # re-frame (13)
- # ring (18)
- # ring-swagger (1)
- # rum (6)
- # shadow-cljs (82)
- # spacemacs (19)
- # specter (5)
- # sql (3)
- # test-check (31)
- # unrepl (12)
- # untangled (2)
- # vim (109)
I wonder if you could capture the output from the terminal by attaching a handler temporarily. That would allow you to send something like:
(let [{:keys [file line column]} (meta <cword>)]
(str file ":" line ":" column))
And then open thatFWIW, when i started using ctags, i found my usage of jump-to-source dropped dramatically to 0
the ctags aren't totally precise, but they get the job done and don't require a REPL connection
another caveat is that you can't jump into the source for a dependency jar like you can with jump-to-source, but i find that it's pretty rare that i need to do that
I suppose, thinking about it, having namespaces & aliases is actually harmful to ctags and grep/ack.
@dominicm re capturing terminal output, I think you could definitely do that. I think you could start up a socket repl in the running process, start another job to do that in the background if you wanted it to happen silently.
@dave do you need to do anything special to get ctags working well with Clojure? I’ve never really gotten a handle on using ctags.
@jebberjeb I think it might be the ultimate hack if you got it working.
@jebberjeb i did have to configure it a bit. i have this file saved as ~/.ctags
: https://github.com/daveyarwood/dotfiles/blob/master/ctags
hmm, that's a good point. i should add that. in practice, i haven't needed to jump to task definitions much, but i don't see why they shouldn't have ctags support
I've stopped having to re-justify the switch from leiningen to boot. Most recently it was "I want live reloading sass without hassle"
for us (if i can make an assumption about the rest of the the team), it's mostly a philosophical question. we just prefer to have greater control over our build tasks
in the beginning though, our justification was probably "our coworkers micha & alan built this really cool build tool for clojure, let's use it"
i have to say, it's super convenient having the brains behind boot and hoplon sitting directly across from me when i run into a boot or hoplon issue 😄
Not sure what your internal default is, but good excuses include: - 0 copy streaming responses (e.g. images, videos, SSE) - painless HTML semantics (accept json, edn, etc. all "just" work) - painless CORS
that sounds compelling. we maybe could have used that when we started writing our primary user-facing web app in clojure+clojurescript 🙂
we're also tinkering a bit with streaming large amounts of JSON objects for our API. that also took some finagling to figure out how to stream stuff out of the database and through ring
I think it needs a little hint though, as clojure doesn't have a way of representing that naturally.
@dominicm hrm, looks like file/line info is there in Clojurescript meta as well. That’s nice.
So you just search the classpath for the first file that matches the filename, I guess?
In clojurescript, the file metadata is an absolute path, so you need different behaviour for cljs & clj.
that’s not hard, why is there no library for that? There must be some edge cases that doesn’t cover? Or some common useful cases?
There's also a catch if you're using boot, which is that you need to search the fake class path.
I was actually looking at it yesterday after we talked. I can’t remember if it just uses meta info, or it tries any other tricks, but I’ll look again.
I was talking about forking cider-nrepl to remove the nrepl-specific parts earlier, in order to use it as a plain library in #unrepl
Alright, enough screwing around. The logical thing to do here is give ctags a try 🙂
hmm, just ran exuberant ctags on a small codebase w/ clj, cljs, cljc using @dave’s config and it worked just fine. That’s a nice compromise I guess. No jumping into jars, but at least it’s something.
i'm a pretty big fan of ctags, overall -- it works for all kinds of programming languages
just ctags. every now and then (when i notice tags are missing), i run ctags -R src
(or whatever the source directory is called in the project i'm working on)
there are plugins that will do that for you automatically, i just haven't explored them yet
i also use vim-tagbar, which is very useful: https://github.com/majutsushi/tagbar
it's nice when you're editing a large file with lots of methods, classes, functions, etc. and you just want a quick overview of what's in the file
This seems to be working decently well. I suppose it’s a simple matter to just split the <cword> on / and use the last bit of it in some Vimscript.
When I browse cider.el, my grepping always gets me the right one, because everything is cider--stacktrace-does-blah
.
@jebberjeb if you happened to write that bit of vimscript, i would happily steal it for my config 😄
i guess it might also be the case that there is some kind of vim configuration option for ctags that would let us strip off everything through /
when looking up clojure tags
@jebberjeb @dominicm how many people use vim where you work? at adzerk, i'm in the minority
micha, jarrod and i use (neo)vim, and everyone else uses emacs/spacemacs. although now that i think of it, there are only 6 of us, so that's a 50/50 split 😄
Let’s see, currently at Cognitect besides myself I think there are 3-4 that use it. But I want to say that everyone besides me also splits time with Intellij.
@dave 2 vimmers in my company were brainwashed by me. Malcolm Sparks tried to get them using Emacs, then left me to help them. So I switched them to Vim so I could help.
It's so strange looking up american people, because you have so many locations which are named the same as those in Britain. Paul is apparently in Exeter, which is where I used to live. I was also born in Birmingham.
it occasionally throws me off when i google something about durham and get information relevant to durham, uk
I don't think we have one of those in the UK @jebberjeb?
@jebberjeb I hadn't heard of it. Anything about it of note?
Maybe I should call it Vimfest. It happens in Berlin. I think the user group that hosts it is called vimberlin.
@dave Here’s what I ended up with
" Strip off the symbol's namespace
function! SanitizeTag(word)
return (split(a:word, '/')[-1])
endfunction
nnoremap <leader>tt :exe ":tag ".SanitizeTag(expand("<cword>"))<cr>
@jebberjeb nicely done! i just gave it a whirl and it works great. i even remapped <C-]>
instead of <leader>tt
, and it seems to be a drop-in replacement for the default <C-]>
behavior 🙂