mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
just for safety
This commit is contained in:
@@ -195,6 +195,8 @@ def follow_statement(stmt, scope=None):
|
|||||||
if not isinstance(tok, str):
|
if not isinstance(tok, str):
|
||||||
# the string tokens are just operations (+, -, etc.)
|
# the string tokens are just operations (+, -, etc.)
|
||||||
result += follow_call(scope, tok)
|
result += follow_call(scope, tok)
|
||||||
|
else:
|
||||||
|
debug.warning('dini mueter, found string:', tok)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ class FileWithCursor(modules.File):
|
|||||||
whitespace = [' ', '\n', '\r', '\\']
|
whitespace = [' ', '\n', '\r', '\\']
|
||||||
open_brackets = ['(', '[', '{']
|
open_brackets = ['(', '[', '{']
|
||||||
close_brackets = [')', ']', '}']
|
close_brackets = [')', ']', '}']
|
||||||
|
strings = ['"', '"""', "'", "'''"]
|
||||||
is_word = lambda char: re.search('\w', char)
|
is_word = lambda char: re.search('\w', char)
|
||||||
name = ''
|
name = ''
|
||||||
force_point = False
|
force_point = False
|
||||||
@@ -172,7 +173,6 @@ def complete(source, row, column, file_callback=None):
|
|||||||
debug.dbg(' ' * 62 + 'complete')
|
debug.dbg(' ' * 62 + 'complete')
|
||||||
debug.dbg('-' * 70)
|
debug.dbg('-' * 70)
|
||||||
debug.dbg('complete_scope', scope)
|
debug.dbg('complete_scope', scope)
|
||||||
debug.dbg('user_scope', f.parser.user_scope.get_simple_for_line(row))
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
path = f.get_row_path(column)
|
path = f.get_row_path(column)
|
||||||
@@ -181,7 +181,6 @@ def complete(source, row, column, file_callback=None):
|
|||||||
debug.dbg(e)
|
debug.dbg(e)
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
print path
|
|
||||||
if path and path[0]:
|
if path and path[0]:
|
||||||
# just parse one statement
|
# just parse one statement
|
||||||
r = parsing.PyFuzzyParser(".".join(path))
|
r = parsing.PyFuzzyParser(".".join(path))
|
||||||
|
|||||||
@@ -221,14 +221,6 @@ class Scope(Simple):
|
|||||||
"""
|
"""
|
||||||
return not (self.imports or self.subscopes or self.statements)
|
return not (self.imports or self.subscopes or self.statements)
|
||||||
|
|
||||||
def get_simple_for_line(self, line):
|
|
||||||
""" Get the Simple objects, which are on the line. """
|
|
||||||
simple = []
|
|
||||||
for s in self.statements + self.imports:
|
|
||||||
if s.line_nr <= line <= s.line_end:
|
|
||||||
simple.append(s)
|
|
||||||
return simple
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
try:
|
try:
|
||||||
name = self.name
|
name = self.name
|
||||||
|
|||||||
Reference in New Issue
Block a user