Fork me on GitHub
#lsp
<
2022-10-08
>
Eric Dvorsak09:10:38

Can lsp be configured to jump to the definition of a symbol that comes from a dependency that has been overwritten in .clojure/deps.edn with a :local/root and not from what seems to be a cached filed that can't be edited and recompiled?

ericdallo12:10:17

I think so, it will depend on the final classpath that clojure-lsp uses

skylize13:10:47

Another parsing exception, in the same general category as https://github.com/clojure-lsp/clojure-lsp/issues/1268. But this one I can reproduce at near-minimal-case with totally valid Clojure code. I guess I should just add it to the issue? Almost any string starting with \ as first item inside parens throws, which is perfectly good code, as long is it's quoted.

'("\x")                                     ;; 💣
'("\xyz foo bar bz" :foo :bar "baz" {} [])  ;; 💣
Almost any string starting with \ as first item inside parens, which is perfectly good code, as long is it is quoted. Weirdly a few characters in place of the x above don't throw.
`("\f")    ;; okay
`("\foo")  ;; okay
So far I found f, b, r, and t, do not throw, but F, B, R, and T still do.

ericdallo13:10:04

I'm not sure if it's ok to quote all chars

ericdallo13:10:15

Feel free to mention in the issue though

skylize13:10:26

what do you mean?

ericdallo13:10:59

does clojure compile with \x?

ericdallo13:10:47

Could you paste the exception here just to double check?

lread13:10:05

user=> "\x"
Syntax error reading source at (REPL:1:4).
Unsupported escape character: \x

🙏 1
skylize13:10:46

Oh I see. It's being picky about what can and can't be escaped in a string?

ericdallo13:10:32

Yes, escaping a char means something for some chars, like escaping \t means tab etc

ericdallo13:10:49

Not every escaped char means something or is valid

skylize13:10:06

I stumbled on it from a mistake in code when moving from literal regex #"\.foo" to building from strings (re-pattern "\.foo") ;; <- whoops. Had no idea Clojure was picky about escaping in strings.

👍 1