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

Client should report current value of activeSignature to signatureHelpProvider #33413

Closed
KamasamaK opened this issue Aug 29, 2017 · 7 comments
Closed
Assignees
Labels
api api-proposal editor-parameter-hints Function, method and class parameter hint widget on-testplan

Comments

@KamasamaK
Copy link

KamasamaK commented Aug 29, 2017

  • VSCode Version: 1.15.1
  • OS Version: Windows 10 Pro, version 1703 (x64)

Steps to Reproduce:

  1. Trigger signature help with multiple signatures
  2. Manually change active signature
  3. Type a non-separator character
  4. Watch it revert to previously active signature

Reproduces without extensions: N/A

With the current value of activeSignature in the request, the signatureHelpProvider could more intelligently decide what the activeSignature value should be in its response. This is especially the case when both arguments are not reasonably distinct enough for the provider to otherwise determine the active signature and must make it arbitrary.

Ref: #16256

@jrieken jrieken self-assigned this Aug 30, 2017
@jrieken jrieken added feature-request Request for new features or functionality and removed new release labels Aug 30, 2017
@MofX
Copy link

MofX commented Jan 18, 2018

I also really like to see this feature:
Not only from a language extension developer's perspective, but also from a user's perspective:
If i manually select one overload, I'd like it to stick, until I'm finished typing the call.
When looking at a complete function call, it is no problem to not have this, because then the overload should be deducible, but while I'm typing in, I might like to see the overload I am about to use.

This is especially true for the language I am working on (some internal markup language), where only the final number of parameters allows deduction of the used overload.

For all scenarios that I could think about, to be satisfy-able, the SignatureHelpProvider needs to know, if the user manually selected an overload and the number of this overload

@KamasamaK
Copy link
Author

This could be made part of the new SignatureHelpContext proposed in #51731

@jrieken
Copy link
Member

jrieken commented Jul 10, 2018

Yeah, we can think of that. What exactly do you need @KamasamaK?

@KamasamaK
Copy link
Author

KamasamaK commented Jul 10, 2018

@jrieken I would like the activeSignature value in the SignatureHelpContext. As described in the opening comment, the provider must return activeSignature but currently has to do so without knowing what the current value is in the client (if it has one).

@mjbvz
Copy link
Collaborator

mjbvz commented Dec 19, 2018

One complication is the case where there are multiple active signature help providers. In this case, the activeParameter /activeSignature alone likely isn't enough, since the provider needs a way to know if it was the one that returned the previous signature help

We could pass back the entire SignatureHelp object to support this

mjbvz added a commit that referenced this issue Dec 20, 2018
For #33413

Adds the active `SignatureHelp` object (along with the active signature) to the `SignatureHelpContext`.

Todo:

- [ ] Tests are failing. Not part of  this change directly but a logic error that this change revealed
- How can we ensure that custom `SignatureHelp` objects are not lost when returned in the `SignatureHelpContext`
mjbvz added a commit that referenced this issue Dec 20, 2018
For #33413

Adds the active `SignatureHelp` object (along with the active signature) to the `SignatureHelpContext`.

Todo:

- [ ] Tests are failing. Not part of  this change directly but a logic error that this change revealed
- How can we ensure that custom `SignatureHelp` objects are not lost when returned in the `SignatureHelpContext`
@jrieken
Copy link
Member

jrieken commented Dec 20, 2018

One complication is the case where there are multiple active signature help providers.

Not sure I understand that. Don't we always take the first provider that has a result?

https://github.com/Microsoft/vscode/blob/6bbf94c2f16a6c2150dd9789f97f44f6f17cff35/src/vs/editor/contrib/parameterHints/provideSignatureHelp.ts#L20-L27

mjbvz added a commit to mjbvz/vscode that referenced this issue Jan 7, 2019
For microsoft#33413

Adds the active `SignatureHelp` object (along with the active signature) to the `SignatureHelpContext`.

Todo:

- [ ] Tests are failing. Not part of  this change directly but a logic error that this change revealed
- How can we ensure that custom `SignatureHelp` objects are not lost when returned in the `SignatureHelpContext`
mjbvz added a commit that referenced this issue Jan 7, 2019
For #33413

Adds the active `SignatureHelp` object (along with the active signature) to the `SignatureHelpContext`.
@mjbvz
Copy link
Collaborator

mjbvz commented Jan 7, 2019

Fixed by #65440 which introduces a new activeSignatureHelp field on the SignatureHelpContext object. This new field is proposed API for December/January

Please share any feedback or concerns about the current api proposal

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api api-proposal editor-parameter-hints Function, method and class parameter hint widget on-testplan
Projects
None yet
Development

No branches or pull requests

4 participants