This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-24
Channels
- # announcements (13)
- # asami (9)
- # aws (3)
- # babashka (13)
- # babashka-sci-dev (7)
- # beginners (32)
- # calva (59)
- # cider (9)
- # clj-kondo (5)
- # cljsrn (14)
- # clojure (98)
- # clojure-brasil (5)
- # clojure-dev (1)
- # clojure-europe (30)
- # clojure-france (12)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (7)
- # clojurescript (20)
- # conjure (2)
- # datahike (7)
- # datalog (38)
- # datomic (29)
- # events (1)
- # fulcro (72)
- # graalvm (1)
- # gratitude (3)
- # helix (7)
- # honeysql (3)
- # improve-getting-started (2)
- # introduce-yourself (1)
- # leiningen (13)
- # lsp (17)
- # malli (11)
- # meander (8)
- # nextjournal (3)
- # off-topic (5)
- # pathom (2)
- # portal (43)
- # rdf (2)
- # re-frame (8)
- # reagent (7)
- # reitit (1)
- # shadow-cljs (27)
- # spacemacs (31)
- # sql (2)
- # tools-deps (3)
- # vim (1)
- # xtdb (12)
Hello, I'm struggling to get portal working as an intellij plugin. I've installed it but I just get a blank white screen if I open the tool window - running the examples in the readme also doesn't seem to change anything. I'm on ubuntu linux 20.04.3 and running intellij 2021.3.2 (Ultimate Edition), portal version 0.22.1. I had a quick grep through the logs and the only thing that looks like it might be related is a cursive exception that I'll add in thread. Is there any troubleshooting or other steps I can try to help debug the issue? Thanks!
not sure how helpful this is but here's the blank screen in question:
When you run the fn in your repl to open portal, what is returned?
(p/open {:launcher :intellij})
=> {:session-id #uuid"62d44ce2-fb30-4f43-9a8a-52043c40d4ec"}
@UC3B7UJF2 Do you have a .portal/intellij.edn
at the root of your project?
I do not, should I?
all I've done so far is install then follow this: https://github.com/djblue/portal#api
Yeah, that's how the repl process and intellij plugin coordinate communication. You shouldn't need to create it manually, it should be auto created when the plugin initializes.
I will, that's also interesting in that I have a multi-module project so let me do a bit of investigation based on what you've said and see if that's causing a problem
thanks for the help so far btw 👍
Yeah, the plugin struggles with multiple modules. https://github.com/djblue/portal/blob/master/extension-intellij/src/main/clojure/portal/extensions/intellij/factory.clj#L69-L73 is how the config file is written.
Also, here is the code in the repl trying to find the file: https://github.com/djblue/portal/blob/master/src/portal/runtime/jvm/launcher.clj#L14-L24
ahh I see, okay I think I understand the problem, my folder structure looks like (config contains the .idea etc folders)
.
├── config
└──.portal
├── module-1
├── module-2
└── module-3
I can probably wrangle it into being more normal, I only set it up like that so there wasn't files everywhere in my root directory
thanks for the help 👍
Is this stuff in the docs anywhere? I was dorking around trying to get IntelliJ to open the window and then I noticed the side-tab that has Portal in it already, but it would be good to capture this so others see it in the docs.
@U060WE55Z I think you are looking for https://cljdoc.org/d/djblue/portal/0.26.0/doc/editors/intellij :thumbsup:
I ended up coding my own visualization for malli generative testing, that looks like:
@UA7E6DU04 do you mind sharing how to achieve something like this?
So, I created this cljc
library https://github.com/meditans/portal-malli-visualizer
it's very simple, it only contains a multimethod to generate the right hiccup based on which type of malli error you get (like ::m/invalid-input
, those are the same malli use for its prettifier)
so, let's see, in order to use it, you should add in your project the deps.edn
coordinate
and then, for instrumentation, you should use:
(dev/start! {:report portal.malli.visualizer/display-malli-error})
while for generative checking, I have this little emacs setup:
(defun med/cider-eval-on-top-level-form (fn-str)
(let ((quoted-defn (concat "'" (cider-defun-at-point))))
(cider-interactive-eval (concat "(" fn-str " " quoted-defn ")"))))
(defun malli-check-this ()
(interactive)
(med/cider-eval-on-top-level-form
"#(portal.malli.visualizer/check->portal (mi/check {:filters [(mi/-filter-var #{(resolve (second %))})]}))"))
(defun malli-check-all ()
(interactive)
(cider-interactive-eval "(-> (mi/check) portal.malli.visualizer/check->portal)"))
that will call the functions in that namespace 😂I'll probably make a blogpost when this workflow is more settled down, which includes all my emacs-portal-malli setup, but feel free to ask more questions in the meantime ☺️
About custom visualizers: here's what I think about how the functionality could be exposed.
We should have essentially an atom containing (semantically) a list of visualizers (name, recognizer, code). As an example, the malli generative testing I did before has as a recognizer a malli/validate
predicate, which checks if we have a generative checking error, and as a visualizer, I built a hiccup form and wrapped it in the correct metadata. The design principles that I would care about are: being able to access the visualizers atom programmatically, and being able to use in my recognisers and visualizers libraries that I don't necessarily have in my original program (and this could be the difficult part, maybe it's not even needed if we curate the dependencies that we have)
I'm just trying Portal for the first time in IntelliJ and am having trouble getting the Portal pane to show content reliably. It appears the pane will never show content if it happens to be minimized when IntelliJ starts. Also, I've found the pane content vanishes if the pane position is moved, using the cog menu > Move To options. I'm using IntelliJ Ultimate 2021.3.3 with Portal 0.22.1. Is this a known issue?
I've discovered this issue is affecting IntelliJ running in WSL 2, but not IntelliJ running natively in Windows 10. I can't run Windows 11 so I don't know if works when running in WSLg.
For those using #nbb, portal.client.node remote client should work in the next release 🙌