'use strict' ; import * as vscode from 'vscode' ; import { LanguageClient , ExecuteCommandParams , ExecuteCommandRequest } from 'vscode-languageclient' ; export function warn ( client , message , showMessage = false ) { client && client . warn ( message ) ; showMessage && vscode . window . showWarningMessage ( message ) ; } export function sendRequest ( client , command , successCallback , args = [ ] ) { const params = { command , arguments : args } ; client . sendRequest ( ExecuteCommandRequest . type , params ) . then ( successCallback , ( error ) => { console . error ( 'Server failed' , error ) ; vscode . window . showErrorMessage ( 'Failed to send a request. Please consider opening an issue with steps to reproduce.' ) ; } ) ; }