Skip to content

Conversation

vivganes
Copy link
Contributor

This PR does 2 things:

  1. Fix the failing (and currently skipped) unit test looksLikeCode - detects Markdown as non-code
  • Any line that starts with # followed by a space is most probably a markdown.
  • Except: C++ or C preprocessor directives like # include <stdio.h>
  • Python comment is another case, but we cannot detect them deterministically.
  1. Unskip already passing tests in codeGuesser.spec.ts

@Copilot Copilot AI review requested due to automatic review settings September 15, 2025 21:09
Copy link
Contributor

@Copilot 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 fixes failing unit tests for markdown detection in the code guesser functionality and unskips previously passing tests. The changes improve the accuracy of distinguishing between markdown content and actual code.

  • Fix markdown detection logic to properly identify markdown headers while preserving C/C++ preprocessor directive detection
  • Unskip three previously passing tests that were disabled
  • Add a new test case for C++ preprocessor directives to ensure they're still correctly identified as code

Reviewed Changes

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

File Description
src/extension/prompt/common/codeGuesser.ts Added markdown header detection logic with C/C++ preprocessor directive exception handling
src/extension/prompt/node/test/codeGuesser.spec.ts Unskipped passing tests and added new test case for C++ preprocessor directives

@vivganes vivganes force-pushed the fix-failing-tests-for-markdown-detection branch from 3da45b4 to a6b283c Compare October 1, 2025 02:24
@vivganes
Copy link
Contributor Author

vivganes commented Oct 1, 2025

@ulugbekna I wanted to check if you got a chance to look at this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants