Skip to content

Commit cdf9ab5

Browse files
mrclaryccordoba12
andcommitted
Apply suggestions from code review
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
1 parent d1aa855 commit cdf9ab5

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

CONFIGURATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This server can be configured using the `workspace/didChangeConfiguration` metho
2020
| `pylsp.plugins.flake8.select` | `array` of unique `string` items | List of errors and warnings to enable. | `null` |
2121
| `pylsp.plugins.jedi.auto_import_modules` | `array` of `string` items | List of module names for jedi.settings.auto_import_modules. | `["numpy"]` |
2222
| `pylsp.plugins.jedi.extra_paths` | `array` of `string` items | Define extra paths for jedi.Script. | `[]` |
23-
| `pylsp.plugins.jedi.prioritize` | `boolean` | Whether to place extra_paths at the beginning (true) or end (false) of `sys.path` | `false` |
23+
| `pylsp.plugins.jedi.prioritize_extra_paths` | `boolean` | Whether to place extra_paths at the beginning (true) or end (false) of `sys.path` | `false` |
2424
| `pylsp.plugins.jedi.env_vars` | `object` | Define environment variables for jedi.Script and Jedi.names. | `null` |
2525
| `pylsp.plugins.jedi.environment` | `string` | Define environment for jedi.Script and Jedi.names. | `null` |
2626
| `pylsp.plugins.jedi_completion.enabled` | `boolean` | Enable or disable the plugin. | `true` |

pylsp/config/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
},
144144
"description": "Define extra paths for jedi.Script."
145145
},
146-
"pylsp.plugins.jedi.prioritize": {
146+
"pylsp.plugins.jedi.prioritize_extra_paths": {
147147
"type": "boolean",
148148
"default": false,
149149
"description": "Whether to place extra_paths at the beginning (true) or end (false) of `sys.path`"

pylsp/workspace.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def jedi_script(self, position=None, use_document_path=False):
507507
extra_paths = []
508508
environment_path = None
509509
env_vars = None
510-
prioritize = False
510+
prioritize_extra_paths = False
511511

512512
if self._config:
513513
jedi_settings = self._config.plugin_settings(
@@ -533,8 +533,7 @@ def jedi_script(self, position=None, use_document_path=False):
533533
env_vars.pop("PYTHONPATH", None)
534534

535535
environment = self.get_enviroment(environment_path, env_vars=env_vars)
536-
537-
sys_path = self.sys_path(environment_path, env_vars, prioritize, extra_paths)
536+
sys_path = self.sys_path(environment_path, env_vars, prioritize_extra_paths, extra_paths)
538537

539538
project_path = self._workspace.root_path
540539

@@ -571,15 +570,15 @@ def get_enviroment(self, environment_path=None, env_vars=None):
571570
return environment
572571

573572
def sys_path(
574-
self, environment_path=None, env_vars=None, prioritize=False, extra_paths=[]
573+
self, environment_path=None, env_vars=None, prioritize_extra_paths=False, extra_paths=[]
575574
):
576575
# Copy our extra sys path
577576
path = list(self._extra_sys_path)
578577
environment = self.get_enviroment(
579578
environment_path=environment_path, env_vars=env_vars
580579
)
581580
path.extend(environment.get_sys_path())
582-
if prioritize:
581+
if prioritize_extra_paths:
583582
path += extra_paths + path
584583
else:
585584
path += path + extra_paths

0 commit comments

Comments
 (0)