import { WebSiteManagementModels } from '@azure/arm-appservice' ; import * as vscode from 'vscode' ; import * as appservice from 'vscode-azureappservice' ; import { IActionContext } from 'vscode-azureextensionui' ; import { ext } from '../../extensionVariables' ; import { ProductionSlotTreeItem } from '../../tree/ProductionSlotTreeItem' ; import { SlotTreeItemBase } from '../../tree/SlotTreeItemBase' ; import { getRemoteDebugLanguage } from './getRemoteDebugLanguage' ; export async function startRemoteDebug ( context , node ? ) { if ( ! node ) { node = await ext . tree . showTreeItemPicker < SlotTreeItemBase > ( ProductionSlotTreeItem . contextValue , context ) ; } const siteClient = await node . site . createClient ( context ) ; const siteConfig = await vscode . window . withProgress ( { location : vscode . ProgressLocation . Notification , cancellable : true } , async ( progress , token ) => { appservice . reportMessage ( 'Fetching site configuration...' , progress , token ) ; return await siteClient . getSiteConfig ( ) ; } ) ; const language = getRemoteDebugLanguage ( siteConfig ) ; await appservice . startRemoteDebug ( context , node . site , siteConfig , language ) ; }