mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
Remove old debug code from the diff parser.
This commit is contained in:
@@ -124,28 +124,6 @@ class DiffParser(object):
|
|||||||
self._new_used_names = {}
|
self._new_used_names = {}
|
||||||
self._nodes_stack = _NodesStack(self._module)
|
self._nodes_stack = _NodesStack(self._module)
|
||||||
|
|
||||||
def __update(self, lines_new):
|
|
||||||
"""For now we use this function for better error reporting."""
|
|
||||||
old_source = self._parser.source
|
|
||||||
try:
|
|
||||||
return self._update(lines_new)
|
|
||||||
except Exception:
|
|
||||||
# Only log for linux, it's easier.
|
|
||||||
import sys
|
|
||||||
if 'linux' in sys.platform:
|
|
||||||
lines_old = splitlines(old_source, keepends=True)
|
|
||||||
import traceback
|
|
||||||
with open('/tmp/jedi_error.log', 'w') as f:
|
|
||||||
f.write(
|
|
||||||
'parser issue, please report:\n%s\n%s\n%s' % (
|
|
||||||
repr(''.join(lines_old)),
|
|
||||||
repr(''.join(lines_new)),
|
|
||||||
traceback.format_exc()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
raise Exception("There's a parser issue. Please report /tmp/jedi_error.log")
|
|
||||||
raise
|
|
||||||
|
|
||||||
def update(self, lines_new):
|
def update(self, lines_new):
|
||||||
'''
|
'''
|
||||||
The algorithm works as follows:
|
The algorithm works as follows:
|
||||||
@@ -436,8 +414,6 @@ class _NodesStackNode(object):
|
|||||||
def add(self, children, line_offset=0, last_line_offset_leaf=None):
|
def add(self, children, line_offset=0, last_line_offset_leaf=None):
|
||||||
group = self.ChildrenGroup(children, line_offset, last_line_offset_leaf)
|
group = self.ChildrenGroup(children, line_offset, last_line_offset_leaf)
|
||||||
self.children_groups.append(group)
|
self.children_groups.append(group)
|
||||||
if len(self.children_groups) > 42:
|
|
||||||
raise NotImplementedError
|
|
||||||
|
|
||||||
def get_last_line(self, suffix):
|
def get_last_line(self, suffix):
|
||||||
if not self.children_groups:
|
if not self.children_groups:
|
||||||
|
|||||||
Reference in New Issue
Block a user