mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 15:30:50 -05:00
e025088065
Add documentation for CodeMirror extensions GitOrigin-RevId: e5f07084173f201919272f9d46dcdaef4b817874
15 lines
510 B
TypeScript
15 lines
510 B
TypeScript
import { Extension } from '@codemirror/state'
|
|
import { EditorView } from '@codemirror/view'
|
|
import { captureException } from '../../../infrastructure/error-reporter'
|
|
|
|
/**
|
|
* A custom extension which configures the EditorView.exceptionSink facet
|
|
* so that exceptions are sent to Sentry with a `cm6-exception` tag.
|
|
*/
|
|
export const exceptionLogger = (): Extension => {
|
|
return EditorView.exceptionSink.of(exception => {
|
|
captureException(exception, {
|
|
tags: { handler: 'cm6-exception' },
|
|
})
|
|
})
|
|
}
|