calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
pez 2021-05-17T08:07:37.105200Z

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?

pez 2021-05-17T08:09:00.105700Z

Reloading the window worked.

ericdallo 2021-05-17T11:39:05.105800Z

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

pez 2021-05-17T12:01:15.106Z

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

bringe 2021-05-17T17:22:30.106200Z

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

🤘 1
bringe 2021-05-17T17:22:49.106400Z

Just a redundancy measure

p-himik 2021-05-17T19:09:16.108600Z

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.

p-himik 2021-05-18T08:37:40.002400Z

Oh, I don't plan on using REPL at all. Given that I'm using it with Awesome WM, the REPL setup would have to be quite something to make it work, maybe even some modifications to Awesome WM will have to be made.

pez 2021-05-18T09:20:48.002600Z

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

p-himik 2021-05-18T09:40:45.002800Z

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-himik 2021-05-18T09:41:52.003Z

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))

bringe 2021-05-18T16:56:45.013500Z

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.

bringe 2021-05-17T19:13:13.108700Z

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 @pez has to say here.

p-himik 2021-05-17T19:15:38.108900Z

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
pez 2021-05-17T20:08:30.109100Z

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-himik 2021-05-17T20:09:33.109300Z

Thanks! I'll poke around.

pez 2021-05-17T20:10:34.109500Z

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…

pez 2021-05-17T20:11:00.109700Z

There is a setting for hiding the REPL Ui.