import BashLanguageServer from 'bash-language-server' ; import { createConnection , IConnection , InitializeParams , InitializeResult , ProposedFeatures , } from 'vscode-languageserver' ; const connection = createConnection ( ProposedFeatures . all ) ; connection . onInitialize ( async ( params ) : Promise < InitializeResult > => { connection . console . info ( 'BashLanguageServer initializing...' ) ; const server = await BashLanguageServer . initialize ( connection , params ) ; server . register ( connection ) ; connection . console . info ( 'BashLanguageServer initialized' ) ; return { capabilities : server . capabilities ( ) , } ; } ) ; connection . listen ( ) ; process . on ( 'unhandledRejection' , ( reason , p ) => { connection . console . error ( `Unhandled Rejection at promise: ${ p }, reason: ${ reason }` ) ; } ) ; process . on ( 'SIGPIPE' , ( ) => { } ) ;