Add needsRefresh to lint source config (#13050)

GitOrigin-RevId: bc6880f87bc81c7f0f022268a4d070c267421c46
This commit is contained in:
Alf Eaton 2023-05-16 13:21:10 +01:00 committed by Copybot
parent c8a72e96d4
commit c7544531c1
2 changed files with 4 additions and 14 deletions

View file

@ -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 = () =>

View file

@ -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
// }
// },
// }
// }),
]
}