import * as path from 'path' ; import { ExtensionContext } from 'vscode' ; import { LanguageClient , LanguageClientOptions , ServerOptions , TransportKind } from 'vscode-languageclient' ; let client ; export function activate ( context ) { let serverModule = context . asAbsolutePath ( path . join ( 'server' , 'out' , 'server.js' ) ) ; let debugOptions = { execArgv : [ '--nolazy' , '--inspect=6010' ] } ; let serverOptions = { run : { module : serverModule , transport : TransportKind . ipc } , debug : { module : serverModule , transport : TransportKind . ipc , options : debugOptions } } ; let clientOptions = { documentSelector : [ { scheme : 'file' , language : 'svelte' } ] , synchronize : { configurationSection : "svelte-type-checker" } } ; client = new LanguageClient ( 'svelte-type-checker-language-server-client' , 'Svelte Type Checker Client' , serverOptions , clientOptions ) ; client . start ( ) ; } export function deactivate ( ) { if ( ! client ) { return undefined ; } return client . stop ( ) ; }