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

Require plugins to declare their annotations #1348

Open
TwitchBronBron opened this issue Nov 18, 2024 · 2 comments
Open

Require plugins to declare their annotations #1348

TwitchBronBron opened this issue Nov 18, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@TwitchBronBron
Copy link
Member

Require plugins to declare their annotations ahead of time so we can provide better editor help and also validation.

This is a breaking change to bsc because annotations would be validated for their existence, so perhaps it's a good candidate for v1.0?

Requirements:

  • plugins must declare all of their annotations, which include name and any arguments and their types. For future compatibility, we should support an array of signatures (even if we only support one signature at the moment).

Benefits:

  • we can provide intellisense for annotations
  • we can show diagnostics when using unknown annotations

Possible implementation:
There's a new plugin lifecycle hook where plugins can declare various settings. Perhaps something like this:

onPluginConfigure(event){
    //should this be brighterscript style code? Or json? 
    this.annotations = [
         `inline()`,
        `suite(suiteConfig as { name: string, timeout: number})`
    ]
}
@TwitchBronBron TwitchBronBron added the enhancement New feature or request label Nov 18, 2024
@TwitchBronBron TwitchBronBron added this to the v1.0.0 milestone Nov 18, 2024
@markwpearce
Copy link
Collaborator

Can this be v1.1 ?

@TwitchBronBron TwitchBronBron modified the milestones: v1.0.0, v1.1.0 Dec 12, 2024
@TwitchBronBron
Copy link
Member Author

Maybe? The risk is that if we launch without it, it would be a breaking change to land it later in v1, becuase we would essentially enforce that all annotations are pre-registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants