File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ def current_word(cursor_offset: int, line: str) -> Optional[LinePart]:
34
34
return LinePart (start , end , word )
35
35
36
36
37
- _current_dict_key_re = LazyReCompile (r"""[\w_][\w0-9._]*\[(.*)""" )
37
+ _current_dict_key_re = LazyReCompile (
38
+ r"""[\w_][\w0-9._]*\[('[^']*|"[^"]*|[\w0-9._(), '"]*)"""
39
+ )
38
40
39
41
40
42
def current_dict_key (cursor_offset : int , line : str ) -> Optional [LinePart ]:
@@ -45,7 +47,9 @@ def current_dict_key(cursor_offset: int, line: str) -> Optional[LinePart]:
45
47
return None
46
48
47
49
48
- _current_dict_re = LazyReCompile (r"""([\w_][\w0-9._]*)\[(.*)""" )
50
+ _current_dict_re = LazyReCompile (
51
+ r"""([\w_][\w0-9._]*)\[('[^']*|"[^"]*|[\w0-9._(), '"]*)"""
52
+ )
49
53
50
54
51
55
def current_dict (cursor_offset : int , line : str ) -> Optional [LinePart ]:
You can’t perform that action at this time.
0 commit comments