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

Do not autocomplete function with parentheses inside import statements #466

Open
eldar opened this issue Aug 9, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@eldar
Copy link

eldar commented Aug 9, 2024

Is your feature request related to a problem? Please describe.
There is a single issue with this excellent plugin that is slightly frustrating, namely inserting parentheses when auto-completing function imports - in my case in Python, but others have reported the same for JavaScript. It is hard for me to imagine a case where the current behavior makes sense, and even if it does it would serve only a small fraction of use cases. I chose to report it as a feature request, however it is more severe than that, because inserting parentheses in the import statement results in the incorrect code.

Describe the solution you'd like
The default behavior is simply not to add parentheses when importing functions, because they cannot be called in that context.

@eldar eldar added the enhancement New feature or request label Aug 9, 2024
@mageowl
Copy link

mageowl commented Aug 24, 2024

Can confirm for Rust as well.

@palvarezcordoba
Copy link

palvarezcordoba commented Sep 29, 2024

I hope this gets fixed (as i consider this a bug not an enhancement).
In the mean time, i configured the integration between cmp and autopairs.
If you’re using cmp too, you can check my config: https://github.com/palvarezcordoba/neovim-config/blob/554fd74f10779fdfb0b715ca3b2ca03974c0b928/lua/plugins/autopairs.lua

If you use another completion engine i guess you would do something similar.

Now however that currently works only on imports that span only 1 line, and it could disable adding parenthesis sometimes because i use a bad crafted regex

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

No branches or pull requests

3 participants