File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,12 @@ class AutocompleteHandler
3939 action = (s ) =>
4040 split = s .split / \r\n | \r | \n /
4141 if (split .length > 1 )
42- obj = JSON .parse split[1 ]
43- if (obj .Kind == " errors" )
44- atom .emit " FSharp.Atom:Highlight" , obj .Data
42+ try
43+ obj = JSON .parse split[1 ]
44+ if (obj .Kind == " errors" )
45+ atom .emit " FSharp.Atom:Highlight" , obj .Data
46+ catch error
47+ console .log (error)
4548 callback s
4649
4750 @ parse (path,text, action)
Original file line number Diff line number Diff line change @@ -14,14 +14,18 @@ module.exports =
1414 msplit = s .split (" \n " )
1515 if msplit .length > 1
1616 msg = msplit[1 ]
17- obj = JSON .parse (msg)
18- prefix = options .prefix
19- if (prefix == ' .' or prefix == ' =' )
20- prefix = ' '
21- if obj .Kind == " completion"
22- result = ({text : item, replacementPrefix : prefix } for item in obj .Data when item .contains (prefix))
23- resolve (result)
24- else
17+ try
18+ obj = JSON .parse (msg)
19+ prefix = options .prefix
20+ if (prefix == ' .' or prefix == ' =' )
21+ prefix = ' '
22+ if obj .Kind == " completion"
23+ result = ({text : item, replacementPrefix : prefix } for item in obj .Data when item .contains (prefix))
24+ resolve (result)
25+ else
26+ resolve ([])
27+ catch error
28+ console .log (error)
2529 resolve ([])
2630 else
2731 resolve ([])
You can’t perform that action at this time.
0 commit comments