Skip to content

Regression in Search: Literal Search Misses Matches That Regex Finds #280939

@niontchev-endurosat

Description

@niontchev-endurosat

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.106.3
  • OS Version: Windows 11 Enterprise/26100.7171

Steps to Reproduce:

  1. Open a C/C++ project with these lines:
    //#define HAVE_VERBOSE_MESSAGES /* Recommended during development prints errors and warnings */#if defined(HAVE_VERBOSE_MESSAGES)Show more lines
  2. Search for HAVE_VERBOSE_MESSAGES with regex disabled.
  3. Enable regex and search again.
  4. Compare results.

Comments:
The new search implementation in VS Code appears to have a regression. When searching for a simple string like HAVE_VERBOSE_MESSAGES when Regular Expression enabled/disabled:

  1. Regex disabled (literal search): Finds only one match in the header where it is defined:
    /#define HAVE_VERBOSE_MESSAGES /* Recommended during development prints errors and warnings */
  2. Regex enabled: Finds two matches (both correct) in the definition header and in another file:
    -- first match
    /#define HAVE_VERBOSE_MESSAGES /* Recommended during development prints errors and warnings */
    -- SECOND MATCH
    #if defined(HAVE_VERBOSE_MESSAGES)

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugsearchSearch widget and operation issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions