mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add needsRefresh to lint source config (#13050)
GitOrigin-RevId: bc6880f87bc81c7f0f022268a4d070c267421c46
This commit is contained in:
parent
c8a72e96d4
commit
c7544531c1
2 changed files with 4 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
|||
import { EditorView } from '@codemirror/view'
|
||||
import { EditorView, ViewUpdate } from '@codemirror/view'
|
||||
import { Diagnostic, linter, lintGutter } from '@codemirror/lint'
|
||||
import {
|
||||
Compartment,
|
||||
|
@ -36,6 +36,9 @@ export const lintSourceConfig = {
|
|||
tooltipFilter() {
|
||||
return []
|
||||
},
|
||||
needsRefresh(update: ViewUpdate) {
|
||||
return update.selectionSet
|
||||
},
|
||||
}
|
||||
|
||||
const compileLogLintSource = () =>
|
||||
|
|
|
@ -24,18 +24,5 @@ export const linting = () => {
|
|||
|
||||
return null
|
||||
}),
|
||||
|
||||
// TODO: enable this once https://github.com/overleaf/internal/issues/10055 is fixed
|
||||
// ViewPlugin.define(view => {
|
||||
// return {
|
||||
// update(update) {
|
||||
// // force the linter to run if the selection has changed
|
||||
// if (update.selectionSet) {
|
||||
// // note: no timeout needed as this is already asynchronous
|
||||
// forceLinting(view, true) // TODO: true to force run even if doc hasn't changed
|
||||
// }
|
||||
// },
|
||||
// }
|
||||
// }),
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue