import { CodeAction , CodeActionContext , CodeLens , Command , Position , Range , Selection , Uri } from "vscode" ; import { INamedDefinition } from "../language/INamedDefinition" ; import { Issue } from "../language/Issue" ; import { ReferenceList } from "../language/ReferenceList" ; import { Span } from "../language/Span" ; import { __debugMarkPositionInString , __debugMarkRangeInString } from "../util/debugMarkStrings" ; import { getVSCodeRangeFromSpan } from "../vscodeIntegration/vscodePosition" ; import { JsonDocument } from "./JsonDocument" ; import { IParameterValuesSourceProvider } from "./parameters/IParameterValuesSourceProvider" ; import { PositionContext } from "./positionContexts/PositionContext" ; import { TemplateScope } from "./templates/scopes/TemplateScope" ; /**
 * Represents a deployment-related JSON file
 */ export abstract class DeploymentDocument extends JsonDocument { param _documentText param _documentUri constructor ( documentText , documentUri , public readonly documentVersion ) { super ( documentText , documentUri ) ; } public _debugShowTextAt ( positionOrRange ) { if ( positionOrRange instanceof Span ) { return __debugMarkRangeInString ( this . documentText , positionOrRange . startIndex , positionOrRange . length ) ; } else if ( positionOrRange instanceof Range ) { const startIndex = this . getDocumentCharacterIndex ( positionOrRange . start . line , positionOrRange . start . character , { allowOutOfBounds : true } ) ; const endIndex = this . getDocumentCharacterIndex ( positionOrRange . end . line , positionOrRange . end . character , { allowOutOfBounds : true } ) ; return __debugMarkRangeInString ( this . documentText , startIndex , endIndex - startIndex ) ; } else if ( positionOrRange instanceof Position ) { const index = this . getDocumentCharacterIndex ( positionOrRange . line , positionOrRange . character , { allowOutOfBounds : true } ) ; return __debugMarkPositionInString ( this . documentText , index ) ; } else { return __debugMarkPositionInString ( this . documentText , positionOrRange ) ; } } public abstract getContextFromDocumentLineAndColumnIndexes ( documentLineIndex , documentColumnIndex , associatedTemplate ) ; public abstract getContextFromDocumentCharacterIndex ( documentCharacterIndex , associatedTemplate ) ; /**
     * Find all references in this document to the given named definition (which may or may not be in this document)
     */ public abstract findReferencesToDefinition ( definition ) ; param associatedDocument param range param context param token return public abstract getCodeActions ( associatedDocument , range , context ) ; public abstract getCodeLenses ( parameterValuesSourceProvider ) ; public getErrors ( associatedDocument ) { return this . getErrorsCore ( associatedDocument ) ; } public abstract getErrorsCore ( associatedDocument ) ; public abstract getWarnings ( ) ; } export abstract class ResolvableCodeLens extends CodeLens { public constructor ( public readonly scope , public readonly span ) { super ( getVSCodeRangeFromSpan ( scope . document , span ) ) ; } /**
     * Must fill in the code lens title and command, or return false if no longer valid
     */ public abstract resolve ( ) ; }