This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-08
Channels
- # babashka (18)
- # beginners (35)
- # biff (15)
- # cider (24)
- # clj-commons (26)
- # clj-kondo (12)
- # clojure (18)
- # clojure-austin (1)
- # clojure-dev (2)
- # clojure-europe (15)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-norway (88)
- # clojure-seattle (2)
- # clojure-spec (14)
- # clojure-uk (27)
- # clojuredesign-podcast (5)
- # clojurescript (25)
- # cursive (3)
- # datahike (26)
- # datalevin (13)
- # datomic (39)
- # etaoin (19)
- # events (1)
- # fulcro (12)
- # graphql (1)
- # hyperfiddle (40)
- # introduce-yourself (3)
- # joyride (8)
- # lsp (53)
- # missionary (7)
- # nyc (1)
- # off-topic (31)
- # overtone (10)
- # reitit (6)
- # shadow-cljs (9)
- # slack-help (9)
- # thejaloniki (1)
- # tools-deps (12)
I am confused about how to import extensions api’s.
I am not very well versed in VSCode Extensions, but there seems to be some inconsistent behavior between the (:require)
and getExtension
that I find a bit confusing.
I am trying to use Joyride to poke about the functions of different extensions, and to create some basic user scripts to automate certain tasks.
This code shows the output of one of my scripts trying to import the Splunk Extension for VSCode. Note that splunk-api
doesn’t work, while splunk-ext
does.
(ns splunk-joyride
(:require ["vscode" :as vscode]
[joyride.core :as joyride]
["" :as splunk-api]))
;; => nil
(def splunk-ext (vscode/extensions.getExtension "Splunk.splunk"))
;; => #'splunk-joyride/splunk-ext
(js-keys vscode)
;; => #js ["version" "ai" "authentication" "commands" "comments" "chat" "debug" "env" "extensions" "interactive" "l10n" "languages" "notebooks" "scm" "speech" "tasks" "tests" "window" "workspace" "Breakpoint" "TerminalOutputAnchor" "ChatAgentResultFeedbackKind" "ChatMessage" "ChatMessageRole" "ChatVariableLevel" "CallHierarchyIncomingCall" "CallHierarchyItem" "CallHierarchyOutgoingCall" "CancellationError" "CancellationTokenSource" "CandidatePortSource" "CodeAction" "CodeActionKind" "CodeActionTriggerKind" "CodeLens" "Color" "ColorInformation" "ColorPresentation" "ColorThemeKind" "CommentMode" "CommentState" "CommentThreadCollapsibleState" "CommentThreadState" "CompletionItem" "CompletionItemKind" "CompletionItemTag" "CompletionList" "CompletionTriggerKind" "ConfigurationTarget" "CustomExecution" ...]
(js-keys splunk-ext)
;; => #js ["id" "extensionUri" "extensionPath" "packageJSON" "extensionKind" "isFromDifferentExtensionHost"]
(js-keys splunk-api)
;; => Could not resolve symbol: splunk-api
It doesn’t seem to resolve.
splunk-api
;; => Could not resolve symbol: splunk-api
I am not sure what to do to troubleshoot.I can’t get it to work. Starting to suspect it doesn’t provide an API. Although, I had expected something like an empty object in that case… Do you know if it has an API?
I don’t to be honest. That’s why I wanted to poke around with Joyride. How does one find out if a VSCode extension has an API? Source is here if you are curious: https://github.com/splunk/vscode-extension-splunk
It should return an object from it’s activate
function. Splunk doesn’t, if I have found the correct activate function: https://github.com/splunk/vscode-extension-splunk/blob/master/out/extension.js#L272