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

vscode should send textDocument/signatureHelp after autocomplete result #70239

Closed
vicapow opened this issue Mar 11, 2019 · 8 comments
Closed
Assignees
Labels
*dev-question VS Code Extension Development Question

Comments

@vicapow
Copy link

vicapow commented Mar 11, 2019

When attempting to implement function parameter auto complete in Flow, I wanted to support the same behavior as with TypeScript for function parameter autocompletion. It seems vscode + tsserver provides both the completion parameter helper and the signature helper as below:

signature-helper

However, when using communicating over LSP, vscode doesn't send the textDocument/signatureHelp request after the textDocument/completion response. Without this ability, it doesn't seem possible to match the same behavior in any LSP server implementation and provide the signatureHelp dialog in an editor agnostic way.

@vscodebot
Copy link

vscodebot bot commented Mar 12, 2019

We have a great developer community over on slack where extension authors help each other. This is a great place for you to ask questions and find support.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Mar 12, 2019
@jrieken
Copy link
Member

jrieken commented Mar 12, 2019

You can use signature help trigger characters (like ( or ,) and commands the get triggered after accepting a proposal, se https://github.com/Microsoft/vscode/blob/59dca36c224d885ba70741a2d47ebb46fe7f3bd2/src/vs/vscode.d.ts#L3406

@vicapow
Copy link
Author

vicapow commented Mar 12, 2019

@jrieken based on my experimentation, those triggers don’t get called from characters coming from completion.

Also, as far as I can tell, commands don’t work in this situation either because the client would need to have custom logic to respond to the workspace/executeCommand. In otherwords, the client doesn’t execute the raw commands, it wraps them in the executeCommand request and response.

@jrieken
Copy link
Member

jrieken commented Mar 12, 2019

You use the UI command, e.g the one that you invoke via the keybinding, the id is editor.action.triggerParameterHints. Then everything goes its ways.

@vicapow
Copy link
Author

vicapow commented Mar 12, 2019

@jrieken I don’t see these commands mentioned as part of the LSP specification. Under this assumption, this solution isn’t editor agnostic.

@jrieken
Copy link
Member

jrieken commented Mar 12, 2019

Under this assumption, this solution isn’t editor agnostic.

If you want something editor agnostic that you shouldn't post issues in the vscode repository, but in LSP land

@vicapow
Copy link
Author

vicapow commented Mar 12, 2019

@jrieken i believe there is a solution that is editor agnostic that the LSP spec already supports that doesn’t require vscode specific protocols. So I don’t see this as a requiring any LSP spec changes.

To better align with the LSP spec in an editor agnostic way so that LSP servers don’t have to have any vscode specific code, the request here is for vscode to conform to the LSP spec in an editor agnostic way. Specifically, sending the signatureHelp request after the completion would solve this issue in an editor agnostic way.

@vicapow
Copy link
Author

vicapow commented Mar 15, 2019

@jrieken is there no interest from the vscode team to implement this feature using only editor agnostic LSP commands?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*dev-question VS Code Extension Development Question
Projects
None yet
Development

No branches or pull requests

2 participants