Fork me on GitHub
#calva
<
2021-05-17
>
pez08:05:37

Got this when starting my work project today: > [Error - 10:05:07 AM] Starting client failed > Launching server using command /Users/peter/.vscode/extensions/betterthantomorrow.calva-2.0.197/clojure-lsp_backup failed. Is this something anyone else has seen as well?

ericdallo11:05:05

Never saw this clojure-lsp_backup 😅 maybe a Calva thing?

pez12:05:15

Yeah, this is the Calva channel, after all. 😃 @U9A1RLFNV can probably tell us what the _backup is about.

bringe17:05:30

Not sure why the backup failed to launch, but here's the deal with the backup (from the PR): > Before downloading a new version, the current version of clojure-lsp is backed up. If the download fails, the backup is used

metal 1
bringe17:05:49

Just a redundancy measure

pez08:05:00

Reloading the window worked.

p-himik19:05:16

Is it possible to use Calva on languages other than Clojure, without associating file extensions of that language with Clojure? In my particular case, I'd like to try Calva on Fennel. The language is different from Clojure, but it's a LISP as well, so I'm wondering whether I'll be better off with Calva than with plain text editing.

bringe19:05:13

Hi. I think the file extensions of that language would need to be associated with Calva, at least, for it to activate for those files. However, I'm not sure if Calva would work well for another language, even if it's a lisp. I'm guessing you're looking for features like formatting and syntax highlighting. If those things were attempted to be used from Calva with another lisp, I'd imagine they'd be a bit buggy at best. I'm curious what @U0ETXRFEW has to say here.

p-himik19:05:38

I'm looking for formatting and paredit. Syntax highlighting is delivered by another extension. Not sure which one would "win" here though. Yes, I understand that. My point is that exactly of testing it - it might be buggy to the extent where it's still worth it.

👍 1
pez20:05:30

If you run Calva in development mode, you can try to modify package.json so that Calva activates also for Fennel files, w/o associating it with the Clojure language. Just to see what happens. I’m thinking that then the Clojure syntax highlight shouldn’t kick in.

p-himik20:05:33

Thanks! I'll poke around.

pez20:05:34

Beyond that it will be a matter of how much special syntax Fennel has. And also a matter of how much we check for clojure file type…

pez20:05:00

There is a setting for hiding the REPL Ui.

mauricio.szabo02:05:02

@U2FRKM4TW I tried exactly that on Chlorine and Clover with nrepl. Some stuff work, mostly don't. Fennel have another problem, that the nrepl implementation do not return "evaluation results", just return things as if they are printed on the console

mauricio.szabo02:05:12

So in my case, I wasn't able to detect that the REPL was connected. I suppose Calva will connect, but not render the inline results of code

pez09:05:48

Maybe factor things so that some of the code can be developed with the REPL? Sounds awful not to have a REPL! 😃

p-himik09:05:45

Not that awful, given that it's just thousands of lines of config. Except for just a handful of things, it's mostly calling Awesome WM Lua functions with specific arguments.

p-himik09:05:52

E.g. a very typical code:

(local tag-global-keys
  ;; Bind all key numbers to tags.
  ;; Be careful: we use keycodes to make it work on any keyboard layout.
  ;; This should map on the top row of your keyboard, usually 1 to 9.
  (let [t {}]
    (for [i 1 (math.min 9 (length tags))]
      (let [b (.. "#" (+ i 9))]
        (-> t
            (add-key! [modkey] (.. "#" (+ i 9))
                      (fn []
                        (let [s (awful.screen.focused)]
                          (-?> (. s.tags i) switch-to-tag)))
                      {:description (.. "view tag #" i) :group :tag})
            (add-key! [modkey :Control] b
                      (fn []
                        (let [s (awful.screen.focused)]
                          (-?> (. s.tags i) awful.tag.viewtoggle)))
                      {:description (.. "toggle tag #" i) :group :tag})
            (add-key! [modkey :Shift] b
                      (fn []
                        (match client.focus
                          c (-?> (. c.screen.tags i) c:move_to_tag)))
                      {:description (.. "move focused client to tag #" i) :group :tag})
            (add-key! [modkey :Control :Shift] b
                      (fn []
                        (match client.focus
                          c (-?> (. c.screen.tags i) c:toggle_tag)))
                      {:description (.. "toggle focused client on tag #" i) :group :tag}))))
    t))

bringe16:05:45

Interesting lang. I never worked with Lua, but I remember seeing things about writing game plugins/extension (like for World of Warcraft). It's cool that you can use something very close to Clojure now for things like that.