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

Clarification: can SignatureHelp.signatures be an empty array? #934

Closed
mroch opened this issue Mar 2, 2020 · 2 comments
Closed

Clarification: can SignatureHelp.signatures be an empty array? #934

mroch opened this issue Mar 2, 2020 · 2 comments
Labels
clarification info-needed Issue requires more information from poster

Comments

@mroch
Copy link

mroch commented Mar 2, 2020

The interface for SignatureHelp (as of 3.15) says that signatures contains "one or more", but then activeSignature talks about signatures.length === 0.

export interface SignatureHelp {
	/**
	 * One or more signatures.
	 */
	signatures: SignatureInformation[];

	/**
	 * The active signature. If omitted or the value lies outside the
	 * range of `signatures` the value defaults to zero or is ignored if
	 * `signatures.length === 0`. [...]
	 */
	activeSignature?: number;

	[...]
}

It also says "Signature help represents the signature of something callable" which suggests that when the Position is not something callable, the correct response is null, not { signatures: [] }.

If that's the case, I think the docs for activeSignature should not mention signatures.length === 0. Further, why would activeSignature ever be outside the range of signatures? It's confusing that it talks about all these invalid states.

@dbaeumer
Copy link
Member

dbaeumer commented Mar 3, 2020

The reason why the spec talks about this is that clients receiving such a result has some reasonable hints what to do if it receives something that where active signature is outside the array.

I do agree if that this can be made more clear. I rephrases it a little.

@dbaeumer dbaeumer added info-needed Issue requires more information from poster clarification labels Mar 3, 2020
@vscodebot vscodebot bot closed this as completed Mar 10, 2020
@vscodebot
Copy link

vscodebot bot commented Mar 10, 2020

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
clarification info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants