Datalayer VS Code Extension - v0.0.17
    Preparing search index...

    Virtual file system provider that maps Datalayer documents to clean URI scheme. Allows VS Code to display "datalayer://Space Name/Notebook.ipynb" instead of temp paths. Persists mappings across VS Code restarts using globalState.

    Implements

    • FileSystemProvider
    Index

    Properties

    onDidChangeFile: Event<FileChangeEvent[]> = ...

    Event fired when files change in the virtual file system.

    Methods

    • Creates a new directory at the given URI.

      Parameters

      • uri: Uri

        The URI of the directory to create.

      Returns void

      If the URI has no mapping.

    • Deletes a file or directory and removes its mapping.

      Parameters

      • uri: Uri

        The URI of the resource to delete.

      • options: { recursive: boolean }

        Delete options controlling recursive behavior.

        • recursive: boolean

          Whether to delete directory contents recursively.

      Returns void

      If the file or directory is not found.

    • Gets the real file path for a virtual URI.

      Parameters

      • uri: Uri

        Virtual URI to resolve to a local file path.

      Returns string

      Real file path or undefined if no mapping exists.

    • Gets the virtual URI for a real file path.

      Parameters

      • realPath: string

        Real file path to resolve to a virtual URI.

      Returns Uri

      Virtual URI or undefined if no mapping exists.

    • Initializes the provider with extension context for persistent storage. Restores any previously saved mappings from globalState.

      Parameters

      • context: ExtensionContext

        Extension context for accessing globalState.

      Returns void

    • Reads the contents of a directory.

      Parameters

      • uri: Uri

        The URI of the directory to list.

      Returns [string, FileType][]

      Array of name and type tuples representing directory entries.

      If the directory is not found.

    • Reads the contents of a file from the mapped real path. Mappings are restored from persistent storage during initialization, so this should always find the real path for valid documents.

      Parameters

      • uri: Uri

        The URI of the file to read.

      Returns Uint8Array

      The file contents as a byte array.

      If the file is not found or has no mapping.

    • Registers a mapping between a virtual URI and a real file path. Persists the mapping to globalState for restoration after restart.

      Parameters

      • virtualPath: string

        Clean path for the virtual URI such as "Space Name/Notebook.ipynb".

      • realPath: string

        Actual file system path to the document on disk.

      Returns Uri

      The created virtual URI with datalayer:// scheme.

    • Removes a mapping for a closed document. Updates persistent storage accordingly.

      Parameters

      • uri: Uri

        Virtual URI whose mapping should be removed.

      Returns void

    • Renames or moves a file or directory and updates mappings.

      Parameters

      • oldUri: Uri

        The current URI of the resource.

      • newUri: Uri

        The target URI after the rename or move.

      • options: { overwrite: boolean }

        Rename options controlling overwrite behavior.

        • overwrite: boolean

          Whether to overwrite if target already exists.

      Returns void

      If the source or target is not found or already exists.

    • Gets metadata about a file or directory.

      Parameters

      • uri: Uri

        The URI of the file or directory to inspect.

      Returns FileStat

      File stat containing type, timestamps, and size.

      If the file is not found.

    • Watches a file or directory for changes.

      Parameters

      • _uri: Uri

        The URI to watch for changes.

      Returns Disposable

      A disposable that stops watching when disposed.

    • Writes data to a file at the mapped real path.

      Parameters

      • uri: Uri

        The URI of the file to write.

      • content: Uint8Array

        The binary content to write to disk.

      • options: { create: boolean; overwrite: boolean }

        Write options controlling create and overwrite behavior.

        • create: boolean

          Whether to create the file if it does not exist.

        • overwrite: boolean

          Whether to overwrite existing file content.

      Returns void

      If the file is not found or cannot be written.