Skip to content

Complete rewrite#1

Merged
hawkeyexl merged 38 commits intomainfrom
nect
May 22, 2025
Merged

Complete rewrite#1
hawkeyexl merged 38 commits intomainfrom
nect

Conversation

@hawkeyexl
Copy link
Contributor

@hawkeyexl hawkeyexl commented May 22, 2025

Improve test detection and rendering in the Doc Detective extension by introducing a webview for displaying results. Enhance YAML and JSON rendering with collapsible sections and better styling. Update commands, configuration support, and documentation for clarity. Bump version and update dependencies for improved functionality and performance. Remove outdated files and streamline the project structure.

Summary by CodeRabbit

  • New Features

    • Introduced a sidebar panel in VS Code that displays detected test suites for open files with interactive and syntax-highlighted views.
    • Added commands for refreshing the panel, viewing a simplified test summary, and a hello world message.
    • Automatic updates on file changes, saves, theme changes, and configuration updates.
  • Chores

    • Modernized project structure with new build, lint, and test workflows.
    • Updated recommended VS Code extensions and workspace settings for improved development experience.
    • Added comprehensive configuration and linting files.
    • Added detailed configuration for CodeRabbit AI assistant integration.
  • Documentation

    • Rewrote and expanded the README for clearer usage instructions and project overview.
    • Updated or removed various documentation files for clarity and relevance.
  • Refactor

    • Streamlined extension activation events, commands, and UI integration.
    • Migrated to a new extension entry point and restructured dependencies and scripts.
  • Tests

    • Added a basic test suite to verify extension setup and functionality.
  • Revert

    • Removed legacy implementation files, configuration files, and outdated documentation.
  • Style

    • Improved ignore patterns for packaging and version control.
  • License

    • Switched from MIT to AGPLv3 license.

hawkeyexl added 29 commits May 15, 2025 19:25
- Updated the logic to detect test suites instead of just tests for each file.
- Introduced a new TreeItem representation for test suites, including descriptions and icons.
- Added functionality to display tests within a suite, with detailed step breakdowns.
- Improved error handling for test detection.
…" in package.json and extension.ts for improved clarity and consistency.
…esults

- Added a new WebviewViewProvider for rendering test results in a webview.
- Removed the previous TreeDataProvider implementation for open files and tests.
- Updated package.json to specify the type of the sidebar as "webview".
- Implemented message handling for refreshing the webview content.
- Enhanced the HTML structure for displaying JSON results in the webview.
…g of the webview when the active editor changes.
- Removed pretty-printed JSON string and replaced it with a dynamic rendering function.
- Implemented a recursive function to render JSON objects with collapsible nodes for better readability.
- Added CSS styles for collapsible elements and JSON data types (string, number, boolean, null).
- Enabled interactive expansion and collapse of nested JSON structures in the webview.
…dentation, and add bracket and comma styling
- Updated version in package.json and package-lock.json to 0.0.2
- Changed dependency "doc-detective-resolver" from "^3.0.0-dev.1" to "^3.0.0"
- Added "js-yaml" dependency with version "^4.1.0"
- Updated "@types/node" from "22.15.18" to "22.15.21"
- Updated "webpack" from "^5.99.8" to "^5.99.9"
- Updated ESLint and TypeScript ESLint plugin versions
- Refactored YAML rendering logic in extension.ts for improved readability and functionality
- Added a helper function to check for nested objects/arrays.
- Improved rendering logic to handle simple objects and arrays more effectively.
- Introduced a toggle feature for objects with nested structures.
- Simplified display of single-key objects on the same line.
- Enhanced styling for simple objects in the rendered output.
- Improved handling of nested objects and arrays in the renderYAML function.
- Updated CSS styles for better indentation and toggle visibility.
- Enhanced the display of simple objects and arrays, ensuring proper formatting.
- Simplified the logic for rendering key-value pairs, especially for nested structures.
…tyling with CSS variables, and handle theme changes dynamically
…webview handling

