Skip to main content

VscodeFileSchemeHandler

Function VscodeFileSchemeHandler 

Source
pub fn VscodeFileSchemeHandler<R: Runtime>(
    AppHandle: &AppHandle<R>,
    Request: &Request<Vec<u8>>,
) -> Response<Vec<u8>>
Expand description

Handles vscode-file:// custom protocol requests.

VS Code’s Electron workbench computes asset URLs as: vscode-file://vscode-app/{appRoot}/out/vs/workbench/...

This handler maps those URLs to the embedded frontend assets served from the frontendDist directory (../Sky/Target).

§URL Mapping

vscode-file://vscode-app/Static/Application/vs/workbench/foo.js
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                         This path maps to Sky/Target/Static/Application/vs/workbench/foo.js

The /out/ prefix that the workbench appends is stripped if present, since our assets live at /Static/Application/vs/ not /Static/Application/out/vs/.

§Parameters

  • AppHandle: Tauri AppHandle for resolving the frontend dist path
  • Request: The incoming request

§Returns

Response with file contents and correct MIME type, or 404