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

Add placeholders to callable completions #221

Closed
erictraut opened this issue Aug 9, 2020 · 2 comments
Closed

Add placeholders to callable completions #221

erictraut opened this issue Aug 9, 2020 · 2 comments
Labels
enhancement New feature or request needs decision Do we want this enhancement?

Comments

@erictraut
Copy link
Contributor

erictraut commented Aug 9, 2020

I'm moving this feature request from pyright to pylance. It was originally submitted by @leungbk here microsoft/pyright#924.

It would be nice if snippets were given in completions. For example, with the insertion point at [-] in

def factorial(n: int) -> int:
    return 1 if n == 0 else n * fa[-]

one of the completions could be, using snippet syntax,

factorial${1:(${2:n: int})}

Type-inferencing could be useful here to let us automatically drop the outer pair of braces depending on context.

@github-actions github-actions bot added the triage label Aug 9, 2020
@jakebailey
Copy link
Member

jakebailey commented Aug 10, 2020

This is technically #37 + placeholders for parameters. We've committed to the former, but the latter has a pretty poor UX in VS Code, IMO. Other LSs either don't implement placeholders at all, or at least make it toggleable.

@savannahostrowski savannahostrowski added enhancement New feature or request needs decision Do we want this enhancement? and removed triage labels Aug 10, 2020
@jakebailey jakebailey changed the title Snippet support in completions Add placeholders to callable completions Aug 10, 2020
@savannahostrowski
Copy link
Contributor

This issue has been open for nearly a year and has not received enough upvotes to prioritize the work. Will reopen if we see this becoming a theme in user issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs decision Do we want this enhancement?
Projects
None yet
Development

No branches or pull requests

3 participants