Skip to content

Add showSimpleModalDialogPrompt to the extension API - #1816

Merged
juliasilge merged 4 commits into
mainfrom
show-modal-api
Nov 17, 2023
Merged

juliasilge merged 4 commits into
mainfrom
show-modal-api

Conversation

@juliasilge

Copy link
Copy Markdown
Member

Addresses #1629

I don't quite have this wired up correctly, as I see this error in the logs with Zed:

[error] Error: Unknown actor MainThreadModalDialogs

@juliasilge

Copy link
Copy Markdown
Member Author

This PR adds showSimpleModalDialogPrompt to the extension API, along with an example use in Zed:

modal

}

// The interface to the main thread exposed by the extension host
export interface ExtHostModalDialogsShape { }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just empty, right? Seems weird but we need it for the proxy.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, very likely we will need a proxy so that the dialogs can be controlled by the extensions (e.g. if they want to close an open dialog). It's fine for it to be empty for now.


import * as extHostProtocol from './extHost.positron.protocol';

export class ExtHostModalDialogs implements extHostProtocol.ExtHostModalDialogsShape {

@juliasilge juliasilge Nov 15, 2023 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very simple, but this doesn't really fit in any of the other extHost "buckets" we have right now. I do think it's likely we'll add more of this nature eventually.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed!

@juliasilge
juliasilge marked this pull request as ready for review November 15, 2023 17:15
@juliasilge
juliasilge requested a review from jmcphers November 15, 2023 17:15
@juliasilge

Copy link
Copy Markdown
Member Author

Addresses #668

@jmcphers jmcphers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@juliasilge
juliasilge merged commit e7b7bd0 into main Nov 17, 2023
@juliasilge
juliasilge deleted the show-modal-api branch November 17, 2023 21:04
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.

2 participants