-
Notifications
You must be signed in to change notification settings - Fork 286
Merged from #465
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
Closed
Closed
Merged from #465
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This also adds an `is_saved` argument to the pyls_lint hookspec, since pylint doesn't expose an API for operating on in-memory contents, only files.
In some situations, pyls can call Document.sys_path _very_ frequently. That method calls jedi.api.environment.get_default_environment(), which can call jedi.api.environment.find_system_pythons(). On systems with pyenv and many python versions installed, this can be expensive, as jedi._compatibilty.which returns a shim path for python major version. Each found version spawns a subprocess to check the specific version of the python found at the path (via creation of a jedi Environment). However, if it's only found the pyenv shim, when a subprocess is spawned, the shim fails to find the version, and pyenv spends significant time looking for the requested command in other installed pythons. Calling .get_cached_default_environment insures jedi goes through the above process no more than once per 10 minutes per instance of pyls. Even on systems without pyenv, calling get_default_environment() directly results in at least one subprocess invocation, and a new jedi Environment object for each invocation. As Document.sys_path can be called as often as once per keypress (depending on the client, though this seems to be the case for lsp-mode) reducing work on that path provides noticeable improvement in performance.
* Fix parent process watcher thread * timer
Information in README is misleading listing `pydocstyle` among providers that will be enabled if found, as according to palantir#312 it is disabled by default. The README is updated to explicitly state that pydocstyle is disabled by default and minimal configuration to enable it is provided.
Thanks for your interest in palantir/python-language-server, @jsenin! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
Closing in favour of #385 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I merged the @DanAlbert branch from #385 to solve conflicts and pass the checks
https://github.com/DanAlbert/python-language-server/commits/pylint-support