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

Add configuration for basedpyright #106

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

ROCKTAKEY
Copy link
Contributor

Hello, thanks for your maintenance.
Some configuration variables are added to basedpyright, so I added them.

https://docs.basedpyright.com/latest/configuration/language-server-settings/

Thanks!

@seagle0128 seagle0128 merged commit cefab98 into emacs-lsp:master Nov 1, 2024
11 checks passed
@@ -228,6 +256,10 @@ Current LSP WORKSPACE should be passed in."
(,(concat lsp-pyright-langserver-command ".disableOrganizeImports") lsp-pyright-disable-organize-imports t)
(,(concat lsp-pyright-langserver-command ".disableTaggedHints") lsp-pyright-disable-tagged-hints t)
(,(concat lsp-pyright-langserver-command ".typeCheckingMode") lsp-pyright-type-checking-mode)
("basedpyright.analysis.inlayHints.variableTypes" lsp-pyright-basedpyright-inlay-hints-variable-types t)
Copy link
Contributor

@wyuenho wyuenho Nov 1, 2024

Choose a reason for hiding this comment

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

@ROCKTAKEY

Does Pyright ignore settings it doesn't recognize? Have you tested this with Pyright? If this works, does Pyright make any guarantees it'll always ignore settings it doesn't recognize?

Copy link
Contributor Author

@ROCKTAKEY ROCKTAKEY Nov 1, 2024

Choose a reason for hiding this comment

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

@wyuenho

As you can see the S expression, lsp-register-custom-settings does NOT associate settings with lsp-client.

In order to get configuration, each client executable server executable sends workspace/configuration request. lsp-mode send the configuration ONLY if pyright send request to get basedpyright.*

In the other word, if pyright executable should require even java section, lsp-mode pass the setting for lsp-java to pyright.

If we need the proof that this configuration does not affect pyright, we should see all lsp-client in lsp-mode, since all lsp-register-custom-settings expressions can affect pyright.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In conclusion, as long as pyright do not send request to get basedpyright.*, lsp-mode never send this configuration.

Copy link
Contributor

@wyuenho wyuenho Nov 1, 2024

Choose a reason for hiding this comment

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

Thanks for the clarification, just to aid my understanding, it's actually the server that sends the workspace/configuration request, not the client right? This seems to be what the latest version of the protocol requires. The server requests a section, and then the client finds that section and then respond, is this right?

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I was confused. You are right. The server sends workspace/configuraiton request.

@ROCKTAKEY ROCKTAKEY deleted the basedpyright-only-variable branch November 1, 2024 06:42
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.

4 participants