- Added new commands: "Refresh Doc Detective Panel" and "Use Simple View" with icons.
- Implemented a menu for the new commands in the view title.
- Improved logging throughout the extension for better debugging.
- Enhanced webview HTML structure with loading and error states.
- Added methods for simplified view rendering and error handling.
- Updated content security policy for webview.
- Refactored updateWebview method to handle errors and loading states more gracefully.
- Updated package.json to provide a clearer description of the extension.
- Modified webview HTML to include a message about automatic updates when files are saved.
- Implemented an event listener to refresh the webview content upon saving a file.
- Refine introduction to better explain the extension's purpose
- Streamline features section for improved readability
- Remove unnecessary sections and tips to focus on essential information
- Add a heartfelt closing message from the Doc Detective team
- Add entries for /.vscode-test and /out to .gitignore
- Include test/** in .vscodeignore
- Replace icon.svg with a new SVG graphic
- Include the full text of the GNU Affero General Public License version 3
- Ensure compliance with open-source licensing requirements
- Added repository information for the project.
- Updated the commands and menus structure for better organization.
- Added @vscode/vsce as a dependency for packaging the extension.
- Removed reference to Doc Detective Companion browser extension
- Deleted release notes section for version 0.0.2
- Introduced a configuration option to specify a custom path for the Doc Detective configuration file in package.json.
- Implemented functions to load and parse configuration files in JSON or YAML format.
- Added logic to find the configuration file either from a custom path or default locations in the workspace root.
- Updated the test detection logic to utilize the loaded configuration.
- Implemented event listener to refresh the webview when configuration changes.
- Replace sidebar icon path in package.json to use new image
- Add new icon file dd-mono.png to media directory
- Changed package name from "doc-detective-vsc" to "doc-detective".
- Updated display name to "Doc Detective" and added publisher information.
- Revised description to clarify functionality.
- Added sponsor URL for GitHub sponsorship.
- Included "Testing" in categories.
- Updated license information to "AGPL-3.0-only".
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 22, 2025

Warning

Rate limit exceeded

@hawkeyexl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 23 minutes and 50 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 8446602 and 37c2278.

📒 Files selected for processing (1)
  • README.md (1 hunks)

Walkthrough

This update restructures the project as a Visual Studio Code extension, replacing legacy JavaScript files with a TypeScript-based implementation, new build and linting configurations, and modernized VS Code integration. It introduces a sidebar webview for test detection, updates dependencies, revises documentation, modifies licensing to AGPLv3, and adds comprehensive CI/CD workflows.

Changes

File(s) / Path(s) Change Summary
.coderabbit.yaml Added CodeRabbit configuration file specifying review, tools, and integration settings.
.github/copilot-instructions.md Added Copilot workspace instructions for VS Code extension development.
.github/workflows/test-publish.yaml Introduced a new GitHub Actions workflow for testing on multiple platforms and publishing on release.
.github/workflows/vsc-publish.yml Deleted legacy GitHub Actions workflow for testing and publishing the extension.
.gitignore Updated to broaden node_modules ignore pattern and added ignores for /.vscode-test and /out.
.vscode-test.mjs Added VS Code test runner configuration for locating JavaScript test files.
.vscode/extensions.json Expanded recommended extensions and updated documentation URL.
.vscode/launch.json Modified launch configuration to add a build step and removed the explicit test launch config.
.vscode/settings.json Added workspace settings to control visibility and search inclusion of build output folders; disabled TypeScript task auto-detection.
.vscode/tasks.json Added tasks for running and watching build/test npm scripts, including a composite task.
.vscodeignore Expanded ignore patterns for packaging the extension, including new directories and config files.
CHANGELOG.md Deleted changelog documentation.
LICENSE Replaced MIT License with GNU AGPLv3 license.
README.md Rewrote and expanded the README with detailed usage, features, related projects, and contribution info.
config.json Deleted legacy configuration file for test/content analysis tool.
eslint.config.mjs Added ESLint configuration for TypeScript with specific rules and plugin settings.
extension.js Deleted legacy VS Code extension implementation in JavaScript.
jsconfig.json Deleted JavaScript compiler configuration file.
package.json Overhauled extension manifest: updated publisher, commands, activation events, dependencies, scripts, UI contributions, and moved to AGPL-3.0 license.
src/extension.ts Added new TypeScript implementation of the VS Code extension with webview, test detection, and commands.
src/test/extension.test.ts Added Mocha-based test suite with a sample test and VS Code API usage.
tsconfig.json Added TypeScript project configuration targeting ES2022 and strict type checking.
vsc-extension-quickstart.md Deleted VS Code extension quickstart guide.
webpack.config.js Added Webpack configuration for bundling the TypeScript extension for VS Code.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant VSCode
    participant DocDetectiveExtension
    participant WebviewPanel
    participant TestDetector

    User->>VSCode: Opens workspace / activates extension
    VSCode->>DocDetectiveExtension: activate(context)
    DocDetectiveExtension->>VSCode: Register webview and commands
    User->>DocDetectiveExtension: Runs command or opens sidebar
    DocDetectiveExtension->>WebviewPanel: resolveWebviewView()
    WebviewPanel->>DocDetectiveExtension: request update
    DocDetectiveExtension->>TestDetector: detectTests(openFiles, config)
    TestDetector-->>DocDetectiveExtension: test results/errors per file
    DocDetectiveExtension->>WebviewPanel: Render results (HTML/JSON)
    WebviewPanel-->>User: Display test detection results
Loading

Poem

🐇
A hop, a skip, a brand new view,
TypeScript shines where JavaScript flew.
Webpack bundles, tests now run,
Sidebar glows—detecting fun!
AGPL keeps our code so free,
Doc Detective leaps with glee!
—Your rabbit in VSCode, joyfully.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

…orkflow

- Changed node versions to only include 22
- Reformatted os matrix for better readability
@hawkeyexl hawkeyexl requested a review from Copilot May 22, 2025 21:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR completely rewrites the Doc Detective VSCode extension to use a bundled TypeScript build, introduce a sidebar webview for test results, enhance configuration and commands, update documentation, bump dependencies, and clean up obsolete files.

  • Add Webpack configuration and TypeScript build pipeline
  • Redesign extension activation, commands, and sidebar webview
  • Remove legacy files, update tests, docs, and CI workflows

Reviewed Changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webpack.config.js Add Webpack config to bundle extension TypeScript into dist
vsc-extension-quickstart.md Remove outdated quickstart guide
src/test/extension.test.ts Introduce basic sample test suite stub
package.json Update metadata, commands, config defaults, scripts, and deps
jsconfig.json Remove legacy JS project config
eslint.config.mjs Add ESLint configuration for TypeScript
config.json Remove default configuration file
README.md Rewrite documentation to reflect new features
CHANGELOG.md Remove outdated changelog
.vscodeignore Update ignore patterns for packaging
.vscode/tasks.json Add NPM watch tasks for dev workflow
.vscode/settings.json Add workspace-specific VS Code settings
.vscode/launch.json Update launch config for compiled output
.vscode/extensions.json Update recommended extensions
.vscode-test.mjs Add VS Code test CLI configuration
.github/workflows/test-publish.yaml Introduce CI workflow for testing and publishing
.github/copilot-instructions.md Add workspace-specific Copilot instructions
.coderabbit.yaml Add CodeRabbit AI review configuration
Comments suppressed due to low confidence (3)

src/test/extension.test.ts:8

  • [nitpick] Current tests only cover a trivial sample. Add tests that exercise the new webview commands and rendering logic to ensure the rewritten features are properly validated.
suite('Extension Test Suite', () => {

package.json:22

  • [nitpick] The command namespace doc-detective-vsc differs from the extension's doc-detective name. Consider unifying the prefix to avoid confusion for users and maintainers.
"command": "doc-detective-vsc.helloWorld",

hawkeyexl and others added 4 commits May 22, 2025 14:31
…node-version correctly

- Omit ubuntu-latest from the OS matrix due to compatibility issues with X server
- Set node-version in the setup-node action
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Docstrings generation was requested by @hawkeyexl.

* #1 (comment)

The following files were modified:

* `src/extension.ts`
@coderabbitai coderabbitai bot mentioned this pull request May 22, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 22, 2025

Note

Generated docstrings for this pull request at #2

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (12)
README.md (1)

53-53: Refine footer emphasis usage
Bold emphasis on a line by itself triggers a markdownlint warning (MD036). Consider switching to italics or a heading for better style.

- **Made with ❤️ by the Doc Detective team**
+ _Made with ❤️ by the Doc Detective team_
.github/copilot-instructions.md (1)

2-2: Clarify Copilot usage instructions
Consider elaborating on when and how to invoke get_vscode_api, and include a brief example to guide Copilot’s behavior.

.vscode/launch.json (1)

9-13: Consider adding a test debug configuration
If you need to debug extension tests interactively, you may want to reintroduce a separate launch configuration using --extensionTestsPath pointing to your new .vscode-test.mjs.

tsconfig.json (2)

12-14: Consider enabling additional type checks

These commented options would provide more rigorous type checking. Consider enabling them to catch potential issues early in development.

- // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
- // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
- // "noUnusedParameters": true,  /* Report errors on unused parameters. */
+ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
+ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
+ "noUnusedParameters": true,  /* Report errors on unused parameters. */

