-
Description
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This seems to be a limitation of pyright, see emacs-lsp/lsp-pyright#32, for example. One could try a hack like this, but it will probably not do the right thing in all cases: (defun fn/pyright-completion-maybe-insert-parens (completion)
(when (and
(stringp completion)
(memq (plist-get
(get-text-property 0 'lsp-completion-item completion)
:kind)
'(2 3)))
(insert "()")
(backward-char)))
(when (eq python-lsp-server 'pyright)
(add-hook 'python-mode-hook
(lambda ()
(add-hook 'company-after-completion-hook
'fn/pyright-completion-maybe-insert-parens nil t))))
This does sound strange. Unfortunately, I cannot reproduce it. |
Beta Was this translation helpful? Give feedback.
-
Fair enough, chief. However, thanks for looking into it. |
Beta Was this translation helpful? Give feedback.
This seems to be a limitation of pyright, see emacs-lsp/lsp-pyright#32, for example.
One could try a hack like this, but it will probably not do the right thing in all cases: