@@ -133,6 +133,7 @@ def __init__(self, uri, workspace, source=None, version=None, local=True, extra_
133
133
134
134
jedi .settings .cache_directory = '.cache/jedi/'
135
135
jedi .settings .use_filesystem_cache = True
136
+ jedi .settings .auto_import_modules = ['numpy' , 'pandas' , 'scipy' , 'matplotlib' , 'scikit-learn' , 'requests' ]
136
137
137
138
def __str__ (self ):
138
139
return str (self .uri )
@@ -237,19 +238,21 @@ def jedi_script(self, position=None):
237
238
environment = self .get_enviroment (environment_path ) if environment_path else None
238
239
sys_path = self .sys_path (environment_path ) + extra_paths
239
240
project_path = self ._workspace .root_path
241
+ import __main__
240
242
241
243
kwargs = {
242
244
'code' : self .source ,
243
- 'path' : self .path ,
244
- 'environment' : environment ,
245
- 'project' : jedi .Project (path = project_path , sys_path = sys_path ),
245
+ #'path': self.path,
246
+ #'environment': environment,
247
+ #'project': jedi.Project(path=project_path, sys_path=sys_path),
248
+ 'namespaces' : [__main__ .__dict__ ],
246
249
}
247
250
248
251
if position :
249
252
# Deprecated by Jedi to use in Script() constructor
250
253
kwargs += _utils .position_to_jedi_linecolumn (self , position )
251
254
252
- return jedi .Script (** kwargs )
255
+ return jedi .Interpreter (** kwargs )
253
256
254
257
def get_enviroment (self , environment_path = None ):
255
258
# TODO(gatesn): #339 - make better use of jedi environments, they seem pretty powerful
0 commit comments