2-15: Add outDir and exclude configurations

Consider adding an output directory specification and exclusion patterns to prevent unnecessary compilation.

 "compilerOptions": {
   "module": "Node16",
   "target": "ES2022",
   "lib": [
     "ES2022"
   ],
   "sourceMap": true,
   "rootDir": "src",
   "strict": true,   /* enable all strict type-checking options */
+  "outDir": "out",  /* Specify an output folder for all emitted files. */
   /* Additional Checks */
   // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
   // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
   // "noUnusedParameters": true,  /* Report errors on unused parameters. */
 }
+"exclude": [
+  "node_modules",
+  ".vscode-test"
+]
webpack.config.js (1)

3-3: Remove redundant 'use strict' directive

JavaScript modules are automatically in strict mode, so this directive is unnecessary.

- 'use strict';
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-3: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

.github/workflows/test-publish.yaml (1)

25-27: Trailing whitespace violates yamllint rule

Line 25 (os:) contains a stray space that trips the trailing-spaces rule reported by yamllint 1.37.1. Removing it will silence the warning and keep CI green.

-        os: 
+        os:
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 25-25: trailing spaces

(trailing-spaces)

src/extension.ts (2)

200-218: Run test detection in parallel to speed-up large workspaces

Files are processed serially; two dozen open files already add perceptible lag. A Promise.all keeps overall time bounded by the slowest file instead of the sum of all files.

