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

HoverContext should have non-optional readonly members #211150

Open
jrieken opened this issue Apr 23, 2024 · 1 comment
Open

HoverContext should have non-optional readonly members #211150

jrieken opened this issue Apr 23, 2024 · 1 comment
Assignees
Labels
polish Cleanup and polish issue

Comments

@jrieken
Copy link
Member

jrieken commented Apr 23, 2024

Testing #210904

Because it is VS Code passing a HoverContext instance we should mark its properties readonly and unless I am mistaken there is no reason the declare them as optional. AFAIK when having a context (which is optional) all properties are defined

@jrieken jrieken changed the title HoverContext should have non-optional readonly memebers HoverContext should have non-optional readonly members Apr 23, 2024
@aiday-mar
Copy link
Contributor

aiday-mar commented Apr 24, 2024

We thought that it may be possible we add more fields into the hover context not in relation with the verbosity, hence why we made the fields optional.

We could perhaps add an optional sub-field into the HoverContext called HoverVerbosityRequest or HoverVerbosityContext with obligatory verbosity specific fields:

interface HoverContext {
    hoverVerbosityRequest?: HoverVerbosityRequest;
}

interface HoverVerbosityRequest {
    previousHover: Hover;
    action: HoverVerbosityAction;
}

Or we could keep the fields directly inside of the HoverContext but rename it to HoverVerbosityContext instead.

@aiday-mar aiday-mar added the polish Cleanup and polish issue label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish Cleanup and polish issue
Projects
None yet
Development

No branches or pull requests

2 participants