Error Reporter for Visual Studio Code
Error Reporter is a VSCode extension that collects errors, warnings, and informational messages from your workspace and outputs them as easy-to-read reports.
⚠️ Important Notes
Key limitations to keep in mind when using this extension:
Error Detection Mechanism:
- It relies on VSCode's diagnostic capabilities, so you must open the files and ensure VSCode detects the errors.
- Errors in unopened files or files that VSCode has not yet diagnosed cannot be detected.
Recommended Workflow:
- Open the files where you want to check for errors in VSCode.
- Wait for VSCode to display diagnostics (e.g., red squiggly lines).
- Generate the error report after ensuring diagnostics are visible.
Features
Installation
Install from VSCode Marketplace
- Open VSCode.
- Open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
- Search for "Error Reporter."
- Click "Install."
Install from .vsix File
- Download the
.vsix
file from the release page.
- Open VSCode.
- Open the Extensions view.
- From the ... menu, select "Install from VSIX..."
- Select the downloaded
.vsix
file.
Usage
- Open your project in VSCode.
- Open all files where you want to check for errors:
- This step is crucial.
- Wait for VSCode to complete its diagnostics and display errors (e.g., red squiggly lines).
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
- Run the "Export Errors to File" command.
- Check the progress indicator.
- Once complete, an error report is generated.
Limitations
- Errors in unopened files are not detected.
- You must wait for VSCode diagnostics to finish.
- For large projects, opening all files and waiting for diagnostics may take time.
Configuration Options
You can modify settings as follows:
- Open VSCode Settings (Ctrl+, or Cmd+,).
- Search for "Error Reporter."
Available Settings
{
"errorReporter.includeFileTypes": [
"**/*.ts",
"**/*.js",
"**/*.tsx",
"**/*.jsx",
"**/*.vue",
"**/*.py",
"**/*.java",
"**/*.cs"
],
"errorReporter.excludePatterns": [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"**/.git/**"
],
"errorReporter.severityLevel": "error",
"errorReporter.outputPath": "",
"errorReporter.outputFormat": "markdown"
}
Explanation of Settings
- includeFileTypes: File patterns to scan.
- excludePatterns: Patterns to exclude from scanning.
- severityLevel:
- "error": Errors only.
- "warning": Errors and warnings.
- "info": All diagnostics.
- outputPath: Path for the output file (if empty, defaults to the workspace root).
- outputFormat: Report format (markdown, txt, json, csv).
# Error Report
## Overview
- Generated On: 2024-12-21T10:30:00Z
- Total Issues Detected: 5
### Breakdown by Severity
| Severity | Count |
|----------|-------|
| Errors | 3 |
| Warnings | 2 |
## Details by File
### src/app.ts
| Line | Severity | Message | Code Snippet |
|------|----------|------------------|--------------------|
| 42 | Error | Variable not found | const x = y; |
- Plain Text: Simple text report.
- JSON: Structured data for programmatic processing.
- CSV: Suitable for spreadsheet analysis.
Troubleshooting
If No Errors Are Detected
- Most Common Cause: The file is not open in VSCode.
- Solution: Open the file, wait for VSCode's diagnostics (e.g., red squiggly lines) to appear, and then run the extension.
- Other Checks:
- Verify that the file extension is included in
includeFileTypes
.
- Ensure the file is not excluded by
excludePatterns
.
- Check that
severityLevel
is set appropriately.
If Reports Are Not Generated
- Check workspace permissions.
- Verify that the custom output path is correct if specified.
- Restart VSCode and try again.
Build Instructions
# Install dependencies
npm install
# Build the extension
npm run compile
# Watch mode for development
npm run watch
Debugging
- Open the project in VSCode.
- Press F5 to start a debug session.
- Check the developer tools (Ctrl+Shift+I) for logs.
License
MIT License - See the LICENSE file for details.
Contribution
- Fork this repository.
- Create a new branch.
- Commit your changes.
- Submit a pull request.
Changelog
Version 0.0.1
- Initial release.
- Basic error detection.
- Support for multiple output formats.
- Configurable settings.
- Code snippet display for error locations.