-const results: Record<string, any> = {};
-for (const file of uniquePaths) {
-  try {
-    ...
-    const suites = await detectTests({ config });
-    results[file] = suites;
-  } catch (e) {
-    results[file] = { error: String(e) };
-  }
-}
+const resultsArr = await Promise.all(uniquePaths.map(async (file) => {
+  const cfg = baseConfig ? { ...baseConfig, input: file } : { input: file };
+  try {
+    return [file, await detectTests({ config: cfg })] as const;
+  } catch (e) {
+    return [file, { error: String(e) }] as const;
+  }
+}));
+const results = Object.fromEntries(resultsArr);

343-349: Current JSON escaping still allows </script> & newline injections

JSON.stringify(JSON.stringify(obj)) plus manual slicing misses edge-cases (</script>, \u2028, \u2029).
Embedding raw data via webview.postMessage is both safer and simpler:

// inside updateWebview after generating results
this._view.webview.postMessage({ type: 'results', data: results });

// in the HTML:
window.addEventListener('message', (event) => {
  if (event.data?.type === 'results') {
    render(event.data.data);
  }
});

If you insist on inlining, Base64-encode the payload to make it delimiter-agnostic.

package.json (3)

7-9: Migrate sponsor to funding for npm compatibility
The sponsor property is non-standard in package.json. Consider using the funding field (e.g., "funding": { "url": "…" }) to ensure compatibility with npm and ecosystem tools.


18-21: Consider automatic activation on JSON/YAML files
To streamline UX, you could add "onLanguage:json" and "onLanguage:yaml" activation events so the extension loads whenever users open relevant files.


101-113: Prune unused testing devDependencies
It appears Mocha is no longer part of your test pipeline (now using vscode-test); consider removing @types/mocha to keep devDependencies lean.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d84386f and 3f79772.

