'use strict' ; import * as path from 'path' ; import { ExtensionContext , workspace } from 'vscode' ; import { LanguageClient , LanguageClientOptions , ServerOptions , TransportKind , } from 'vscode-languageclient' ; export async function activate ( context ) { const explainshellEndpoint = workspace . getConfiguration ( 'bashIde' ) . get ( 'explainshellEndpoint' , '' ) ; const globPattern = workspace . getConfiguration ( 'bashIde' ) . get ( 'globPattern' , '' ) ; const highlightParsingErrors = workspace . getConfiguration ( 'bashIde' ) . get ( 'highlightParsingErrors' , false ) ; const env = { ... process . env , EXPLAINSHELL_ENDPOINT : explainshellEndpoint , GLOB_PATTERN : globPattern , HIGHLIGHT_PARSING_ERRORS : highlightParsingErrors , } ; const serverExecutable = { module : context . asAbsolutePath ( path . join ( 'out' , 'server.js' ) ) , transport : TransportKind . ipc , options : { env , } , } ; const debugServerExecutable = { ... serverExecutable , options : { ... serverExecutable . options , execArgv : [ '--nolazy' , '--inspect=6009' ] , } , } ; const serverOptions = { run : serverExecutable , debug : debugServerExecutable , } ; const clientOptions = { documentSelector : [ { scheme : 'file' , language : 'shellscript' , } , ] , synchronize : { configurationSection : 'Bash IDE' , fileEvents : workspace . createFileSystemWatcher ( '**/.clientrc' ) , } , } ; const client = new LanguageClient ( 'Bash IDE' , 'Bash IDE' , serverOptions , clientOptions ) ; context . subscriptions . push ( client . start ( ) ) ; }