import { BlockFactory , CssBlockError , MultipleCssBlockErrors } from "@css-blocks/core" ; import { TextDocumentChangeEvent } from "vscode-languageserver" ; import { URI } from "vscode-uri" ; import { isBlockFile } from "../util/blockUtils" ; export async function documentContentChange ( e , blockFactory ) { const { uri } = e . document ; if ( isBlockFile ( uri , blockFactory . configuration ) ) { try { await blockFactory . getBlockFromPath ( URI . parse ( uri ) . fsPath ) ; } catch ( error ) { if ( error instanceof MultipleCssBlockErrors ) { return error . errors ; } else if ( error instanceof CssBlockError ) { return [ error ] ; } else { return [ ] ; } } } return [ ] ; }