import * as vscode from 'vscode' ; import { BazelConfiguration , BazelSettings } from './configuration' ; import { LaunchableComponent , LaunchArgs , Status } from './status' ; import { BazelInfo , Bzl } from './bzl' ; import { CommandName } from './constants' ; export class BazelServer extends LaunchableComponent < BazelConfiguration > { private info : BazelInfo | undefined ; constructor ( public readonly settings , public readonly bzl ) { super ( 'BAZ' , settings , CommandName . LaunchBazelServer , 'bazel' ) ; } async shouldLaunch ( e ) { return false ; } async launchInternal ( ) { } async getBazelInfo ( ) { if ( this . info ) { return this . info ; } if ( this . bzl . status !== Status . READY ) { return ; } this . info = await this . bzl . getBazelInfo ( ) ; return this . info ; } async getLaunchArgs ( ) { const cfg = await this . settings . get ( ) ; return { command : [ cfg . executable || 'bazel' ] , showSuccessfulLaunchTerminal : true , showFailedLaunchTerminal : true , } ; } async runInBazelTerminal ( args ) { if ( this . status !== Status . READY ) { return ; } return this . handleCommandLaunch ( args ) ; } }