Fork me on GitHub
#cider
<
2017-12-13
>
richiardiandrea02:12:24

Is there any ggtags package for clojure? if not, where should I contribute it? I have noticed that clojure tags are generating correctly with the right .globalrc, but not queried correctly using ggtags-mode

richiardiandrea02:12:13

in particular for things like namespace/symbol, I need to specify a file on top of the global command

daveliepmann13:12:14

@arrdem Is there currently any way from emacs to pull in all of grimoire and refer to it as static files, rather than making one-off HTTP requests? I'm super excited to use cider-grimoire (it scratches an itch I've had for a couple months) but I'd rather update the docs once every six months rather than insert a 1 to 2 second network delay into my lookup workflow.

gonewest81817:12:25

It seems feasible to change cider-grimoire such that it caches the retrieved data, and uses a configurable time-to-live to decide when to go get the remote URL again.

gonewest81817:12:58

The obvious downside would be, if you visited a particular topic in grimoire less often than the configured TTL, then basically the caching wouldn’t help.

richiardiandrea17:12:50

@bozhidar does cider include any jump-to-symbol functionality? If not, where does that live? I am trying to use ggtags-mode in Clojure

richiardiandrea18:12:01

a further question on top of this is whether there should be a separate gtags hook for static info rather then dynamically fetching stuff from the REPL, I was actually able to generate tags with global -u and universal-ctags.

New To Clojure18:12:59

@richiardiandrea See cider-find-var in cider-client.el

richiardiandrea18:12:53

thanks! however I don't use cider, so I wonder whether this functionality should go instead in clojure-mode?

arrdem18:12:22

@daveliepmann So Grimoire the website is a thin wrapper around lib-grimoire which provides a consistent API between making requests to Grimoire the service and to the filesystem store that Grimoire the service uses under the hood. I’ve thought in the past about how to distribute a zipfile or some other archive containing a snapshot of Grimoire (early versions of Grimoire which were all static HTML were available this way) but right now there’s no blessed local or cached client. I just never got around to building one.

daveliepmann09:12:24

I extremely don't have time to do this work right now, but a standalone grimoire-mode based on such an archive would be awesome. I might be able to hack on it after the holidays, though. That would require moving forward with some kind of static files. What do you think the best format would be for distribution? My naive assumption would be that the easiest would be git clone but I wonder what other options you see.

arrdem18:12:09

Yeah there’s been some ideas back and forth on stuff like this before. Grimoire actually has a script in the main repo that clones down the data repos, builds the data directory structure and sets everything up for lib-grimoire. It shouldn’t be that hard to adapt the same toolset to maintaining a local copy in ~/.grim or wherever. Maybe once I get some headway on the current improving doc writing projects.

arrdem18:12:08

It’s definitely doable, just a couple separate git repos you could keep cloned into ~/.grim or somewhere.

bozhidar19:12:25

@richiardiandrea It’s not possible. This relies on var metadata. It can easily be added to inf-clojure, though.

bozhidar19:12:33

(meta #'map)
{:arglists ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]), :doc "Returns a lazy sequence consisting of the result of applying f to\n  the set of first items of each coll, followed by applying f to the\n  set of second items in each coll, until any one of the colls is\n  exhausted.  Any remaining items in other colls are ignored. Function\n  f should accept number-of-colls arguments. Returns a transducer when\n  no collection is provided.", :added "1.0", :static true, :line 2618, :column 1, :file "clojure/core.clj", :name map, :ns #namespace[clojure.core]}

bozhidar19:12:54

You just need to :column, :line and :file from the meta.

bozhidar19:12:09

@gonewest818 I like the idea of caching for grimoire. If that’s combined with the ability to fetch all entries for a certain namespace I think it’d would solve much of the aforementioned problem. It would also be nice if this was moved to a middleware and started using lib-grimoire as that would simplify the code and make it accessible to other editors - e.g. @dominicm’s beloved vim. 🙂

dominicm19:12:51

I have been thinking about moving grimoire into the nrepl, I've been working on an improved doc. I wanted runnable examples and stuff.

dominicm19:12:04

So I would appreciate this work

arrdem19:12:55

It’s doable. I test Grimoire using lib-grimoire loaded into a REPL. Been sketching at more structured examples / REPL sessions notation recently. http://github.com/arrdem/stacks

arrdem19:12:12

Just takes dev time I’m not able to commit to.

arrdem19:12:46

Part of the problem is that as-is markdown-clj doesn’t give you a data based intermediate representation and I just haven’t gone and fixed that yet.

bozhidar19:12:06

> I’ve been working on an improved doc. I wanted runnable examples and stuff.

bozhidar19:12:18

@dominicm That sounds interesting!

richiardiandrea19:12:48

@bozhidar shouldn't that go to clojure-mode? Also, meta is a runtime thing

richiardiandrea19:12:59

tags are built statically

bozhidar19:12:18

That’s why it can’t go to clojure-mode - it relies on a having a REPL.

richiardiandrea19:12:12

Ok let me ask this, would you be open to a patch to clojure-mode that hooks up ggtags?

bozhidar19:12:39

Building tags is a step most people dislike having to deal with, that’s why I’m not particularly interested in trying to do something about this in clojure-mode - you always need to build some command to run this, you need to install something.

richiardiandrea19:12:11

I am using projectile and everything works pretty well, but I see the point and felt the pain when installing all these tagging tools

bozhidar19:12:11

If you come up with something I might consider it, but overall, I think getting this info at runtime is a pretty decent approach.

richiardiandrea19:12:53

@bozhidar ok I will put in a separate package for now..

New To Clojure19:12:30

cljr-rename-symbol fails to rename anagrams-for in https://github.com/developer2019/example/blob/master/src/anagram.clj I just position cursor at anagrams-for and press M-x cljr-rename-symbol RET. It tells that project needs to be evaluated, I type y RET, and then if fails with Wrong type argument: char-or-string-p, nil. Is this a bug? lein test compiles this code and runs successfully. clj-refactor.el version: 2.3.1

arrdem19:12:56

Yeah I think cljr is currently busted.

dpsutton20:12:30

It's never worked consistently for me. There are some clojure mode refactoring I need to learn more

New To Clojure20:12:08

It seems that nobody needs Clojure refactoring. Otherwise somebody would have done it already.

dpsutton20:12:01

Clojure-mode and cljr refactor both provide it. I've had some success with the cljr refactor in the past. I think both are great and refactoring tools are great

arrdem21:12:03

cljr is great, and the best implementation thereof I’m aware of outside of cursive.

arrdem21:12:13

Not sure why it’s currently broken tho.