Fork me on GitHub
#fulcro
<
2021-09-16
>
sheluchin18:09:17

Anyone had much luck with editor integration for Guardrails?

wilkerlucio20:09:33

what kind of integration?

wilkerlucio20:09:08

my guess is that you want something like this: https://www.fulcrologic.com/copilot (which is not available yet)

tony.kay04:09:56

Perhaps you mean "resolve as..."? It follows the normal form of functions, so resolving it as a defn works well (in IntelliJ, and I'm sure in most others).

sheluchin14:09:34

I think copilot is what I'm thinking of, more or less. If we already have the Guardrails annotations, it seems to me they should be usable statically too, not just at runtime... at least technically possible. Maybe even the runtime results can have some editor integration. Like if a function is returning a non-conforming value during execution, the Guardrails log contains enough data to identify the exact place in the code and that data could be used to annotate the code in the editor with some warning indicator.

tony.kay18:09:22

An editor cannot "run" them, nor can a linter (except in some trivial cases). Specs are turing complete. You have to actually evaluate the specs in the runtime where they are defined. This is made even more complicated for CLJC where the CLJS context could be diff than the CLJ one...you need to try it in both runtimes to really give fully accurate results.