Skip to content

Repository files navigation

File Preview

File Preview is a local-first document viewer and format-aware editor for Visual Studio Code. The project opens supported files in regular editor tabs and keeps document handling local to the machine, with format-appropriate navigation in a dedicated Activity Bar container.

This repository is preparing the first public release of the extension: version 0.1.0. The current release focuses on local PDF preview, structured text previews, and a clean, testable extension architecture designed for future format support.

Release status

  • Version: 0.1.0
  • Scope: PDF and selected text/structured-text formats
  • Security model: local processing only, no external upload, packaged PDF.js, strict webview CSP
  • Current maturity: public preview for local validation and feedback

Included functionality

  • Local PDF preview through a custom editor and Activity Bar navigator
  • Multi-page rendering with packaged PDF.js assets and local worker setup
  • Page thumbnails, page navigation, zoom, fit-to-page, fit-to-width, actual size, and rotation
  • Search, text selection, and encrypted-PDF password handling inside the preview webview
  • Optional text previews for .txt, .log, .json, .jsonl, .ndjson, .csv, .tsv, .md, .markdown, .xml, .yaml, and .yml
  • Editable Raw mode for text-backed files using VS Code's native text-document model
  • Safe Preview mode for structured content such as JSON, CSV/TSV, Markdown, and logs
  • Privacy-safe diagnostics and runtime reporting for troubleshooting
  • Deterministic renderer selection and guarded navigation/session state

Validation evidence

The images in the repository under the images folder capture the main validation scenarios for the 0.1 release.

PDF preview PDF navigation PDF toolbar CSV / TSV preview JSON preview JSON Lines preview Markdown preview CSV / TSV editing mode

Installation

Prerequisites:

  • Node.js 24
  • npm
  • Visual Studio Code compatible with the engine range declared in package.json

Install dependencies:

npm ci

Common workflow:

npm run build
npm run check
npm test

To run the extension locally in VS Code:

  1. Open this repository in VS Code.
  2. Press F5 to launch the Extension Development Host.
  3. Use the command palette or Explorer context menu to open a PDF or supported text files.
  4. Select the File Preview action as needed through the editor title or the custom editor menu.

Privacy and local processing

File Preview is designed to stay local-first. It does not upload document contents, names, metadata, or extracted text to a remote service. The packaged PDF.js runtime remains as part of the extension; no runtime CDN is used for document preview.

Security

The project uses strict webview CSPs, nonce-based script execution, bounded message validation, and safe DOM text handling for document-derived content. A dedicated security policy is maintained in SECURITY.md.

Roadmap and limitations

The current public preview is intentionally focused on the architecture and validation already completed in this repository. Planned future work includes images, SVG, audio, video, DOCX, PPTX, XLSX, ODT, ODP, and ODS support, along with broader packaging and release validation.

See TODO.md for the staged roadmap.

Contributing

We welcome contributions that maintain the architecture and keep behavior testable and local-first. Please read CONTRIBUTING.md before opening a pull request.

Architecture and documentation

The repository includes architecture guidance and decision records in docs, including the renderer model, preview-session lifecycle, and security-oriented webview constraints.

License and publishing

This repository is prepared for a 0.1 release, but the marketplace or publication workflow should still be reviewed against the final publisher and package metadata before distribution. This package version is set for the first public release and the project notes remain aligned with the current validation evidence.

About

A versatile Visual Studio Code extension for previewing documents, media, and other file formats with rich navigation support.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages