Skip to content

[bug] Auto-suggestion dropdown breaks queries with whitespace in repo names #687

@Monarch73

Description

@Monarch73

Describe the bug

When using the repo: key in the search box, queries fail if the repository name contains whitespace. The auto-suggestion dropdown generates queries without quotes, causing the regex to break. Manually enclosing the repository name in quotes fixes the issue.

To reproduce

Open the search box in the application.
Start typing repo: followed by a repository name that includes whitespace (e.g., repo:My Project).
Select the auto-suggested query from the dropdown.
Execute the search.

Expected Behavior:
The query should correctly handle whitespace and return results for the specified repository.
Actual Behavior:
The query fails (empty result) because the whitespace breaks the regex pattern.
Workaround
Manually add quotes around the repository name (e.g., repo:"My Project") or use \s in the regex.

Sourcebot deployment information

Sourcebot version (e.g. v3.0.1):

Additional information

No response

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions