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

[vscode] Bump aiconfig-editor dependency to 0.2.1 #1309

Merged
merged 1 commit into from
Feb 23, 2024
Merged

[vscode] Bump aiconfig-editor dependency to 0.2.1 #1309

merged 1 commit into from
Feb 23, 2024

Conversation

rholinshead
Copy link
Contributor

@rholinshead rholinshead commented Feb 23, 2024

[vscode] Bump aiconfig-editor dependency to 0.2.1

  • Fix for not calling getModels callback in readOnly

Stack created with Sapling. Best reviewed with ReviewStack.

@rholinshead rholinshead marked this pull request as ready for review February 23, 2024 02:52
rholinshead added a commit that referenced this pull request Feb 23, 2024
[rfc] Show readonly Editor Before Server Is Started

# [rfc] Show readonly Editor Before Server Is Started

Currently when opening an aiconfig file, the file contents / editor
webview are not rendered at all until the server is started (or
attempted to start). This is because the webview isn't rendered until
`resolveCustomTextEditor` returns, and we are awaiting a few
server-initialization-related calls within the function.

To fix, we can move the `startEditorServer` into a regular `.then`,
which will call the Promise without blocking. Within the `.then` we can
handle the resolved promise as normal and do the other things that
depend on the server process running.

Another thing worth mentioning is that we previously required the server
url to set up the csp for the webview HTML. I'm not sure if we actually
need to set the `connect-src vscode-webview` at all (didn't seem to make
a difference when testing) but for now, just setting to accept any
localhost port instead of being dependent on server.

We can immediately set the webview content and see it rendered (in
readonly mode by default):


https://github.com/lastmile-ai/aiconfig/assets/5060851/2bf8cd4a-2b4d-4aea-ad1e-8f15f245ba65


NOTE: This currently results in a notification, 'Error loading models'
since the (readonly) editor is attempting to load the models before the
server is set up. There is a simple fix needed in the editor to address
that, so I'll do that and update the package for use in the vscode
extension before landing this

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/1306).
* __->__ #1306
* #1309
@rholinshead rholinshead merged commit d2cfe0f into main Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant