import * as vsc from 'vscode' ; import { SQLiteEditorDefaultProvider , SQLiteEditorOptionProvider } from './sqliteEditor' ; export function activate ( context ) { showWhatsNew ( context ) ; context . subscriptions . push ( SQLiteEditorDefaultProvider . register ( context ) ) ; context . subscriptions . push ( SQLiteEditorOptionProvider . register ( context ) ) ; } const extensionId = 'qwtel.sqlite-viewer' ; async function showWhatsNew ( context ) { const previousVersion = context . globalState . get < string > ( extensionId ) ; const currentVersion = vsc . extensions . getExtension ( extensionId ) ! . packageJSON . version ; context . globalState . update ( extensionId , currentVersion ) ; if ( previousVersion === undefined || previousVersion !== currentVersion || context . extensionMode === vsc . ExtensionMode . Development ) { let actions ; const result = await vsc . window . showInformationMessage ( `🆕 Try out the standalone web app — you can now use SQLite Viewer without VS Code!` , ... actions = [ { title : 'Open in browser ↗️' } ] ) ; if ( result !== null ) { if ( result === actions [ 0 ] ) { await vsc . env . openExternal ( vsc . Uri . parse ( 'https://sqliteviewer.app?ref=vscode' ) ) ; } } } }