Fork me on GitHub

Anakondo v0.2 An Emacs minor mode for Clojure[Script] completion without needing a connected REPL: * Now in MELPA * Now with Locals completion and Java completion

👍 32
🎉 20
emacs 12

was able to get locals and java completion working successfully. nice!


one small thing, somehow my installation of emacs (or config?) doesn't have concatenate for some reason. renaming that to cl-concatenate seemed to make things work. any ideas what might be wrong with my setup?


I added anakondo to Spacemacs and it seems to be working well. Will do some more testing as I code today.


I installed anakondo, but when I enter a random Clojure file in /tmp it asks me to which project I want to switch...


and no matter which one I choose it keeps asking me


I think it is tied to projectile by design (at least for the moment) as it used that to access the specific deps.edn file and build up the path.


I think it would be useful to make this opt-in. clj-kondo can also just lint one file without any context. this will be useful for babashka scripts which I want to use it for, because I don't spin up a REPL for that all the time. cc @U0K064KQV


The problem I have is that I use layouts and if I restart Emacs then a dozen Clojure projects are reopened and analysed, which takes nearly a minute and I cannot do anything until the analysis has finished. anakondo works well when loaded, so keen to see how this evolves.


I think the project scanning should be optional, it seems your problem is more or less the same as mine, only from a different angle


Having an option to make scanning optional would be useful, I agree. I did raise an issue suggesting running the static analysis in the background, although unsure if that is possible with Emacs.


@UG1C3AD5Z Ah, I still haven't figured how to know what I need to explicitly require and not. The functions included with Emacs don't tell you where they come from when you look up their docs which is what makes it hard. I think I need to require 'cl explicitly here. Thanks for the feedback.

👍 4

@U04V15CAJ Hum, that's interesting. I think I know why this doesn't happen to me. I think since my home is a git project, projectile defaults to that when I'm "outside" a project. I assumed that was just the projectile default behavior. I'll work on a fix. Thanks for trying it out and reporting back


@U05254DQM Ah yes, I can see this being annoying. I have planned to make analysis async as my next big feature. But your use case might need something else, even analysing everything asynchronously when you start Emacs seems wasteful. I had wondered if I should have a file cache so it persists between mode restarts. That could be an option. Otherwise for now, you might want to manually turn on/off the mode


Ah, I can just comment out the autoload and the add-hooks code and using SPC SPC anakondo-minor-mode and it seems to work. That will allow me to continue testing. Thanks.


You should only need to comment out the add-hooks I believe.


I think autoload is needed to load the anakondo-minor-mode command.


But I'm still figuring out all the mysteries of Emacs autoload


@U04V15CAJ I can do two things, I can either default the project to the current file's folder, or I can default it to nil, so I'll just analyze the buffer and nothing else


Which one would you think be best? I'm leaning on defaulting to the folder.


@UG1C3AD5Z @U04V15CAJ Ok latest Melpa release should have fixed your issues.


thanks! will give it a try


@U0K064KQV if I’m editing a Clojure file in /tmp, will it analyze my entire tmp folder? That doesn’t seem to be a good idea. Why don’t you piggie back on the detection of the .clj-kondo directory and else default to single file


Or: detect $PROJECT_ROOT by looking at .clj-kondo, .git or project.cj or deps.edn and if all that fails, only lint the current buffer?


That would work for my /tmp/foo.clj scripts


Ya, it will analyze all of /tmp in that case. I guess its a trade off. If someone has a set of clojure files or babashka in some folder that they load-file together, then it be nice to have that default as the project folder, but in the case of a tmp file or an empty buffer I guess it would make more sense to default it to no project and only analyze the buffer


The way I have it right now, it defaults to the buffer's default-directory


Which is something the user can change. Though I think it would fail it you'd set it to nil


I'll hammock over it a bit


Thinking it would be useful to exclude files types or specific directories. I have one project that takes over 40 seconds to analyze. It only has a few libs and not that much code, but has large data files. I assuming this is why it's slow. I'll raise an issue and share the code later today


Sure thing. That said, all transitive dependencies also get analysed for both Java and Clojure. So if you have a big dependency tree, that could also be the cause.

bringe18:04:16 v2.0.96 comes with additional features to the new debugger: • Command for instrumenting functions for debugging • Editor decorations to show instrumented function definitions and usages • Fix active item background in suggestion menu for readability (thanks to zelark) for more info about the debugger.

calva 46

[com.wsscode/async "1.0.5"] is out! This release adds a helper to handle async try/catch on streaming processes. Docs at:

🎉 32

@U051SS2EU @U11BV7MTK @U050ECB92 from the thing we were talking earlier at #core-async