import { Disposable , OutputChannel , TextEditor , commands , window , languages } from "vscode" ; let outputChannel ; param message export function addToOutput ( message ) { if ( ! outputChannel ) { return ; } const title = `${ new Date ( ) . toLocaleString ( ) }:` ; outputChannel . appendLine ( title ) ; outputChannel . appendLine ( "-" . repeat ( title . length ) ) ; outputChannel . appendLine ( `${ message }\n` ) ; } returns { Disposable } export function setupOutputHandler ( ) { outputChannel = window . createOutputChannel ( "pgFormatter" ) ; return commands . registerCommand ( "pgFormatter.open-output" , ( ) => { outputChannel . show ( ) ; } ) ; }