Fork me on GitHub
#babashka
<
2021-09-19
>
bherrmann11:09:41

Does emacs's lsp-mode work with babashka code? Is there some special setup needed?

borkdude11:09:02

#lsp has some special integration for babashka, @ericdallo should know more about this

borkdude11:09:16

perhaps it looks at bb.edn

borkdude11:09:24

to recognize bb scripts

borkdude11:09:05

I tried this but it doesn't seem to work. Also I don't see anything in the LSP docs about this. @ericdallo

borkdude11:09:40

ah yeah it does work!

borkdude11:09:30

hmm, no it doesn't, false alarm

bherrmann11:09:58

🙂 ... I recently watched his video, "Turning your editor into a Clojure IDE with clojure-lsp (by Eric Dallo)" https://www.youtube.com/watch?v=grL3DQyvneI&amp;t=1s&amp;ab_channel=LondonClojurians and was interested in using it on my moderately complicated bb project....

borkdude11:09:58

Well, navigation should surely work between your own defined functions, locals, etc. in one script

borkdude12:09:25

but the built-in deps, paths, etc should be recognized by #lsp but I don't know what the progress on this is. I'll wait for Eric to chime in here.

borkdude12:09:02

I've been using clojure-lsp for a while and I'm a big fan

ericdallo13:09:07

@bherrmann it should work with bb > 5.1 which adds the bb print-deps command What version of bb are you using?

borkdude13:09:18

It didn’t work for me either when I tried to get autocompletions for Cheshire for example

borkdude13:09:09

Can you perhaps write a scenario in which it should work, maybe as docs for clojure-lsp?

ericdallo13:09:31

yes, I'll add a section for babashka integration

ericdallo14:09:50

it seems to work for me, I'll try to create a bb-sample so people with issue like this can test it on this repro as well

borkdude15:09:41

Yeah this worked for me!

ericdallo15:09:42

Good, so we need to check why didn't work before

bherrmann00:09:17

so typically I name my bb files with a .bb extension? Do I need to configure the extension somewhere - or use a different extension? I think a sample project would be helpful. although the sample project might just be 2 files, a bb.edn file and a helloworld file in a src sub dir - right?

ericdallo00:09:33

This is my sample project that works: https://github.com/ericdallo/clojure-sample/blob/bb%2Bdeps-project/scripts/print.clj But I recommend you use your bb files with the .clj extension for emacs/lsp-mode and others recognize as a clojure source code

bherrmann00:09:46

super, thx. Thanks for the talk, and your work on clojure-lsp!

ericdallo00:09:30

thank you :)

mmz12:09:32

@bherrmann a discussion like this https://github.com/babashka/babashka/discussions/907 could maybe help to gather all different approaches here?