Turn off snippets for jedi LSP
See original GitHub issueEnvironment data
- VS Code version: 1.55.0
- Extension version (available under the Extensions sidebar): 2021.3.680753044
- OS and version: Ubuntu 20.04 LTS
- Python version: 3.7, deadsnakes
- Type of virtual environment used: virtualenv
- Value of the
python.languageServer
setting: JediLSP
Expected behaviour
class Thing: pass
Th<tab> # should complete to:
Thing| # cursor after completed word
Actual behaviour
class Thing: pass
Th<tab> # should complete to:
Thing(|) # cursor between completed parens
As far as I can tell this is specific to the JediLSP integration – changing my language server to Jedi results in the expected completion.
I can maybe see why this is maybe useful if you’re planning to construct an instance or calling a function, though there are many other places where callable symbols are used in which you don’t want this to happen – passing them as callbacks and type annotations for example.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:12 (6 by maintainers)
Top Results From Across the Web
emacs-lsp/lsp-mode - Gitter
As shown in the configuration I've turned off the snippet both in lsp-mode and company-lsp, but function arguments placeholders still occur in completions....
Read more >What are LSP snippets and should I disable them if I use a ...
I kinda wanna disable the LSP snippets because of this, does anyone know if that's possible with nvim-compe? Or is there a good...
Read more >Completion - LSP Mode - LSP support for Emacs
Enable/disable snippet completion support. Last update: December 16, 2022.
Read more >Neovim + LanguageServer.jl - Tooling - Julia Discourse
neovim has built in lsp support and can be integrated with any language ... colortheme and so on " disable dracula italics because...
Read more >coc-jedi - Vim Awesome
If your language client supports CompletionItem snippets but you don't like them, disable them by setting this option to true . type: boolean;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks like Jedi has this behavior disabled by default, which makes sense: it’s guaranteed to be wrong at least some of the time, in practice pretty often, and it can’t be worked around with muscle memory because its correctness depends on the context. Inconsistent unwanted behavior is the worst UX.
When bracket completion is off, completions are always correct but sometimes less convenient than possible. In all those cases you already know you’re typing a call, so typing
(
completes to(|)
and gets you most of the convenience back. Never adding brackets never makes you think; always adding brackets always does.If customizing Jedi settings isn’t on the table, I vote to turn this feature off.
Hey @br3ndonland! Thanks for being up to contributing 😊 I want to talk to the team about this a bit more as we don’t have any jedi specific settings anymore, and the
python.analysis.completeFunctionParens
one is defined in Pylance’s side, not the Python extension. But a lot of folks are out on vacation until the new year, so this may take some time 😓 as soon as everyone’s back I will talk to them and get back to you, though!