Skip to content

Commit 18aa835

Browse files
committed
Future proof location separator
1 parent f400090 commit 18aa835

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

server/src/server.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,11 @@ FAILED: src/test.cmj src/test.cmi
175175
let ret: { [key: string]: t.Diagnostic[] } = {}
176176
res.forEach(diagnosisLines => {
177177
let [fileAndLocation, ...diagnosisMessage] = diagnosisLines
178-
let lastSpace = fileAndLocation.lastIndexOf(' ')
179-
let file = fileAndLocation.substring(2, lastSpace)
180-
let location = fileAndLocation.substring(lastSpace)
178+
let locationSeparatorV840 = fileAndLocation.lastIndexOf(':')
179+
let locationSeparatorV830 = fileAndLocation.lastIndexOf(' ')
180+
let locationSeparator = locationSeparatorV830 >= 0 ? locationSeparatorV840 : locationSeparatorV830
181+
let file = fileAndLocation.substring(2, locationSeparator)
182+
let location = fileAndLocation.substring(locationSeparator)
181183
if (ret[file] == null) {
182184
ret[file] = []
183185
}

0 commit comments

Comments
 (0)