Fork me on GitHub
#calva
<
2021-03-16
>
Eccentric J03:03:37

Attempting to configure VS Code + Calva. Ran into an issue though with the Clojure Language Client server: > Unable to locate a Java Runtime.

Eccentric J03:03:16

I’ve got java installed:

openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment (build 15.0.2+7)
OpenJDK 64-Bit Server VM (build 15.0.2+7, mixed mode, sharing)

pez07:03:28

@jayzawrotny Check if you have the java command in the integrated terminal in VS Code. If not, then VS Code has been started in a way that does not have the environment you need. Starting VS Code from a terminal with the right environment should fix it (if this is the problem),

ericdallo12:03:33

Using the clojure-lsp native graalvm binary should fix issues like that as well @brandon.ringe @pez :)

clojure-lsp 1
👍 1
pez12:03:16

Though, if you don’t have java in your path the Clojure story is broken anyway. 😃

1
Eccentric J15:03:13

Thanks @pez just tried it and same issue running java -version in vscode terminal, which helps me better understand where to start. I think my mistake is I was running zsh through my configured shell to test which inherits the proper path vars. I did install clojure-lsp-native through brew which I thought would not require java?

pez15:03:39

Calva has its own clojure-lsp, so it doesn’t matter which one you install or how. 😃

Eccentric J15:03:09

Ah that makes sense!

pez15:03:47

We’ll use the native one eventually, but we have run into issues with that work. Right now it is using the .jar.

Eccentric J15:03:07

Got it working! This is a good lesson to not try and take on such challenges when half asleep 😛 I setup a zshrc in my dotfiles, but didn’t create the symlink to ~/.zshrc for it and when I was testing it by running zsh within my configured elvish shell I got false positives.

🎉 2
Eccentric J15:03:44

Thanks again for the help. What are some of the issues getting the graal version to work?

bringe15:03:54

It's not really an issue related to clojure-lsp. I had recently rewritten the lsp integration code in cljs, partly as an experiment for using cljs for more of Calva, and then added on the graalvm integration code to the cljs. After doing that an issue with cljs/js interop that I had worked around before popped back up, so I'm working on solving that.

bringe15:03:14

It's a strange issue where calls to our cljs from js work fine in some cases but not in others, and I haven't found a cause for it, but I'm making progress toward a solution.

pez16:03:42

I need to start VS Code from the terminal on my machine, @jayzawrotny. Not sure if it is MacOS related, but seems to be very common there. Starting it via Finder gives it some weird environment. It’s not just VS Code. I’ve seen this issue hit people with all kinds of editors. Someone told me that at the root it is a permissions issue, but I never investigated it. Starting via the terminal works for me. 😃

👍 1
Eccentric J17:03:10

I think that’s similar to the issue I ran into. Though in my case I just had to create a ~/.zshenv with the paths updated.

Eccentric J17:03:35

Something that helped me was temporarily opening the default Terminal app which is configured to use the default shell. That’s when I realize java wasn’t available on the path there, which is what the vscode terminal was using.

az16:03:48

Hi all, wondering if there is something I need to configure in order to get markdown formatting for docstrings as well as autocomplete panel to pop up with docstring. I do get docstrings when hovering with command, but it’s the raw source code. During typing I only see the option for the name and not any args. I see this merged: https://github.com/BetterThanTomorrow/calva/pull/503 Thanks

bringe17:03:10

Are you connected to a repl when hovering? When I am, a hover looks like this. Can you give an example of what's expected?

bringe17:03:56

And then when typing I see the doc string like this

bringe17:03:43

You may have to run "Trigger Suggest" for the doc string to show for autocomplete like that. For me this is mapped to ctrl+space

bringe17:03:14

It's a toggle so it'll keep showing doc strings after you do that

bringe17:03:19

Actually that's also mapped to toggleSuggestionDetails so that may be what's doing that

az17:03:46

Hi @brandon.ringe, thank you. Yes, connected to clojurescript repl, when I hit ctrl+space this is what I get

bringe17:03:44

That's weird. I just tested with a clojurescript (figwheel) repl and suggestions work fine. Please file an issue with your repro steps and project details so we can investigate further.

az17:03:10

Will do thank you

👍 1
bringe17:03:24

I had not, thanks!

pez18:03:32

Thanks a lot, @U04V70XH6! I’ve replied now. Been waiting for that question almost.

bringe18:03:28

I had a reply typed out but deleted since you replied first lol. My reply didn't add much. I'm wondering if they're new to Clojure and if they didn't understand that they can actually run code from those files interactively. The docs only point out running the getting started repl and those files opening, but doesn't mention what we may assume to be obvious, that they can interactively work through those files.

bringe18:03:45

Just a guess though. I'm interested to see what's unclear.

bringe18:03:50

Also my guess could be way off 😄

pez12:03:40

I’ve tried to connect the dots a bit clearer now, on http://calva.io as well as in the drams. Very good with feedback like this. We probably need to step the Getting Started story up at least one notch more. I have some ideas and will hammock them a bit. Let’s see if they survive that. 😃

❤️ 1
bringe16:03:50

Great job with the video! Still watching right now but I'm loving it.

❤️ 1