import { workspace , ExtensionContext } from 'vscode' ; import { LanguageClient , LanguageClientOptions , ServerOptions , TransportKind } from 'vscode-languageclient' ; let client ; export function activate ( _context ) { let serverModule = require . resolve ( '@css-blocks/language-server/dist/run.js' ) ; let debugOptions = { execArgv : [ '--nolazy' , '--inspect=6009' ] } ; let serverOptions = { run : { module : serverModule , transport : TransportKind . ipc } , debug : { module : serverModule , transport : TransportKind . ipc , options : debugOptions } } ; let clientOptions = { documentSelector : [ 'handlebars' , 'scss' , 'css' ] , synchronize : { fileEvents : workspace . createFileSystemWatcher ( '**/.clientrc' ) } } ; client = new LanguageClient ( 'cssBlocksLanguageServer' , 'CSS Blocks Language Server' , serverOptions , clientOptions ) ; client . start ( ) ; } export function deactivate ( ) { if ( ! client ) { return undefined ; } return client . stop ( ) ; }