forked from VimPlug/jedi
Move create_context to a context
This commit is contained in:
@@ -242,7 +242,7 @@ class Script(object):
|
||||
if leaf is None:
|
||||
return []
|
||||
|
||||
context = self._inference_state.create_context(self._get_module_context(), leaf)
|
||||
context = self._get_module_context().create_context(leaf)
|
||||
|
||||
values = helpers.infer_goto_definition(self._inference_state, context, leaf)
|
||||
values = convert_values(
|
||||
@@ -302,7 +302,7 @@ class Script(object):
|
||||
# Without a name we really just want to jump to the result e.g.
|
||||
# executed by `foo()`, if we the cursor is after `)`.
|
||||
return self.goto_definitions(only_stubs=only_stubs, prefer_stubs=prefer_stubs)
|
||||
context = self._inference_state.create_context(self._get_module_context(), tree_name)
|
||||
context = self._get_module_context().create_context(tree_name)
|
||||
names = list(self._inference_state.goto(context, tree_name))
|
||||
|
||||
if follow_imports:
|
||||
@@ -371,10 +371,7 @@ class Script(object):
|
||||
if call_details is None:
|
||||
return []
|
||||
|
||||
context = self._inference_state.create_context(
|
||||
self._get_module_context(),
|
||||
call_details.bracket_leaf
|
||||
)
|
||||
context = self._get_module_context().create_context(call_details.bracket_leaf)
|
||||
definitions = helpers.cache_call_signatures(
|
||||
self._inference_state,
|
||||
context,
|
||||
|
||||
@@ -254,9 +254,7 @@ class Completion:
|
||||
|
||||
def _trailer_completions(self, previous_leaf):
|
||||
user_value = get_user_context(self._module_context, self._position)
|
||||
inferred_context = self._inference_state.create_context(
|
||||
self._module_context, previous_leaf
|
||||
)
|
||||
inferred_context = self._module_context.create_context(previous_leaf)
|
||||
values = infer_call_of_leaf(inferred_context, previous_leaf)
|
||||
completion_names = []
|
||||
debug.dbg('trailer completion values: %s', values, color='MAGENTA')
|
||||
|
||||
Reference in New Issue
Block a user