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.
- 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
- 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
The images in the repository under the images folder capture the main validation scenarios for the 0.1 release.
Prerequisites:
- Node.js 24
- npm
- Visual Studio Code compatible with the engine range declared in package.json
Install dependencies:
npm ciCommon workflow:
npm run build
npm run check
npm testTo run the extension locally in VS Code:
- Open this repository in VS Code.
- Press
F5to launch the Extension Development Host. - Use the command palette or Explorer context menu to open a PDF or supported text files.
- Select the File Preview action as needed through the editor title or the custom editor menu.
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.
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.
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.
We welcome contributions that maintain the architecture and keep behavior testable and local-first. Please read CONTRIBUTING.md before opening a pull request.
The repository includes architecture guidance and decision records in docs, including the renderer model, preview-session lifecycle, and security-oriented webview constraints.
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.







