mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Add needsRefresh to lint source config (#13050)
GitOrigin-RevId: bc6880f87bc81c7f0f022268a4d070c267421c46
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { EditorView } from '@codemirror/view'
|
import { EditorView, ViewUpdate } from '@codemirror/view'
|
||||||
import { Diagnostic, linter, lintGutter } from '@codemirror/lint'
|
import { Diagnostic, linter, lintGutter } from '@codemirror/lint'
|
||||||
import {
|
import {
|
||||||
Compartment,
|
Compartment,
|
||||||
@@ -36,6 +36,9 @@ export const lintSourceConfig = {
|
|||||||
tooltipFilter() {
|
tooltipFilter() {
|
||||||
return []
|
return []
|
||||||
},
|
},
|
||||||
|
needsRefresh(update: ViewUpdate) {
|
||||||
|
return update.selectionSet
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const compileLogLintSource = () =>
|
const compileLogLintSource = () =>
|
||||||
|
|||||||
@@ -24,18 +24,5 @@ export const linting = () => {
|
|||||||
|
|
||||||
return null
|
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
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user