[cm6] Wrap compile log annotations in a lint source (#8451)

GitOrigin-RevId: d404560313cbb99c7a06453bc3b7d2374e86598a
This commit is contained in:
Alf Eaton 2022-06-21 10:58:56 +01:00 committed by Copybot
parent a450a74351
commit bd64a167f4
4 changed files with 4 additions and 3 deletions

View file

@ -37,5 +37,5 @@ export default function useCompileTriggers() {
showPdfDetach ? setOrTriggerChangedAt(Date.now()) : setChangedAt(Date.now())
}, [setOrTriggerChangedAt, setChangedAt])
useEventListener('doc:changed', setChangedAtHandler)
useEventListener('doc:saved', setChangedAtHandler)
useEventListener('doc:saved', setChangedAtHandler) // TODO: store this separately?
}

View file

@ -75,7 +75,7 @@ export default class DocumentCompiler {
try {
// reset values
this.setChangedAt(0)
this.setChangedAt(0) // TODO: wait for doc:saved?
this.validationIssues = undefined
window.dispatchEvent(new CustomEvent('flush-changes')) // TODO: wait for this?

View file

@ -143,7 +143,7 @@ export function buildLogEntryAnnotations(entries, fileTreeManager) {
row: entry.line - 1,
type: entry.level === 'error' ? 'error' : 'warning',
text: entry.message,
source: 'compile',
source: 'compile', // NOTE: this is used in Ace for filtering the annotations
})
}
}

View file

@ -2,4 +2,5 @@ export type Annotation = {
row: number
type: 'info' | 'warning' | 'error'
text: string
source?: string
}