import { IHTMLDataProvider , newHTMLDataProvider } from 'vscode-html-languageservice' ; import * as fs from 'fs' ; export function getDataProviders ( dataPaths ? ) { if ( ! dataPaths ) { return [ ] ; } const providers = [ ] ; dataPaths . forEach ( ( path , i ) => { try { if ( fs . existsSync ( path ) ) { const htmlData = JSON . parse ( fs . readFileSync ( path , 'utf-8' ) ) ; providers . push ( newHTMLDataProvider ( `customProvider${ i }` , htmlData ) ) ; } } catch ( err ) { console . log ( `Failed to load tag from ${ path }` ) ; } } ) ; return providers ; }