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

The signature help "parentheses" detection needs more work #1001

Closed
rwols opened this issue Apr 29, 2020 · 6 comments · Fixed by #1513
Closed

The signature help "parentheses" detection needs more work #1001

rwols opened this issue Apr 29, 2020 · 6 comments · Fixed by #1513

Comments

@rwols
Copy link
Member

rwols commented Apr 29, 2020

Screenshot from 2020-04-29 23-05-29

We've seen that for e.g. a dockerfile language server the parens detection doesn't work at all.
For gopls, parentheses are used after the function ends. The right decision might be to abandon this parsing. There's nothing in the spec that guarantees us parentheses of any kind.

@rchl
Copy link
Member

rchl commented Apr 30, 2020

Here are some example signature responses (for my own information mostly).

{
    "signatures": [
        {
            "label": "toggleExpand(memberId: number): void",
            "parameters": [
                {
                    "documentation": "",
                    "label": "memberId: number"
                }
            ]
        }
    ],
    "activeParameter": 0,
    "activeSignature": 0
}
{
    "signatures": [
        {
            "documentation": "Copy new files and directories to the image's filesystem.",
            "label": "COPY [flags] source ... dest",
            "parameters": [
                {
                    "documentation": "Optional flags to configure this instruction.",
                    "label": "[flags]"
                },
                {
                    "documentation": "The resource to copy.",
                    "label": "source"
                },
                {
                    "documentation": "The resource to copy.",
                    "label": "..."
                },
                {
                    "documentation": "The name of the destination file or folder.",
                    "label": "dest"
                }
            ]
        }
    ],
    "activeParameter": 1,
    "activeSignature": 0
}

I haven't checked what we are parsing them for. Is that to highlight active parameter?

@AmjadHD
Copy link
Contributor

AmjadHD commented May 8, 2020

there's an issue i noticed before (i don't know if it's still there): when you are inside the parameter section of a function and and click "(" (e.g to create a tuple), signatureHelp is invoked.

f(1, 2, (|))

@rwols
Copy link
Member Author

rwols commented Nov 4, 2020

there's an issue i noticed before (i don't know if it's still there): when you are inside the parameter section of a function and and click "(" (e.g to create a tuple), signatureHelp is invoked.

Yes, there's not much we can do about that. The signature help feature works with trigger characters. Trigger characters are blunt and don't know anything about ST scopes.

@rwols
Copy link
Member Author

rwols commented Nov 4, 2020

Maybe we can add a customization point in AbstractPlugin for this

@rchl
Copy link
Member

rchl commented Nov 6, 2020

That sounds fine to me.

What form would the customization have? A regexp (or a series of)?

@rwols
Copy link
Member Author

rwols commented Dec 4, 2020

Just another selector in the client config would suffice I think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants