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

feat: add PyrightSetPythonPath command to pyright config #2519

Merged
merged 2 commits into from
Mar 23, 2023

Conversation

ianliu
Copy link
Contributor

@ianliu ianliu commented Mar 21, 2023

The new command accepts a single path for a python executable that will be used to reconfigure the pyright language server. This is useful to change which python will be used by pyright without having to activate the python environment beforehand. The act of finding which python executable to use isn't handled here.

@github-actions
Copy link
Contributor

Do not change server_configurations.md directly. Edit the lua source file instead. See https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#generating-docs

The new command accepts a single path for a python executable that will
be used to reconfigure the pyright language server. This is useful to
change which python will be used by pyright without having to activate
the python environment beforehand. The act of finding which python
executable to use isn't handled here.
@ianliu ianliu changed the title Add PyrightSetPythonPath command in pyright config feat: add PyrightSetPythonPath command to pyright config Mar 21, 2023
@glepnir
Copy link
Member

glepnir commented Mar 22, 2023

please don't edit the doc. it auto generate from lua file.

@ianliu
Copy link
Contributor Author

ianliu commented Mar 22, 2023

@glepnir I did a force push to revert doc changes

@glepnir glepnir merged commit b7a1a1f into neovim:master Mar 23, 2023
@justinmk
Copy link
Member

See discussion in #1937

I'm thinking we might want some sort of "sub-command" entrypoint so that langserver-specific commands can be discovered. E.g. :Lsp <tab> would complete all available commands provided. And :LspCapabilties <tab> would show... something.

@ianliu
Copy link
Contributor Author

ianliu commented Mar 23, 2023

@justinmk maybe this could be done in this function:

function M.create_module_commands(module_name, commands)
for command_name, def in pairs(commands) do
local opts = M._parse_user_command_options(def)
api.nvim_create_user_command(command_name, function(info)
require('lspconfig')[module_name].commands[command_name][1](unpack(info.fargs))
end, opts)
end
end
and keep the declarative definitions of commands intact.

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.

3 participants