⛔ Files ignored due to path filters (7)
  • dist/extension.js is excluded by !**/dist/**
  • dist/extension.js.LICENSE.txt is excluded by !**/dist/**
  • dist/extension.js.map is excluded by !**/dist/**, !**/*.map
  • icon.png is excluded by !**/*.png
  • media/dd-mono.png is excluded by !**/*.png
  • media/icon.svg is excluded by !**/*.svg
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (24)
  • .coderabbit.yaml (1 hunks)
  • .github/copilot-instructions.md (1 hunks)
  • .github/workflows/test-publish.yaml (1 hunks)
  • .github/workflows/vsc-publish.yml (0 hunks)
  • .gitignore (2 hunks)
  • .vscode-test.mjs (1 hunks)
  • .vscode/extensions.json (1 hunks)
  • .vscode/launch.json (2 hunks)
  • .vscode/settings.json (1 hunks)
  • .vscode/tasks.json (1 hunks)
  • .vscodeignore (1 hunks)
  • CHANGELOG.md (0 hunks)
  • LICENSE (1 hunks)
  • README.md (1 hunks)
  • config.json (0 hunks)
  • eslint.config.mjs (1 hunks)
  • extension.js (0 hunks)
  • jsconfig.json (0 hunks)
  • package.json (1 hunks)
  • src/extension.ts (1 hunks)
  • src/test/extension.test.ts (1 hunks)
  • tsconfig.json (1 hunks)
  • vsc-extension-quickstart.md (0 hunks)
  • webpack.config.js (1 hunks)
💤 Files with no reviewable changes (6)
  • CHANGELOG.md
  • jsconfig.json
  • .github/workflows/vsc-publish.yml
  • vsc-extension-quickstart.md
  • config.json
  • extension.js
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/test-publish.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

🪛 markdownlint-cli2 (0.17.2)
README.md

52-52: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)

🪛 Biome (1.9.4)
webpack.config.js

[error] 2-3: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

🔇 Additional comments (49)
LICENSE (1)

1-662:

Details

❓ Verification inconclusive

Missing project-specific copyright notice
The LICENSE file contains the full AGPLv3 text but lacks a copyright statement for the Doc Detective project.

Please add a project-specific copyright line, for example:

+Copyright (C) 2025 Doc Detective Team

Also verify that the license field in package.json is updated to "AGPL-3.0-or-later".


#!/bin/bash
set -e

# Check for project-specific copyright in LICENSE
echo "LICENSE file copyright lines:"
grep -n "^Copyright" LICENSE || echo "No copyright lines found in LICENSE."

# Inspect the license field in package.json
if [ -f package.json ]; then
  echo "package.json license field:"
  grep -n '"license"' package.json || echo "No license field found in package.json."
else
  echo "package.json not found"
fi

#!/bin/bash
set -e

echo "Checking LICENSE file for project-specific copyright..."
grep -n -E "Copyright.*Doc Detective" LICENSE || echo "No project-specific copyright found"

echo
echo "Looking for package.json..."
if [ -f package.json ]; then
  echo "Found package.json. Extracting license field:"
  grep -n '"license"\s*:' package.json || echo "No license field in package.json."
else
  echo "package.json not present"
fi

Add missing project-specific copyright and verify package.json license
The AGPLv3 text is present in LICENSE but lacks your project’s own copyright line, and the npm metadata should reflect the AGPL.

• In LICENSE (top of file) add something like:

+Copyright (C) 2025 Doc Detective Team

• In package.json ensure:

"license": "AGPL-3.0-or-later"
README.md (10)

1-1: Approve updated title
Excellent clarity and specificity in the extension’s title.


3-3: Approve updated description
Clear overview of the extension’s purpose and VS Code integration.


7-10: Approve revised features list
The feature descriptions are concise and user-focused.


12-15: Approve “How It Works” section
Provides a clear explanation of the detection mechanism.


20-24: Approve usage instructions
Step-by-step guidance is clear and actionable.


27-30: Approve test scanning details
Supported test formats and detection patterns are well documented.


36-38: Approve “Related Projects” links
Links to ecosystem components are accurate and helpful.


43-45: Approve “Learn More” resources
External links offer valuable further reading.


49-49: Approve “Contributing” section
Clear call-to-action encouraging community involvement.


16-18:

Details

❌ Incorrect review comment

Verify VS Code version requirement
Version v1.100.0 does not exist; please confirm the minimum supported version to avoid blocking users.


🏁 Script executed:

#!/bin/bash
# Check if Visual Studio Code v1.100.0 exists among GitHub releases
curl -s https://api.github.com/repos/microsoft/vscode/releases \
  | jq -r '.[].tag_name' \
  | grep -x '1.100.0' || echo "NOT FOUND"

Length of output: 113


No changes needed: VS Code v1.100.0 is valid
A check of the official VS Code GitHub releases confirms that tag 1.100.0 exists. You can safely require VS Code v1.100.0 or higher.

• README.md (lines 16–18): the “Visual Studio Code v1.100.0 or higher” requirement is correct and does not need updating.

Likely an incorrect or invalid review comment.

.github/copilot-instructions.md (1)

1-1: Approve Copilot comment reference
The HTML comment correctly links to Copilot customization documentation.

.gitignore (2)

4-4: Approve node_modules ignore pattern
Using a broad node_modules entry ensures all nested directories are ignored.


14-15: Approve new ignore patterns
Ignoring /.vscode-test and /out aligns with the project’s build and test output directories.

.vscode-test.mjs (1)

1-5: Approve VS Code test runner configuration
The import and default export of defineConfig with the correct test file glob are properly set up.

.vscode/settings.json (3)

3-6: files.exclude configuration is correct
Intentionally showing the out and dist build output folders in the Explorer while managing their visibility via comments aligns with the documented workflow.


7-10: search.exclude configuration is appropriate
Excluding out and dist from search results protects performance by avoiding unnecessary indexing of compiled artifacts.


12-12: Disable TypeScript auto-detection as intended
Turning off typescript.tsc.autoDetect to rely on npm scripts for build/watch tasks matches the tasks defined in .vscode/tasks.json.

.vscode/extensions.json (1)

2-4: Recommended extensions updated correctly
Adding amodio.tsl-problem-matcher and ms-vscode.extension-test-runner alongside ESLint enhances the developer experience for the new TypeScript and test workflows.

.vscodeignore (5)

1-1: Ignore GitHub metadata directory
Excluding .github/** prevents CI configuration and issue templates from being packaged into the extension.


4-6: Ignore build output and dependencies
Excluding out/**, node_modules/**, and src/** ensures only the production-ready dist folder is included in the published extension.


10-10: Ignore build tooling config
Excluding webpack.config.js keeps the bundler configuration out of the final package.


12-13: Exclude TypeScript and ESLint configs
Ignoring both tsconfig.json and eslint.config.mjs prevents development-time configuration files from being shipped.


15-15: Ignore all TypeScript source files
Excluding **/*.ts ensures only compiled JavaScript ends up in the extension package.

.vscode/launch.json (1)

15-18: Integrate build step and output mapping
Adding outFiles to point at dist/**/*.js and a preLaunchTask to run the default build task ensures the extension is compiled before launch, matching the new Webpack/TypeScript workflow.

eslint.config.mjs (4)

1-2: Imports for ESLint TypeScript plugin and parser
The imports from @typescript-eslint/eslint-plugin and @typescript-eslint/parser are correct and ready for use in the new config.


4-9: Base configuration and plugin registration
Scoping linting to **/*.ts and registering the @typescript-eslint plugin aligns with the project’s TypeScript focus.


11-15: Language options are properly set
Specifying the parser, ECMAScript 2022 syntax, and module source type matches the VS Code extension’s target environment.


17-27: Core linting rules make sense for consistency
Enabling naming-convention for imports, mandatory curly braces, strict equality, disallowing throw literals, and semicolons at warning level provides a solid baseline.

src/test/extension.test.ts (1)

8-9: Well-structured test suite setup

The test suite is properly structured using Mocha's framework with clear notification of test startup.

.vscode/tasks.json (1)

4-39: Well-structured tasks configuration

The tasks configuration is properly set up for TypeScript development with webpack. It includes well-configured watch tasks for both source and test files, with appropriate problem matchers and presentation settings. The composite task provides a convenient way to start both watchers simultaneously.

tsconfig.json (1)

3-7: Good modern TypeScript configuration

The configuration correctly uses Node16 module system with ES2022 target, which is appropriate for a VS Code extension.

webpack.config.js (1)

10-46: Well-configured webpack setup for VS Code extension

The webpack configuration is properly set up for a TypeScript-based VS Code extension. It correctly handles the entry point, output format, external dependencies, and TypeScript processing. The comments are helpful in explaining the purpose of each configuration section.

.github/workflows/test-publish.yaml (1)

25-30:

Details

❌ Incorrect review comment

Node 22 is not yet available on GitHub Actions runners

actions/setup-node@v4 currently supports the LTS and active versions published on nodejs.org. As of today, Node 22 has not reached an officially released status, so the runner will fail with Version 22.x not found and your matrix job will be skipped.

-        node:
-          - 22
+        node:
+          # Use the latest *released* active/LTS versions
+          - 20   # current LTS
+          - 18   # maintenance LTS

Please verify the Node-22 availability before re-enabling it.


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "Checking Node 22 availability in official Node.js releases..."
curl -s https://nodejs.org/dist/index.json \
  | grep -E '"version":\s*"v22\.[0-9]+\.[0-9]+"' \
  || echo "No Node 22 releases found"

Length of output: 10273


Node.js 22 is now officially available and supported
The original blocker is outdated—Node.js v22 has been published (including LTS “Jod” since v22.14.0) and actions/setup-node@v4 will install it successfully. You can safely re-enable:

.github/workflows/test-publish.yaml (lines 25–30)

node:
  - 22

If you want broader coverage, consider expanding your matrix:

node:
  - 22   # active/LTS
  - 20   # current LTS
  - 18   # maintenance LTS

Likely an incorrect or invalid review comment.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 25-25: trailing spaces

(trailing-spaces)

.coderabbit.yaml (1)

5-33: Configuration looks valid against the published schema

Keys and nesting levels match the current CodeRabbit schema. No action needed. 👍

src/extension.ts (1)

118-121: Relaxed Content-Security-Policy weakens defense-in-depth

script-src 'unsafe-inline' disables CSP’s primary XSS protection. VS Code recommends injecting a random nonce and allowing only that script:

<meta http-equiv="Content-Security-Policy"
      content="default-src 'none';
               img-src vscode-webview:;
               style-src 'unsafe-inline';
               script-src 'nonce-${nonce}';">

Consider tightening the directive before publishing to the marketplace.

package.json (13)

4-4: Verify VS Code extension publisher ID
Ensure that the publisher field ("DocDetective") exactly matches your publisher ID on the VS Code Marketplace (including case sensitivity) to avoid packaging or publishing errors.


5-5: Extension description is concise and clear
The new description succinctly explains the extension’s purpose and adheres to VS Code Marketplace guidelines.


11-11: Confirm vscode engine version requirement
Raising the minimum engine to ^1.100.0 may exclude users on older VS Code releases. Ensure that your new webview features or APIs indeed require VS Code 1.100.0 or higher.


18-21: Activation events correctly configured
The extension now activates on the defined commands and the docDetectiveView webview, ensuring the sidebar panel loads when invoked.


23-23: Verify main entrypoint aligns with build output
Ensure your webpack configuration emits extension.js into the dist directory so that "main": "./dist/extension.js" correctly points to the bundled extension file.


25-40: Verify contributed commands and icons
Ensure each command ID is registered in your activation code (extension.ts) and that the specified icons ($(refresh), $(list-flat)) correspond to valid VS Code codicons.


46-48: Ensure docDetective.configPath default is handled
With an empty-string default, confirm your extension code correctly falls back to searching for .doc-detective.json, .yaml, or .yml in the workspace root when no path is provided.


51-63: Menu contributions look good
The view/title menus correctly scope the refresh and simple view commands to the docDetectiveView context and group them under navigation.


65-73: Validate sidebar icon path
Ensure that media/dd-mono.png is included in your published package and renders correctly in the Activity Bar for the docDetectiveSidebar.


75-83: Webview view registration is correct
The docDetectiveView is properly declared under the docDetectiveSidebar container as a webview, matching your extension’s UI implementation.


88-88: Verify license field matches LICENSE file
Ensure that "license": "AGPL-3.0-only" aligns with the SPDX identifier and content in your LICENSE file.


90-99: Validate build and test scripts
Please verify that npm run compile, npm run pretest, and npm test execute successfully in CI, and that the vscode-test script correctly runs your integration tests.


115-118: Runtime dependencies look appropriate
The extension’s runtime dependencies (@vscode/vsce, doc-detective-resolver, js-yaml) align with your build and configuration loading requirements.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ hawkeyexl
❌ coderabbitai[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

hawkeyexl added 3 commits May 22, 2025 14:54
- Changed command identifiers from 'doc-detective-vsc' to 'doc-detective' for consistency.
- Updated the activation function to reflect the new command names.
- Enhanced test suite to verify extension activation and command registration.
- Added tests to ensure the WebView provider is properly registered.
- Replaced synchronous file reading with asynchronous reading in loadConfigFile.
- Introduced a new async function fileExists to check for file accessibility.
- Updated findConfigFile to utilize the new fileExists function for checking config file existence.
- Introduce instructions for specifying a custom path to the Doc Detective configuration file.
- Detail the options for absolute and relative paths.
- Clarify the automatic search for configuration files in the workspace root.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
package.json (1)

7-9: Consider using a standard funding field instead of sponsor
The npm ecosystem expects a funding property for sponsorship URLs. You may optionally rename this block to:

"funding": {
  "url": "https://github.com/sponsors/doc-detective"
},

This will ensure compatibility with npm’s npm fund command.

README.md (1)

50-53: Signature styling triggers lint warning MD036
You’re using bold emphasis for a signature, which the linter may treat as a heading. Consider either disabling MD036 for this line or converting it into a regular paragraph or blockquote:

- **Made with ❤️ by the Doc Detective team**
+ _Made with ❤️ by the Doc Detective team_ <!-- markdownlint-disable-line MD036 -->
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

52-52: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f79772 and 8446602.

⛔ Files ignored due to path filters (2)
  • dist/extension.js is excluded by !**/dist/**
  • dist/extension.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (4)
  • README.md (1 hunks)
  • package.json (1 hunks)
  • src/extension.ts (1 hunks)
  • src/test/extension.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/test/extension.test.ts
  • src/extension.ts
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

52-52: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)

🔇 Additional comments (19)
package.json (10)

4-5: Publisher and description look good
The publisher and description fields accurately reflect the VS Code Marketplace metadata and new functionality.


11-12: Verify the VS Code engine requirement
You’ve bumped the vscode engine to ^1.100.0. Please confirm that this version aligns with the earliest VSCode release supporting your new Webview APIs—otherwise users on earlier versions won’t be able to install the extension.


23-24: Main entry point updated correctly
Switching main to ./dist/extension.js aligns with your new Webpack output.


44-48: Configuration defaults and description are clear
The docDetective.configPath default and its detailed description match the code’s fallback logic.


51-63: Menu contributions for the sidebar view look correct
Including refresh and simpleView commands in the view/title menu ensures a cohesive UX when the docDetectiveView is active.


65-82: Sidebar container and views are properly declared
The new viewsContainers.activitybar and views entries correctly register the webview in the activity bar and sidebar.


84-89: Repository and license fields updated
Switching to https://github.com/doc-detective/vscode.git and AGPL-3.0-only aligns with your project restructure.


90-99: Build and test scripts are comprehensive
The new compile, watch, package, compile-tests, and lint commands reflect the TypeScript/Webpack setup.


101-113: DevDependencies align with the new toolchain
The updated ESLint, TypeScript, and VSCode test CLI packages match your modernized build pipeline.


115-118: Runtime dependencies correctly include new resolver and YAML support
Adding doc-detective-resolver and js-yaml is necessary for your scanning logic in the webview.

README.md (9)

1-4: Title and introduction updated for clarity
The new heading “Doc Detective VSCode Extension” and descriptive paragraph clearly explain the extension’s purpose.


7-11: Features section is concise and focused
The bullet list covers real-time detection, sidebar integration, interactive explorer, and syntax highlighting—exactly what users need to know.


12-15: “How It Works” section aligns with implementation
Your description of doc-detective-resolver integration matches the new scanning logic in src/extension.ts.


16-19: Requirements reflect the updated engine version
Specifying “Visual Studio Code v1.100.0 or higher” matches package.json.


20-25: Usage instructions are clear and actionable
Step-by-step guidance helps users get started with minimal friction.


26-30: Supported test formats are accurately listed
Including HTML/markdown comments, YAML, and JSON specs aligns with your parser capabilities.


31-39: Related projects links are up-to-date
The GitHub URLs correctly point to the Doc Detective CLI, resolver, core, and common repos.


40-45: Learn More section provides essential resources
Linking to documentation, repo, and community ensures users can find additional help.


46-49: Contributing call-to-action is inviting
Directing contributors to the GitHub organization makes it easier to onboard new maintainers.

@hawkeyexl hawkeyexl merged commit 8b5c23e into main May 22, 2025
4 of 5 checks passed
@hawkeyexl hawkeyexl deleted the nect branch May 22, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants