-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable language support for adaptors when writing job code #9
Comments
@josephjclark It seems I can get ast.json for adaptors by version via github. eg. |
Hey @doc-han , ast.json is OK I guess but I don't understand why you need it? The .d.ts files should be the best source of truth for VSC. If you're having to manually generate some kind of data structure to drive VSC, well, we need to talk about that! It doesn't feel like the right approach. Can you book some time in my calendar to talk about this tomorrow? |
Updates from our call: Basically we want to pretend that we have a regular javascript (or typescript?) project here, and we want to configure it so that each job file is properly scoped. Maybe with globals, maybe with imports. As a reference for how we get language support today, see https://github.com/OpenFn/adaptors/wiki/How-to-get-code-assist-for-adaptors-in-VSC
If we really, really can't get this working, I'm happy explore using |
|
This is great analysis @doc-han, thank you! Let me think about it. I agree that this just isn't going to fly in its current state. We're so close and yet so far... |
@doc-han Thinking about this overnight. What do the other JS runtimes do? Bun and Deno, for example, must both have vscode extensions with language support. And I know for a fact that Bun introduces different things to the global environment, I'm sure deno does too. Can you have a look for a bun extension and see what they do? Have they found a way to register extensions, or customise the scope, or do they create their own language support from scratch? |
For type support. They declare one global namespace |
Ok, and that works because it's global. It's the same environment for all bun JS. Our problem is more like: each file has its own vm/environment |
Ok this is probably very over elaborate, but what if:
Would that apply the right types? |
|
@doc-han Well the idea is to push the problem further up the hill until we run out of options, and then see what the least-bad implementation looks like. But I hear you. I'm sure we should be able to achieve this 🤔 But I'm not willing to invest too much more time in it. Let's put a pause on it until next week. One final question: how long do you need to finish a usable demo your own custom language support? Just enough to be useful? |
Yeah make sense. Hence, in a job directory.
inbox: a zip of a working openfn project with this. You can change versions in tsconfig to match what you have installed at |
With this we will have imports using |
We need to download the adaptor API and present it to the typescript context.
Maybe we can re-use some trick used by Lightning and monaco?
The text was updated successfully, but these errors were encountered: