import * as LC from "vscode-languageclient/node" ; import * as path from "path" ; import { ExtensionContext } from "vscode" ; let client ; export function activate ( context ) { const serverModule = context . asAbsolutePath ( path . join ( "server" , "dist" , "server.js" ) ) ; const debugOptions = { execArgv : [ "--nolazy" , "--inspect=6009" ] } ; const serverOptions = { run : { module : serverModule , transport : LC . TransportKind . ipc } , debug : { module : serverModule , transport : LC . TransportKind . ipc , options : debugOptions } } ; const clientOptions = { documentSelector : [ { scheme : "file" , language : "powerquery" } , { scheme : "untitled" , language : "powerquery" } , ] } ; client = new LC . LanguageClient ( "powerquery" , "Power Query" , serverOptions , clientOptions ) ; client . start ( ) ; } export function deactivate ( ) { if ( ! client ) { return undefined ; } return client . stop ( ) ; }