import { URI } from 'vscode-uri' ; export const EMBEDDED_CONTENT_SCHEME = 'embedded-content' ; export function isEmbeddedContentUri ( virtualDocumentUri ) { return virtualDocumentUri . scheme === EMBEDDED_CONTENT_SCHEME ; } export function getEmbeddedContentUri ( parentDocumentUri , embeddedLanguageId ) { let uriString = EMBEDDED_CONTENT_SCHEME + '://' + embeddedLanguageId + '/' + encodeURIComponent ( parentDocumentUri ) + '.' + embeddedLanguageId ; return URI . parse ( uriString ) ; } ; export function getHostDocumentUri ( virtualDocumentUri ) { let languageId = virtualDocumentUri . authority ; let path = virtualDocumentUri . path . substring ( 1 , virtualDocumentUri . path . length - languageId . length - 1 ) ; return path ; } ; export function getEmbeddedLanguageId ( virtualDocumentUri ) { return virtualDocumentUri . authority ; }