Skip to content
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

Support imports in VS Code #1332

Open
berekuk opened this issue Oct 27, 2022 · 1 comment
Open

Support imports in VS Code #1332

berekuk opened this issue Oct 27, 2022 · 1 comment

Comments

@berekuk
Copy link
Collaborator

berekuk commented Oct 27, 2022

This should be done after #1331.

@berekuk berekuk moved this to 🆕 To prioritize in Main project Oct 27, 2022
@berekuk berekuk moved this from 🆕 To prioritize to Soon in Main project Apr 17, 2023
@berekuk berekuk changed the title Support #include syntax in VS Code Support imports in VS Code May 19, 2023
@berekuk
Copy link
Collaborator Author

berekuk commented May 20, 2023

This is complicated.

Playground webview renders current text in the editor, even unsaved text, so it can't read files from disk (even if it could; webviews can't read files anyway, and any content should be sent to webviews with events).

But with imports, playground should also get contents of imported files somehow, and also update when the files have changed.

Preliminary plan:

  • webview will ask the extension for all dependencies it parsed from code, with events
  • extension will send events with the content for dependencies (read from disk), which the playground will add to its project object
  • extension will also monitor changes to the files (with onDidChangeTextDocument and so on) and send updated versions to the playground (but only the files that are needed by the playground, so we should keep track of those somehow; we don't want to send all edited code to every squiggle webview panel)
  • async handling of all this is going to be quite messy, since the playground shouldn't render errors if files are not loaded yet

@OAGr OAGr moved this from Soon to 🔖 Later in Main project Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 Later
Development

No branches or pull requests

1 participant