Skip to content

Parsing of .gitignore files doesn't match git, causing cmd+p to not find any files #202118

@verhovsky

Description

@verhovsky

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

VS Code Version:

Version: 1.85.1
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:48:16.874Z (3 wks ago)
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 23.2.0

Steps to Reproduce:

Simple:

git clone https://github.com/gskinner/regexr.git
cd regexr
git checkout 1e382719041f8b1e5290472e14e2c98a6c05b61a
code .

and then Press Cmd+p and type in any of the file names you see.

Manually:

  1. Create a new directory
  2. git init
  3. create some files and commit them
  4. add the following .gitignore:
#-----------------------------
# INVALID FILES
# (for cross OS compatibility)
#-----------------------------
*[\<\>\:\"\/\\\|\?\*]*
  1. commit it
  2. Open the project in VS Code to search for any of the files you created with Cmd+P

It will not find any files unless you have them open in the editor already.

Screenshot 2024-01-09 at 20 50 59

Removing the line and saving causes files to be found again

Screenshot 2024-01-09 at 20 52 08

I found this regex in a project I cloned and it seems that git must parse it differently because obviously git is not ignoring all the files.

This issue is a follow up to #48771

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugconfirmedIssue has been confirmed by VS Code Team membersearchSearch widget and operation issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions