import * as vscode from "vscode" ; import { IActionContext } from "vscode-azureextensionui" ; import { IGotoResourcesArgs } from "../../vscodeIntegration/commandArguments" ; /**
 * Navigates to the given resource, if only one, else peeks the resources in the editor
 */ export async function gotoResources ( actionContext , args ) { Object . assign ( actionContext . telemetry . properties , args . telemetryProperties ?? { } ) ; if ( args . targets . length === 1 ) { const target = args . targets [ 0 ] ; const editor = vscode . window . activeTextEditor ; if ( editor && editor . document . uri . fsPath === target . uri . fsPath ) { editor . revealRange ( target . range , vscode . TextEditorRevealType . Default ) ; editor . selection = new vscode . Selection ( target . range . start , target . range . start ) ; } } else { await vscode . commands . executeCommand ( 'editor.action.showReferences' , args . source . uri , args . source . range . start , args . targets ) ; } }