forked from VimPlug/jedi
Fix some code_lines issues
This commit is contained in:
@@ -7,7 +7,6 @@ from textwrap import dedent
|
||||
|
||||
from parso.python.parser import Parser
|
||||
from parso.python import tree
|
||||
from parso import split_lines
|
||||
|
||||
from jedi._compatibility import u
|
||||
from jedi.evaluate.syntax_tree import eval_atom
|
||||
@@ -44,7 +43,7 @@ def _get_code(code_lines, start_pos, end_pos):
|
||||
lines[-1] = lines[-1][:end_pos[1]]
|
||||
# Remove first line indentation.
|
||||
lines[0] = lines[0][start_pos[1]:]
|
||||
return '\n'.join(lines)
|
||||
return ''.join(lines)
|
||||
|
||||
|
||||
class OnErrorLeaf(Exception):
|
||||
@@ -283,11 +282,11 @@ def get_call_signature_details(module, position):
|
||||
@time_cache("call_signatures_validity")
|
||||
def cache_call_signatures(evaluator, context, bracket_leaf, code_lines, user_pos):
|
||||
"""This function calculates the cache key."""
|
||||
index = user_pos[0] - 1
|
||||
line_index = user_pos[0] - 1
|
||||
|
||||
before_cursor = code_lines[index][:user_pos[1]]
|
||||
other_lines = code_lines[bracket_leaf.start_pos[0]:index]
|
||||
whole = '\n'.join(other_lines + [before_cursor])
|
||||
before_cursor = code_lines[line_index][:user_pos[1]]
|
||||
other_lines = code_lines[bracket_leaf.start_pos[0]:line_index]
|
||||
whole = ''.join(other_lines + [before_cursor])
|
||||
before_bracket = re.match(r'.*\(', whole, re.DOTALL)
|
||||
|
||||
module_path = context.get_root_context().py__file__()
|
||||
|
||||
Reference in New Issue
Block a user