Yep, worked perfectly for me. Thanks!
Quick question, the log is just a history of things that happened when running clojure-lsp? What would I normally set that path too?
yes, is just to log what clojure-lsp is doing
it's debug purposes only
Hi, I have just created a valid function which is wrongly parsed by lsp.
(defn send-to-slack [message]
(let [command (clojure.string/join " " ["curl" "-i" "-X" "POST" "-H" "\\"Content-Type: application/json\\"" "-d" (str "'{\\"text\\":\\"" message "\\"}'") slack-uri])]
(shell/sh "sh" "-c" command)))
It seems valid to Emacs once i change \\ to \
but then it fails during execution…
Should I ignore warnings or there is some workaround?That looks wrong with the double slashes, I'd guess
The warnings from clj-kondo are pretty reliable, not sure if it's a issue there
@borkdude may know what's is the correct here
why are you escaping it like this?
if it's related to a Windows-specific bug... try babashka.process
instead, it will apply that fix automatically without escaping
btw, if I eval this code from a file:
(require '[clojure.string]
'[clojure.java.shell :as shell])
(defn send-to-slack [slack-uri message]
(let [command (clojure.string/join " " ["curl" "-i" "-X" "POST" "-H" "\\"Content-Type: application/json\\"" "-d" (str "'{\\"text\\":\\"" message "\\"}'") slack-uri])]
(shell/sh "sh" "-c" command)))
it seems to be incorrect as well
Syntax error reading source at (REPL:5:89).
Invalid token: Content-Type:
You might need an extra \
in front of those double \\
s
Oh, you are right, thanks. It is a specific problem in evaluating BB in org mode… There is no other way how can evaluate this script - this is why, it took me some time to construct this 🙂. I have yet to find a way how to keep this code consistent between .org and .clj.
@zikajk Is this the org-mode stuff from Adam?
On his stream yesterday he discovered that it accidentally quotes strings the wrong way. I think he's going to fix it soon
You might want to follow up on the discussions forum
Ha, thanks. I will check that elisp.
@borkdude I am still not able to get this to work in BB REPL. Once the command seems parsed correctly it fails during execution. Should I move to babashka/process? Thanks
Is this on Windows?
Then probably yes
No, using babashka in zsh on macos. And I am going to deploy this script on old unsuported centOS too…
ok, please start another thread in #babashka then, where we can discuss what's going wrong.
I'm kind of busy now, but perhaps someone else can help meanwhile
So I'm just trying out clojure lsp for the first time on a machine that can actually run it, and it's looking pretty cool so far! One question: I have hooks set up with clj-kondo to resolve a particular macro, but it appears that clojure-lsp isn't recognizing that hook and is giving me a warning about an unresolved macro. Is there some configuration I need to add to have it pay attention to the clj-kondo config?
it should work right out of the box
Hey, glad to hear you are liking :)
Yeah, it should work the same as using clj-kondo, unless you have a outdated .clj-kondo/.cache folder?
Do you have a .clj-kondo folder?
Yup, it has the hooks that I configured. I've been using clj-kondo with spacemacs for a while and it was all working correctly.
I'm now trying out doom for a bit and got the lsp set up and it's complaining about stuff I already have configured.
Hum, could you try removing .clj-kondo/.cache folder?
If that doesn't work, could you try removing .lsp/sqlite.db?
same issue. I can try removing the sqlitedb though
reindexed after restarting the workspace and has the same issue
If I run clj-kondo from the commandline I get no warning for the macro either.
That's odd, any errors on the clojure-lsp log?
You can get it via the :log-path of the return of lsp-clojure-server-info
Jul 02, 2021 4:44:30 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 433
This is everything I have in my stderr bufferNot that one
oh, okay
Okay, looks like there's a lot going on in there
maybe it's better to restart the project and get the new log to avoid to much noise
The only thing logged at an ERROR level is clojure-lsp crawler saying it imported some of my config to the clj-kondo folder
as ERROR level? that's odd
yeah, it was weird
could you paste it here?
2021-07-02T21:44:07.948Z iris-joshua ERROR [clojure-lsp.crawler:79] - Imported config to .clj-kondo/org.suskalo/farolero. To activate, add "org.suskalo/farolero" to :config-paths in .clj-kondo/config.edn.
That's the only error
Lots of stuff is logged at debug level saying invalid clj-kondo finding
that's okay, let me check that error
oh, the level is wrong on the code, but that is the return of a clj-kondo log
odd, everything seems correct, and I use hooks with clojure-lsp and they work fine
could you try to make a minimal repro?
a repo with minimal macro and the hook
Sure, I could try, but I probably won't have time for it today.
no problem, I can test it on my side when you have the repro
Sounds good