##// END OF EJS Templates
Make completer recognize escaped quotes in strings.
Jez Ng -
Show More
@@ -692,10 +692,10 b' class IPCompleter(Completer):'
692 692 try: regexp = self.__funcParamsRegex
693 693 except AttributeError:
694 694 regexp = self.__funcParamsRegex = re.compile(r'''
695 '.*?' | # single quoted strings or
696 ".*?" | # double quoted strings or
697 \w+ | # identifier
698 \S # other characters
695 '.*?(?<!\\)' | # single quoted strings or
696 ".*?(?<!\\)" | # double quoted strings or
697 \w+ | # identifier
698 \S # other characters
699 699 ''', re.VERBOSE | re.DOTALL)
700 700 # 1. find the nearest identifier that comes before an unclosed
701 701 # parenthesis before the cursor
@@ -290,6 +290,8 b' def test_func_kw_completions():'
290 290 # Simulate completing with cursor right after b (pos==10):
291 291 s, matches = c.complete(None,'myfunc(1,b)', 10)
292 292 nt.assert_in('b=', matches)
293 s, matches = c.complete(None,'myfunc(a="escaped\\")string",b')
294 nt.assert_in('b=', matches)
293 295
294 296
295 297 def test_line_magics():
General Comments 0
You need to be logged in to leave comments. Login now