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

Erases existing argument when completing function call keyword argument #1032

Closed
kasbah opened this issue Dec 6, 2023 · 1 comment
Closed
Assignees

Comments

@kasbah
Copy link

kasbah commented Dec 6, 2023

What's the output of :CocCommand pyright.version

[coc.nvim] coc-pyright 1.1.336 with Pyright 1.1.336   

What's the output of :CocCommand workspace.showOutput Pyright

Workspace: /tmp
Using python from /usr/bin/python

[Info  - 10:39:32.660] Pyright language server 1.1.338 starting
[Info  - 10:39:32.660] Server root directory: /usr/lib/node_modules/pyright/dist
[Info  - 10:39:32.665] Starting service instance "tmp"
[Info  - 10:39:32.680] Setting pythonPath for service "tmp": "/usr/bin/python"
[Info  - 10:39:32.707] Assuming Python version 3.11
[Info  - 10:39:32.776] Found 1 source file

Description

Say you have:

def example(argument):
    pass

my_arg = 1

example(my_arg)

and you want to change my_arg to argument=my_arg in the example function call.

  • Put your cursor after the first bracket
example(▉my_arg)
  • Type arg and trigger completion

You end up with:

example(argument=)

But you wanted:

example(argument=my_arg)

P.S. Thank you so much for coc-pyright!

@fannheyward
Copy link
Owner

Set "suggest.insertMode": "insert" in your coc-settings.json.

By default, coc.nvim uses replace at accepting completions, check :h coc-config-suggest-insertMode.

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

No branches or pull requests

2 participants