import { Uri } from "vscode" ; import { documentSchemes } from "../../common" ; import { parseUri , stringifyUri } from "./uri" ; /**
 * Prepends the linked template scheme to the given URI if it's not a local file
 */ export function prependLinkedTemplateScheme ( uri ) { switch ( uri . scheme ) { case documentSchemes . file : case documentSchemes . git : case documentSchemes . untitled : case documentSchemes . linkedTemplate : return uri ; default : const newUri = `${ documentSchemes . linkedTemplate }:${ stringifyUri ( uri ) }` ; return parseUri ( newUri ) ; } } export function removeLinkedTemplateScheme ( uri ) { if ( uri . scheme === documentSchemes . linkedTemplate ) { return parseUri ( stringifyUri ( uri ) . replace ( /^linked-template:/ , '' ) ) ; } return uri ; }