import { syntaxTree } from '@codemirror/language' ; import { RangeSetBuilder } from '@codemirror/rangeset' ; import { Decoration , DecorationSet , EditorView , PluginValue , ViewPlugin , ViewUpdate } from '@codemirror/view' ; class Plugin implements PluginValue { view : EditorView ; decorations : DecorationSet ; constructor ( view ) { this . view = view ; console . log ( syntaxTree ( view . state ) ) ; } update ( update ) { if ( update . docChanged ) { console . log ( syntaxTree ( this . view . state ) ) ; } } destroy ( ) { } } export const BannersExtension = ViewPlugin . fromClass ( Plugin ) ;