This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-12
Channels
- # announcements (6)
- # babashka (45)
- # beginners (4)
- # calva (19)
- # cider (2)
- # clj-kondo (10)
- # clj-yaml (10)
- # clojure (25)
- # clojure-boston (1)
- # clojure-conj (3)
- # clojure-europe (34)
- # clojure-losangeles (5)
- # clojure-nl (1)
- # clojure-norway (11)
- # clojure-uk (2)
- # clojurescript (84)
- # cursive (10)
- # datalevin (3)
- # figwheel-main (1)
- # fulcro (1)
- # jobs (5)
- # joyride (25)
- # lsp (17)
- # malli (18)
- # nbb (1)
- # off-topic (1)
- # re-frame (22)
- # remote-jobs (9)
- # scittle (3)
- # shadow-cljs (26)
- # sql (16)
- # tools-build (12)
- # xtdb (44)
Is it possible to use extensions.getExtension('myExtension')
from joyride or is it only available when building vscode extensions?
(.getExtension (.-extensions vscode) "myExtension")
Yes, that's how you do it. I'd use (vscode/extensions.getExtension "myExtension")
. There is an example in the default user activate script. https://github.com/BetterThanTomorrow/joyride/blob/master/assets/getting-started-content/user/user_activate.cljs#L101
awesome, thanks!
If this is not in an activation script you need it, @UBN9SNVB4, you can also use the special extension require syntax to get the extension's API. (ns ... (:require ["
There's an example here: https://github.com/BetterThanTomorrow/joyride/blob/master/examples/.joyride/scripts/joyride_api.cljs#L3
is there a nifty way to find all public properties of a vscode extension? I tried via the repl but it always returns
#js ["id" "extensionUri" "extensionPath" "packageJSON" "extensionKind" "isFromDifferentExtensionHost"]
I expected e.g the joyride to show the joyride keys (e.g. isActive
) when I tried to list all object keys
I simply want to list all props for any extension which I can use to do stuff 😄
I don't know why isActive
doesn't show with js-keys
. Or, rather, why the object does not include it, which you can see if you try
(js/JSON.parse (js/JSON.stringify joy))
There's something special about some of the properties.Please file an issue about it, @UBN9SNVB4. I think there should be something we could do about it.
getOwnProperties is what we use for completions, isn't it, @U04V15CAJ? In any case it shows the same as js-keys
does.
@U0ETXRFEW issue created https://github.com/BetterThanTomorrow/joyride/issues/147
Thanks! I think the behaviour of js-keys
might be defined in a way that Joyride should not change. The problem rather is that we lack a way to see all properties.
it's not clear to me what the expected behavior is. what is the JS invocation with the expected output?
@U04V15CAJ. The node repl shows all the properties for these objects. The expected behaviour is that we can see them from the Joyride REPL somehow. At least that's what I am lacking.
e.g. (.-isActive joyride)
is not returned. But it's there.
but what is the equivalent JS invocation that does show these? joyride supports JS scripts now - is it possible to make a repro in .js that does work?
I can get the missing properties like so:
(ns joyride.js-completions
(:require ["repl" :as node-repl]
["vscode" :as vscode]))
(comment
(def !completions (atom []))
(defn completions-cb [err result]
(if err
(js/console.error err)
(reset! !completions (-> result js->clj first))))
(def repl (.start node-repl))
(def context (.-context repl))
(unchecked-set context "ext" (vscode/extensions.getExtension "betterthantomorrow.joyride"))
(defn complete [s]
(.completer repl s completions-cb context)
@!completions)
(complete "ext.") => ["ext.__proto__"
"ext.hasOwnProperty"
"ext.isPrototypeOf"
"ext.propertyIsEnumerable"
"ext.toLocaleString"
"ext.toString"
"ext.valueOf"
""
"ext.activate"
"ext.constructor"
"ext.exports"
"ext.isActive"
""
"ext.extensionKind"
"ext.extensionPath"
"ext.extensionUri"
"ext.id"
"ext.isFromDifferentExtensionHost"
"ext.packageJSON"]
:rcf)