-
Notifications
You must be signed in to change notification settings - Fork 286
Only add snippet completions when positional args are available #734
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
Conversation
|
I think this is ready @ccordoba12 👍 |
| snippet += ', ' | ||
| snippet += ')$0' | ||
| completion['insertText'] = snippet | ||
| if len(positional_args) > 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should insert () and put the cursor in the middle of them, in case positional_args == 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For positional_args == 0 we need to put the cursor to the right of ()
ccordoba12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dalthviz!
Prevents the creation of snippets completions with none or single arguments like
..()$0or..(${1:args})$0.Prevents the creation of snippets completions for multi-line imports statements like:
Fixes spyder-ide/spyder#11356