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

Adds support for the basedpyright pyright fork #101

Merged
merged 16 commits into from
Aug 26, 2024

Conversation

zipy124
Copy link
Contributor

@zipy124 zipy124 commented Aug 25, 2024

This PR addresses issue: #92

All commands that use "pyright/" are now instead created via concatenating the fork with the command. This can be customised with the lsp-pyright-fork customizable option.

use of "backquote" command instead of " ' " is because of an emacs-lisp bug please see: https://stackoverflow.com/questions/17394638/nesting-backquote-and-in-emacs-lisp and https://mail.gnu.org/archive/html/bug-gnu-emacs/2023-02/msg00617.html

All suggestions welcome, this is my first time contributing emacs-lisp code so I am not well versed with the standard practices :)

Copy link
Collaborator

@seagle0128 seagle0128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks good, except lsp-pyright-fork option. I am afraid it's confusing.
And, are all options and arguments of pyright and basedpyright just same?

lsp-pyright.el Show resolved Hide resolved
@seagle0128 seagle0128 merged commit 4f35bac into emacs-lsp:master Aug 26, 2024
10 of 11 checks passed
@seagle0128
Copy link
Collaborator

seagle0128 commented Aug 26, 2024

I merged and changed lsp-pyright-fork to lsp-pyright-langserver-command. Thanks!

@zipy124
Copy link
Contributor Author

zipy124 commented Aug 28, 2024

I merged and change lsp-pyright-fork to lsp-pyright-langserver-command. Thanks!

Thank you for the quick review, changes and merge!

Overall it looks good, except lsp-pyright-fork option. I am afraid it's confusing. And, are all options and arguments of pyright and basedpyright just same?

Of the options provided by this module they are all the same (I think). I have unfortunately run into the fact that the options are not all the same for the full list, for example:

python.analysis.typeCheckingMode vs basedpyright.analysis.typeCheckingMode

and further confusing matters:

basedpyright.analysis.useLibraryCodeForTypes vs python.analysis.useLibraryCodeForTypes or pyright.useLibraryCodeForTypes .

I'm unsure what the best option is here between the available options:

  • Contribute to basedpyright to standardise the interface (since using the python.* namespace is prefferred when possible)
  • Have a map from *.setting to <module_prefix>. (easy, but is an ugly solution perhaps)
  • Discover a list of settings for the module and match on regex *. (we can utilise the workspace/configuration request and respond appropriately but this seems quite a lot of work)
  • leave it to pyrightconfig.json (easiest and perhaps the best?)

@seagle0128
Copy link
Collaborator

Well, it's better keep the common configurations and leave the rest to the json file, IMO.

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

Successfully merging this pull request may close these issues.

2 participants