emacs-lsp / lsp-pyright

lsp-mode :heart: pyright
https://emacs-lsp.github.io/lsp-pyright
GNU General Public License v3.0
284 stars 24 forks source link

Request: Support for `python-ts-mode` #81

Closed Walheimat closed 1 year ago

Walheimat commented 1 year ago

I noticed this package sets :major-modes (python-mode) when registering the client. This prevents it from being an option when you're using python-ts-mode (the new tree-sitter-enabled alternative mode in Emacs 29).

I currently just do the following but it's clunky:

(let ((struct (gethash 'pyright lsp-clients)))
    (setf (cl-struct-slot-value 'lsp--client 'major-modes struct) '(python-mode python-ts-mode)))

A better way could be using :activation-fn (lsp-activate-on "python") instead, but I haven't tried that yet.

Walheimat commented 1 year ago

Never mind, you already added the other solution.