Fix to show backtraces of errors in other files
This commit is contained in:
@ -372,7 +372,6 @@ export function kclErrorsToDiagnostics(
|
|||||||
): CodeMirrorDiagnostic[] {
|
): CodeMirrorDiagnostic[] {
|
||||||
let nonFatal: CodeMirrorDiagnostic[] = []
|
let nonFatal: CodeMirrorDiagnostic[] = []
|
||||||
const errs = errors
|
const errs = errors
|
||||||
?.filter((err) => isTopLevelModule(err.sourceRange))
|
|
||||||
.flatMap((err) => {
|
.flatMap((err) => {
|
||||||
const diagnostics: CodeMirrorDiagnostic[] = []
|
const diagnostics: CodeMirrorDiagnostic[] = []
|
||||||
let message = err.msg
|
let message = err.msg
|
||||||
@ -410,12 +409,14 @@ export function kclErrorsToDiagnostics(
|
|||||||
compilationErrorsToDiagnostics(err.nonFatal, sourceCode)
|
compilationErrorsToDiagnostics(err.nonFatal, sourceCode)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
diagnostics.push({
|
if (isTopLevelModule(err.sourceRange)) {
|
||||||
from: toUtf16(err.sourceRange[0], sourceCode),
|
diagnostics.push({
|
||||||
to: toUtf16(err.sourceRange[1], sourceCode),
|
from: toUtf16(err.sourceRange[0], sourceCode),
|
||||||
message,
|
to: toUtf16(err.sourceRange[1], sourceCode),
|
||||||
severity: 'error',
|
message,
|
||||||
})
|
severity: 'error',
|
||||||
|
})
|
||||||
|
}
|
||||||
return diagnostics
|
return diagnostics
|
||||||
})
|
})
|
||||||
return errs.concat(nonFatal)
|
return errs.concat(nonFatal)
|
||||||
|
|||||||
Reference in New Issue
Block a user