mirror of
https://github.com/davidhalter/jedi.git
synced 2026-08-18 06:07:59 +08:00
removed a lot of old sith.py code, that is not needed anymore, because almost everything is now a Definition (except Completions).
This commit is contained in:
@@ -150,29 +150,16 @@ class TestCase(object):
|
|||||||
|
|
||||||
def show_operation(self):
|
def show_operation(self):
|
||||||
print("%s:\n" % self.operation.capitalize())
|
print("%s:\n" % self.operation.capitalize())
|
||||||
getattr(self, 'show_' + self.operation)()
|
if self.operation == 'completions':
|
||||||
|
self.show_completions()
|
||||||
|
else:
|
||||||
|
self.show_definitions()
|
||||||
|
|
||||||
def show_completions(self):
|
def show_completions(self):
|
||||||
for completion in self.objects:
|
for completion in self.objects:
|
||||||
print(completion.name)
|
print(completion.name)
|
||||||
|
|
||||||
# TODO: Support showing the location in other files
|
def show_definitions(self):
|
||||||
|
|
||||||
# TODO: Move this printing to the completion objects themselves
|
|
||||||
def show_usages(self):
|
|
||||||
for completion in self.objects:
|
|
||||||
print(completion.description)
|
|
||||||
if os.path.abspath(completion.module_path) == os.path.abspath(self.path):
|
|
||||||
self.show_location(completion.line, completion.column)
|
|
||||||
|
|
||||||
def show_call_signatures(self):
|
|
||||||
for completion in self.objects:
|
|
||||||
# This is too complicated to print. It really should be
|
|
||||||
# implemented in str() anyway.
|
|
||||||
print(completion)
|
|
||||||
# Can't print the location here because we don't have the module path
|
|
||||||
|
|
||||||
def show_goto_definitions(self):
|
|
||||||
for completion in self.objects:
|
for completion in self.objects:
|
||||||
print(completion.desc_with_module)
|
print(completion.desc_with_module)
|
||||||
if completion.module_path is None:
|
if completion.module_path is None:
|
||||||
@@ -180,8 +167,6 @@ class TestCase(object):
|
|||||||
if os.path.abspath(completion.module_path) == os.path.abspath(self.path):
|
if os.path.abspath(completion.module_path) == os.path.abspath(self.path):
|
||||||
self.show_location(completion.line, completion.column)
|
self.show_location(completion.line, completion.column)
|
||||||
|
|
||||||
show_goto_assignments = show_goto_definitions
|
|
||||||
|
|
||||||
def show_errors(self):
|
def show_errors(self):
|
||||||
print(self.traceback)
|
print(self.traceback)
|
||||||
print(("Error with running Script(...).{operation}() with\n"
|
print(("Error with running Script(...).{operation}() with\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user