Fork me on GitHub
#calva
<
2021-12-29
>
otwieracz10:12:55

How can I control which aliases are set for clojure-lsp? I am seeing an error when I open .clj file in my project:

otwieracz11:12:39

Can I specify it somehow per-workspace?

otwieracz11:12:36

Actually, doesn’t seem like setting it in ~/.lsp/config.edn works either, still fails with the same error

otwieracz11:12:53

$ cat ~/.lsp/config.edn
{:source-aliases #{:dev :deps :test}}

pez11:12:11

It can be set locally. Read under Project. almost first on the same page.

pez11:12:19

Does it say that it is using the alias in the error message, or does it stay exactly the same?

otwieracz11:12:03

Exactly the same - no :deps alias

pez11:12:17

What happens if you run that command in the vscode terminal ?

pez11:12:38

Not sure, but the message reads to me like the command fails.

otwieracz11:12:05

Yeah, because it requires :deps alias to be enabled

otwieracz11:12:14

In order to work properly

pez12:12:40

So if you run that command in the vscode terminal with and without the deps alias, you get different results? I thought -Spath only calculated the classpath…

pez12:12:17

So, expecting only that to differ, but not that one crashes and the other one doesn’t.

ericdallo12:12:48

Does running in your terminal clj -A:deps:dev:test -Spath work?

ericdallo12:12:44

If so, you should configure source-aliases AND a custom project-specs

ericdallo12:12:59

I want to make source aliases change project specs automatically in the future

pez12:12:39

Yes, ^that’s what I meant with “that command”. 😃

otwieracz12:12:53

@U0ETXRFEW running that command without deps alias in terminal also fails

otwieracz12:12:43

Running clj -A:deps:dev:test -Spath returns classpathj

ericdallo12:12:20

you just need to change lsp settings to use that

ericdallo12:12:16

something like this should work: .lsp/config.edn

{:source-aliases #{"deps" "dev" "test"}
 :project-specs [{:project-path "deps.edn"
                  :classpath-cmd ["clojure" "-A:deps:dev:test" "-Spath"]}]}

otwieracz12:12:47

@UKFSJSM38 yeah, just tried it, it’s working! Thanks!

ericdallo12:12:44

nice, I want to make project-specs consider source-aliases automatically in the future, but it seems to couple a little bit the settings

otwieracz10:12:24

I need to enable deps alias to make it work - where can I specify that?

Harooo13:12:22

Hello everyone, Anyone else having issues with highlighting and warnings in calva? It seems it won't run correctly when editing and saving a file. In some cases it works again though.

Harooo13:12:04

Working with clojurescript, having latest versions installed, both vscode and calva

pez14:12:56

Looks like clojure-lsp semantic tokens are not being applied properly. Try disabling that to see if that could be the issue. https://clojure-lsp.io/settings/ (`:semantic-tokens?`)

Harooo14:12:58

I've added a file; '.lsp/config.edn' with {:semantic-tokens? false} restarted vscode and now the highlighting seems to be working correct, but the red/orange wavy underlines are slow to update and/or shown incorrectly.

Harooo14:12:09

thank you for helping btw 🙂

Harooo14:12:40

I'm also working with shadow-cljs btw

pez14:12:05

FYI: Highlighting is now not using semantic tokens. Those are pretty great to have enabled. They break for me sometimes as well, but not often enough for me to disable them. Maybe there is some clue there with the linting messages being slow/inaccurate as well. Consider filing an issue on clojure-lsp.

Harooo19:12:56

I have little understanding of how this all works. I decided to install an older version of calva which fixed it for me. Will try to update to the latest in the future see if the problem is fixed by then, if not I will stick with this older version. Thanks anyways

Harooo20:12:31

For those interested: up to v2.0.205 it works fine for me from v2.0.206 it starts acting weird

pez21:12:47

What starts acting weird there?

pez21:12:27

FYI, at 206 https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.206 we started to use latest clojure-lsp by default, rather than a hardcoded version. So what you are toggling there is rather some ancient version of clojure-lsp vs the latest release. You can, if you like, upgrade to latest Calva and pin the clojure-lsp version in via Calva settings.

Harooo09:12:23

At 206 the red wavy line is shown incorrectly/not updating when i move code around or when fixing the issue.

Harooo09:12:25

I set the clojure-lsp version to 2021.07.12-12.30.59, it now works fine with latest version of Calva! thanks :)

🙏 1
pez09:12:59

Do you know what this could be about, @UKFSJSM38?

ericdallo12:12:41

I think this was a issue I fixed on master already regarding custom-async-lint? Setting, could you try the master clojure-lsp? Just clone the repo and run make

roelof14:12:44

anyone seen this one earlier it is on a fresh install of calva with a cloned re-frame project

pez14:12:11

Does the command npx shadow-cljs classpath work in the VS Code terminal?

pez14:12:36

(Also: Please thread or edit your messages when adding more info.)

roelof14:12:30

sorry, I have first to install npm

roelof14:12:42

yep, that works

🎉 1
roelof14:12:56

I saw a lot of "packages" installed \

pez14:12:12

We should try get a better error message there. @UKFSJSM38 how about including the underlying error? Not sure what it would have been in this case, but maybe something like command not found: npx which would guide the user better, I think.

ericdallo14:12:45

I thought we were alreadying including, but it looks we aren't, I'll make the changes for that

ericdallo14:12:13

Made a commit on clojure-lsp master improving that behavior @U0ETXRFEW, it should print the cause on that popup now

❤️ 1
pez14:12:24

Awesome.

roelof14:12:03

both thanks

🙏 1
pez14:12:57

I want to say huge thanks! to all Calva reviewers. Today we received our 54th review and 54th five-star review. ❤️ 🙏 That makes Calva rank #3 on the marketplace, programming languages by rating. https://marketplace.visualstudio.com/search?target=VSCode&amp;category=Programming%20Languages&amp;sortBy=Rating

❤️ 7
calva 5
👏 1
ericdallo16:12:39

Just gave my review as well :)

❤️ 2
Kurt Harriger01:12:54

+5 from me also

❤️ 2
pez11:01:51

You helped Calva climb to #2 in this ranking! gratitude

gratitude 2
calva 1