Skip to content

fix: escaped regex chars in pattern #1622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2022
Merged

fix: escaped regex chars in pattern #1622

merged 1 commit into from
Nov 10, 2022

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Nov 3, 2022

Motivation

If regex patterns are not correctly escaped, they will break. Such as the File > Sketchbook issue when there is a sketch with the following invalid name: bar++.

Change description

  • Reuse the regex pattern escape mechanism from VS Code.
  • Remove strict is-valid-path check. Otherwise, on Windows, it's impossible to open a sketch in the following way: "Arduino IDE.exe" "..\\..\\Documents\\Arduino\\bar++" input will give a false negative result.

Other information

Closes #1600

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Nov 3, 2022
@kittaakos kittaakos marked this pull request as ready for review November 7, 2022 15:17
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

I verified this fixes #1600

Thanks Akos!

Closes #1600

Signed-off-by: Akos Kitta <[email protected]>
Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

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

Code looks good.

I tested the latest changes (from ~20 mis ago) locally and it works perfectly for me.

@kittaakos kittaakos merged commit f6d112e into main Nov 10, 2022
@kittaakos kittaakos deleted the #1600 branch November 10, 2022 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Sketchbook" menu missing if sketch name is invalid regex
3 participants