Commit f95765bf authored by Jérome Perrin's avatar Jérome Perrin

theia: patch python extension for jedi buildout bug

parent e1e47684
...@@ -71,7 +71,17 @@ install = ...@@ -71,7 +71,17 @@ install =
extract_dir = self.extract(self.download(url, md5sum)) extract_dir = self.extract(self.download(url, md5sum))
destination_dir = os.path.join(options['location'], extension_name) destination_dir = os.path.join(options['location'], extension_name)
self.copyTree(guessworkdir(extract_dir), destination_dir) self.copyTree(guessworkdir(extract_dir), destination_dir)
patches = options.get(extension_name + '-patches')
if patches:
self.applyPatchList(
patches,
patch_options=options.get(extension_name + '-patch-options', '-p1'),
patch_binary=options['patch-binary'],
cwd=destination_dir,
)
os.chmod(destination_dir, 0o750) os.chmod(destination_dir, 0o750)
patch-binary = ${patch:location}/bin/patch
ms-python-python-patches = ${:_profile_base_location_}/${ms-python-disable-jedi-buildout.patch:_update_hash_filename_} ${ms-python-disable-jedi-buildout.patch:md5sum}
[package.json] [package.json]
content = content =
......
...@@ -20,3 +20,7 @@ md5sum = 8157c22134200bd862a07c6521ebf799 ...@@ -20,3 +20,7 @@ md5sum = 8157c22134200bd862a07c6521ebf799
[yarn.lock] [yarn.lock]
_update_hash_filename_ = yarn.lock _update_hash_filename_ = yarn.lock
md5sum = b1012625be07ad6a3daf27b9ed6004f0 md5sum = b1012625be07ad6a3daf27b9ed6004f0
[ms-python-disable-jedi-buildout.patch]
_update_hash_filename_ = ms-python-disable-jedi-buildout.patch
md5sum = 0ec840ffecceaf7e91a037d439962415
jedi: Disable discover_buildout_paths
This slows down jedi a lot and can make it crash on some scripts.
See also https://github.com/davidhalter/jedi/issues/1325
---
extension/pythonFiles/lib/python/jedi/inference/sys_path.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/extension/pythonFiles/lib/python/jedi/inference/sys_path.py b/extension/pythonFiles/lib/python/jedi/inference/sys_path.py
index 5b82ec1..256b19c 100644
--- a/extension/pythonFiles/lib/python/jedi/inference/sys_path.py
+++ b/extension/pythonFiles/lib/python/jedi/inference/sys_path.py
@@ -137,6 +137,7 @@ def check_sys_path_modifications(module_context):
def discover_buildout_paths(inference_state, script_path):
buildout_script_paths = set()
+ return buildout_script_paths
for buildout_script_path in _get_buildout_script_paths(script_path):
for path in _get_paths_from_buildout_script(inference_state, buildout_script_path):
# Theia software release # Theia software release
Theia is a cloud (and desktop) IDE https://www.theia-ide.org Theia is a cloud (and desktop) IDE https://www.theia-ide.org
This version comes pre-configured with a few plugins, but does not come with python plugin, to let
you choose between theia and vscode one.
## jedi
[jedi](https://github.com/davidhalter/jedi) which is used by both thiea and vscode python plugins has
some support for `zc.buildout`. It looks up for a `buildout.cfg` file and if found will load all scripts
from the bin directory from this buildout to add eggs to sys.path. In webrunner we have almost 100 scripts
in bin directory, with maybe 30 eggs in each scripts, so this makes jedi so slow it's unusable. Also, if
an error occurs parsing these scripts, jedi won't be usable. This issue is tracked in
https://github.com/davidhalter/jedi/issues/1325
A simple workaround is to create and empty `buildout.cfg` file at the root of project folder.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment