BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.67k stars 217 forks source link

calva "clojure" file (no extension) not supported as .cljs file #1971

Open milelo opened 1 year ago

milelo commented 1 year ago

If I have a Clojure file without an extension either identified as such by the autodetect or explicitly set, the syntax highlighting works ok however commands like "Go to Definition" don't.

Use-case I'm creating directly-executable nbb #! files where I don't want the .cljs extension. My work-around at the moment is to create symlinks to the nbb .cljs scripts without the extensions.

Calva 2.0.319

bpringe commented 1 year ago

Sorry for the delay. @PEZ @ericdallo Is this related to clojure-lsp? Can a repl provide this functionality in this case? (I haven't worked with nbb.)

I remember discussing the possibility of making Calva add a project file and restart clojure-lsp to make it analyze the file (or something) in another issue. I don't remember which issue that was. Anyway, we opted to not make Calva do that and just inform the user that adding that file and restarting clojure-lsp will make it provide support. I think that's related?

ericdallo commented 1 year ago

This seems to be a vscode LSP client issue, clojure-lsp just receives the initialization request and didOpen requests which probably are not being sent from LSP client. Maybe just check if those requests are being sent?

bpringe commented 1 year ago

@milelo If you can post the logs between Calva and clojure-lsp here that could help. See how to get those here: https://calva.io/clojure-lsp/#viewing-the-logs-between-the-client-and-server.