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

Initial work on signature help context #58135

Merged
merged 6 commits into from
Sep 11, 2018
Merged

Initial work on signature help context #58135

merged 6 commits into from
Sep 11, 2018

Conversation

mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Sep 7, 2018

Fixes #54972

Adds SignatureHelpContext. This tells providers why signature help was requested. See #54972 for more details

TODO:

  • Better understand semantics of retrigger. Should retrigger be an flag instead of a triggerReason?
  • Fix skipped test
  • Add more tests for trigger reasons / trigger characters

@@ -458,7 +470,7 @@ export interface SignatureHelpProvider {
/**
* Provide help for the signature at the given position and document.
*/
provideSignatureHelp(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult<SignatureHelp>;
provideSignatureHelp(model: model.ITextModel, position: Position, token: CancellationToken, context: SignatureHelpContext): ProviderResult<SignatureHelp>;
}
Copy link
Member

Choose a reason for hiding this comment

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

Put token at the end where we can

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed but we ran into this case with CompletionItemProvider too and decided it was better to put the context at the end rather than deal with the complexity of the function overload. We can discuss this more at the API sync

@jrieken
Copy link
Member

jrieken commented Sep 7, 2018

Implementation looks good, didn't look at the API too much yet

@DanielRosenwasser
Copy link
Member

So as I understand it right, I think the way that you have it now for TypeScript - where everything is a retrigger as long as signature help is present - is actually fine for the most part. The only time I could imagine this being a problem is when you'd prefer for certain characters to actually dismiss signature help. I can't currently think of any cases though.

Fixes #54972

Adds `SignatureHelpContext`. This tells providers why signature help was requested

TODO:

- [ ] Better understand semantics of retrigger. Should `retrigger` be an flag instead of a `triggerReason`?
- [ ]  Fix skipped test
- [ ] Add more tests for trigger reasons / trigger characters
@mjbvz mjbvz force-pushed the mjbvz/trigger-context branch from 4593dc2 to 71a755e Compare September 11, 2018 00:37
@mjbvz mjbvz merged commit d33b1c3 into master Sep 11, 2018
@mjbvz
Copy link
Collaborator Author

mjbvz commented Sep 11, 2018

Merging in this initial work to get more testing on the JS/TS part of it.

We'll discuss the API and review the design more at the api sync. No commitment to get it finalized this month. If anyone has additional api feedback please let me know

@mjbvz mjbvz deleted the mjbvz/trigger-context branch July 2, 2019 18:30
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add context information to SignatureHelpProvider
3 participants