Skip to content

Commit eaea9ba

Browse files
committed
handle parsing errors a little more consistently without feeding them through the xml parser
1 parent 56c712a commit eaea9ba

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

haxe_parse_completion_list.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
import sublime, sublime_plugin
33
import xml.etree.ElementTree as ET
44

5-
def haxe_has_error(_list):
5+
def haxe_has_error(_input):
66

7-
try:
8-
9-
root = ET.fromstring(str(_list))
7+
if not _input:
108
return False
11-
12-
except ET.ParseError as e:
13-
14-
return _list.splitlines()
9+
10+
if _input[0] != '<':
11+
_res = []
12+
for _line in _input.splitlines():
13+
_res.append(sanitize(_line.strip()))
14+
15+
return _res
16+
17+
return False
1518

1619
def haxe_has_args(_list):
1720

0 commit comments

Comments
 (0)