Fork me on GitHub
#calva
<
2021-05-12
>
craftybones07:05:00

on a mac, ctrl-right doesn’t seem to move forward a sexp. I’ve checked to see if there are any other shortcuts on it, doesn’t seem to be…wonder what the problem is

yuhan13:05:09

@srijayanth I think ctrl-arrows are mapped at the OS level to moving between desktops, you'll have to disable that from System Preferences

yuhan13:05:11

Keyboard -> Shortcuts -> Mission Control

craftybones13:05:38

I’ve got that disabled. The problem here isn’t that it is doing something else. The problem seems to be that VSCode lists both ctrl right and alt right as keyboard options

pez13:05:50

I think it is this issue. Which we haven’t investigated enough upstream: https://github.com/BetterThanTomorrow/calva/issues/1161

craftybones07:05:26

Obviously it can be changed, but I am setting this up for a bunch of interns, so I’d rather get defaults working

craftybones07:05:42

Wow. Alt right works. Didn’t realise both were mapped to the same fn

pez07:05:22

They shouldn’t be. alt should be, ctrl should not.

pez07:05:35

I don’t know why VS Code displays it like that. There’s an issue about it. But anyway, ctrl +up/down is not navigating sexpr on Mac.

yuhan13:05:09

@srijayanth I think ctrl-arrows are mapped at the OS level to moving between desktops, you'll have to disable that from System Preferences

otwieracz21:05:37

Hey - is there any workaround for [2021-05-12 23:04:52.365] [exthost] [error] Namespaced keywords not supported ! calva-fmt.formatCurrentForm or you can’t plainly do any formatting of code with ::foo with calva-fmt?

pez21:05:35

There is no workaround yet. We need to upgrade our fork of cljfmt.

az23:05:00

Hi all, any tips on best practices for writing docstrings for nice rendering in Calva? Also on that note, wondering if it’s possible to render markdown somehow on hover?

bringe23:05:32

The hovers do render markdown, but there are two sides to this. When a repl is not connected, the hover content comes from clojure-lsp. When the repl is connected, hover content comes from nrepl and I think is packaged/formatted by Calva. 1. When the repl is not connected, clojure-lsp sends the hover response like the below. @UKFSJSM38 Do you think it would be okay to not enclose the doc string in a clojure code block? I think this would allow the markdown the user sets in the doc string to be respected in the hover.

"contents": {
        "kind": "markdown",
        "value": "
clojure\ncore/one\n
\n
clojure\n[x]\n
\n\n----\n
clojure\n*hello world*\n
\n----\n*/home/brandon/development/clojure-test/src/core.clj*"
    }
2. When the repl is connected, hovers are formatted with this code here: https://github.com/BetterThanTomorrow/calva/blob/a1afb5799bc8f1e4063badb8964f462b1da7dfcc/src/providers/infoparser.ts#L168. I haven't examined it closely but I'm guessing something there prevents user-defined markup from being respected. @pez is there a reason for this?

ericdallo23:05:48

I didn't get the idea @U9A1RLFNV thinking-face

bringe23:05:27

Currently in a doc string if I set it to "*hello world*" it should render as bold in the hover (in my opinion, at least). But clojure-lsp sends the doc string content back wrapped in a clojure code block (

clojure\n*hello world*\n
), so it renders it as code instead of making it bold.

bringe23:05:03

Is there a reason for that? I would like it to not render as Clojure code, because it will highlight Clojure function names like if even when it's not meant to be code. Like so:

ericdallo00:05:31

Hum, got it, I never realized that the docstring could be markdown, only code, but that makes sense, I'll double check that

👍 3
ericdallo00:05:08

Yeah, it looks way better now: I'll add to next release, thanks!

bringe00:05:13

You're welcome, and thank you!

bringe00:05:57

I've created an issue for Calva here @U0AJQJCQ1: https://github.com/BetterThanTomorrow/calva/issues/1180. Thanks for bringing this up.

ericdallo00:05:41

@U9A1RLFNV quick question, I'm wondering if vscode supports link on that markdown string

bringe00:05:07

I'm not sure

ericdallo00:05:09

lsp-mode ATM doesn't support it, but I'm changing clojure-lsp to return the filepath in a link

ericdallo01:05:08

if that works on vscode it would be cool otherwise, it will only print the string like lsp-mode does (you can check my print the filename is not underlined, so lsp-mode didn't mark it as a link)

bringe01:05:59

I see, sounds good!

bringe01:05:11

I think links do work... feel like I've seen this before.

bringe01:05:19

Markdown links, at least

ericdallo01:05:51

yes, it would be similar to cider docs on emacs that has link to the file definition

👍 3
ericdallo01:05:05

I'll try to add support for that on lsp-mode as well

bringe23:05:19

@slawek098 @pez Created an issue for updating our cljfmt here: https://github.com/BetterThanTomorrow/calva/issues/1179 Didn't see an existing one.