Skip to content

vscode should send textDocument/signatureHelp after autocomplete result #70239

Closed

Description

@vicapow

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.

Activity

  1. vscodebot commented on Mar 12, 2019

    @vscodebot

    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!

  2. jrieken commented on Mar 12, 2019

    @jrieken
    Contributor

    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

  3. vicapow commented on Mar 12, 2019

    @vicapow
    Author

    Johannes Rieken (@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.

  4. jrieken commented on Mar 12, 2019

    @jrieken
    Contributor

    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.

  5. vicapow commented on Mar 12, 2019

    @vicapow
    Author

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

  6. jrieken commented on Mar 12, 2019

    @jrieken
    Contributor

    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

  7. vicapow commented on Mar 12, 2019

    @vicapow
    Author

    Johannes Rieken (@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.

  8. vicapow commented on Mar 15, 2019

    @vicapow
    Author

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

  9. locked and limited conversation to collaborators on Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*dev-questionVS Code Extension Development Question

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions