OpenFn / OpenFn/lightning

Add custom diagnostics to Editor(monaco)

Open
#2,710 1 comment 0 reactions 1 assignee View on GitHub

@doc-han is already working on this.

Since Feb 16, 2025.

DevX
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

Is your feature request related to a problem? Please describe.

Currently, our Editor only provides simple completion suggestions and doesn't really catch other issues we're more interested in.
eg. A user writing an expression that contains blocks that don't follow the openfn way

fn(state=> {
...
// do some work
...
return state;
})

console.log("smth") // not accepted!

Our editor doesn't provide enough help. it just keeps silent and then our compiler goes on to fail.

Tell us about your idea - describe the solution you'd like.

The idea is to provide diagnostic report/markers in the Editor to help users write less error-prone code.

Plan

  1. Monaco seems to already inject a parser into the browser via a web worker - check network tab for tsWorker.js(1.1MB)
    This file is served via jsdelivr. Can we patch it, build our version of tsWorker.js, and load it instead of the default monaco one?
  2. Add a parser (eg. babel-parser, acorn, ...) - which would add approx another 1.1MB to our bundle size. or even lazy loaded(still not fun).

Additional context

...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.