mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[cm6] Wrap compile log annotations in a lint source (#8451)
GitOrigin-RevId: d404560313cbb99c7a06453bc3b7d2374e86598a
This commit is contained in:
parent
a450a74351
commit
bd64a167f4
4 changed files with 4 additions and 3 deletions
|
@ -37,5 +37,5 @@ export default function useCompileTriggers() {
|
||||||
showPdfDetach ? setOrTriggerChangedAt(Date.now()) : setChangedAt(Date.now())
|
showPdfDetach ? setOrTriggerChangedAt(Date.now()) : setChangedAt(Date.now())
|
||||||
}, [setOrTriggerChangedAt, setChangedAt])
|
}, [setOrTriggerChangedAt, setChangedAt])
|
||||||
useEventListener('doc:changed', setChangedAtHandler)
|
useEventListener('doc:changed', setChangedAtHandler)
|
||||||
useEventListener('doc:saved', setChangedAtHandler)
|
useEventListener('doc:saved', setChangedAtHandler) // TODO: store this separately?
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ export default class DocumentCompiler {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// reset values
|
// reset values
|
||||||
this.setChangedAt(0)
|
this.setChangedAt(0) // TODO: wait for doc:saved?
|
||||||
this.validationIssues = undefined
|
this.validationIssues = undefined
|
||||||
|
|
||||||
window.dispatchEvent(new CustomEvent('flush-changes')) // TODO: wait for this?
|
window.dispatchEvent(new CustomEvent('flush-changes')) // TODO: wait for this?
|
||||||
|
|
|
@ -143,7 +143,7 @@ export function buildLogEntryAnnotations(entries, fileTreeManager) {
|
||||||
row: entry.line - 1,
|
row: entry.line - 1,
|
||||||
type: entry.level === 'error' ? 'error' : 'warning',
|
type: entry.level === 'error' ? 'error' : 'warning',
|
||||||
text: entry.message,
|
text: entry.message,
|
||||||
source: 'compile',
|
source: 'compile', // NOTE: this is used in Ace for filtering the annotations
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,5 @@ export type Annotation = {
|
||||||
row: number
|
row: number
|
||||||
type: 'info' | 'warning' | 'error'
|
type: 'info' | 'warning' | 'error'
|
||||||
text: string
|
text: string
|
||||||
|
source?: string
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue