mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Better debugging with the increase_indent_cm
This commit is contained in:
@@ -84,13 +84,17 @@ def increase_indent(func):
|
||||
|
||||
|
||||
@contextmanager
|
||||
def increase_indent_cm():
|
||||
def increase_indent_cm(title=None):
|
||||
global _debug_indent
|
||||
if title:
|
||||
dbg('Start: ' + title, color='MAGENTA')
|
||||
_debug_indent += 1
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
_debug_indent -= 1
|
||||
if title:
|
||||
dbg('End: ' + title, color='MAGENTA')
|
||||
|
||||
|
||||
def dbg(message, *args, **kwargs):
|
||||
|
||||
@@ -238,7 +238,8 @@ class LazyContextWrapper(_ContextWrapperBase):
|
||||
@safe_property
|
||||
@memoize_method
|
||||
def _wrapped_context(self):
|
||||
return self._get_wrapped_context()
|
||||
with debug.increase_indent_cm('Resolve lazy context wrapper'):
|
||||
return self._get_wrapped_context()
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s>' % (self.__class__.__name__)
|
||||
|
||||
Reference in New Issue
Block a user