Skip to content

Fix minor typo in workspace.py #649

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pylsp/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def jedi_script(self, position=None, use_document_path=False):
env_vars = os.environ.copy()
env_vars.pop("PYTHONPATH", None)

environment = self.get_enviroment(environment_path, env_vars=env_vars)
environment = self.get_environment(environment_path, env_vars=env_vars)
sys_path = self.sys_path(
environment_path, env_vars, prioritize_extra_paths, extra_paths
)
Expand All @@ -572,7 +572,7 @@ def jedi_script(self, position=None, use_document_path=False):

return jedi.Script(**kwargs)

def get_enviroment(self, environment_path=None, env_vars=None):
def get_environment(self, environment_path=None, env_vars=None):
Copy link
Member

Choose a reason for hiding this comment

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

I am nor sure if anyone uses it, but shall we preserve get_enviroment (with typo, but mention it is deprecated in docstring) and make it call get_environment (and return its result) to make sure we are not breaking plugins if any does use it?

Or do we assume this was not meant to be a public API? In that case, should it be renamed to start with underscore?

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @krassowski on this one.

# TODO(gatesn): #339 - make better use of jedi environments, they seem pretty powerful
if environment_path is None:
environment = jedi.api.environment.get_cached_default_environment()
Expand All @@ -596,7 +596,7 @@ def sys_path(
):
# Copy our extra sys path
path = list(self._extra_sys_path)
environment = self.get_enviroment(
environment = self.get_environment(
environment_path=environment_path, env_vars=env_vars
)
path.extend(environment.get_sys_path())
Expand Down