import { assert } from "console" ; import * as fs from "fs" ; import * as os from 'os' ; import * as path from 'path' ; export const isWebpack = ! ! /^(false|0)?$/i . test ( process . env . AZCODE_ARM_IGNORE_BUNDLE ?? '' ) ; console . log ( `isWebpack: ${ isWebpack }` ) ; export const isWin32 = os . platform ( ) === 'win32' ; export const isCaseSensitiveFileSystem = ! isWin32 ; let base = __dirname ; while ( true ) { let test = path . join ( base , "assets" ) ; if ( fs . existsSync ( test ) ) { base = test ; break ; } base = path . dirname ( base ) ; assert ( base != '' , "Could not find base project path" ) ; } export const assetsPath = base ; export const basePath = path . join ( assetsPath , ".." ) ; export const iconsPath = path . join ( basePath , "icons" ) ; assert ( fs . existsSync ( assetsPath ) , "Assets path does not exist: " + assetsPath ) ; export const DEFAULT_TESTCASE_TIMEOUT_MS = 5 * 60 * 1000 ; export namespace documentSchemes { export const file = 'file' ; export const untitled = 'untitled' ; export const linkedTemplate = 'linked-template' ; export const git = 'git' ; } export const languageServerName = 'ARM Template Language Server' ; export const languageFriendlyName = 'Azure Resource Manager Template' ; export const armTemplateLanguageId = 'arm-template' ; export const languageServerFolderName = 'languageServer' ; export const extensionName = 'Azure Resource Manager Tools' ; export const outputChannelName = extensionName ; export const expressionsDiagnosticsSource = "arm-template (expressions)" ; export const backendValidationDiagnosticsSource = 'arm-template (validation)' ; export const languageServerStateSource = "arm-template" ; export const configPrefix = 'azureResourceManagerTools' ; export const langServerDotnetVersion = '3.1' ; export const downloadDotnetVersion = '3.1' ; export namespace configKeys { export const autoDetectJsonTemplates = 'autoDetectJsonTemplates' ; export const dotnetExePath = 'languageServer.dotnetExePath' ; export const traceLevel = 'languageServer.traceLevel' ; export const waitForDebugger = 'languageServer.waitForDebugger' ; export const langServerPath = 'languageServer.path' ; export const checkForLatestSchema = 'checkForLatestSchema' ; export const checkForMatchingParameterFiles = 'checkForMatchingParameterFiles' ; export const parameterFiles = 'parameterFiles' ; export const enableCodeLens = 'codelens.enable' ; export const codeLensForParameters = 'codelens.parameters' ; export const codeLensForResourceParentsAndChildren = 'codelens.resourceChildren' ; } export namespace notifications { export const requestOpenLinkedTemplate = 'arm-template/requestOpenLinkedTemplate' ; export const notifyTemplateGraph = 'arm-template/notifyTemplateGraph' ; export const schemaValidationNotification = 'arm-template/schemaValidation' ; export interface ISchemaValidationNotificationArgs { uri : string ; completed : boolean ; } export namespace Diagnostics { export const codeAnalysisStarting = 'arm-template/diag-codeAnalysisStarting' ; export interface ICodeAnalysisStartingArgs { uri : string ; docVersion : number ; codeAnalysisVersion : number ; } } } export namespace globalStateKeys { export const dontAskAboutSchemaFiles = 'dontAskAboutSchemaFiles' ; export const dontAskAboutParameterFiles = 'dontAskAboutParameterFiles' ; export namespace survey { export const neverShowSurvey = 'neverShowSurvey' ; export const surveyPostponedUntilTime = 'surveyPostponedUntilTime' ; } export namespace messages { export const bicepMessagePostponedUntilTime = 'bicepMessagePostponedUntilTime' ; } } export const diagnosticsCompletePrefix = "Diagnostics complete: " ; export const expressionsDiagnosticsCompletionMessage = diagnosticsCompletePrefix + expressionsDiagnosticsSource ; export const isRunningTests = /^(true|1)$/i . test ( process . env . IS_RUNNING_TESTS ?? '' ) ; export namespace templateKeys { export const schema = '$schema' ; export const parameters = 'parameters' ; export const resources = 'resources' ; export const variables = 'variables' ; export const functions = 'functions' ; export const outputs = 'outputs' ; export const apiProfile = 'apiProfile' ; export const copyLoop = "copy" ; export const copyName = 'name' ; export const copyInput = 'input' ; export const copyCount = 'count' ; export const properties = 'properties' ; export const resourceType = 'type' ; export const resourceApiVersion = 'apiVersion' ; export const resourceDependsOn = 'dependsOn' ; export const resourceName = 'name' ; export const tags = 'tags' ; export const displayNameTag = 'displayName' ; export const nestedDeploymentExprEvalOptions = 'expressionEvaluationOptions' ; export const nestedDeploymentExprEvalScope = 'scope' ; export const nestedDeploymentExprEvalScopeInner = 'inner' ; export const nestedDeploymentTemplateProperty = 'template' ; export const linkedDeploymentTemplateLink = 'templateLink' ; export const linkedDeploymentTemplateLinkUri = 'uri' ; export const linkedDeploymentTemplateLinkRelativePath = 'relativePath' ; export const userFunctionNamespace = 'namespace' ; export const userFunctionMembers = 'members' ; } export const deploymentsResourceTypeLC = 'microsoft.resources/deployments' ;