redhat-developer / redhat-developer/vscode-yaml
Path with ( causes "SyntaxError: Invalid regular expression" duplicate of #3475 in redhat-developer/vscode-java
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Same error already issued in vscode-java#3475
https://github.com/redhat-developer/vscode-java/issues/3475
Describe the bug
Due to naming conventions and limitations of windows, my username has an opening bracket in it.
This bracket causes a SyntaxError since the path to %APPDATA% gets evaluated as regular Expression
2024-10-15 12:38:07.237 [error] Activating extension redhat.java failed due to an error:
2024-10-15 12:38:07.237 [error] SyntaxError: Invalid regular expression: /c:\Users\myName(Gro\AppData\Roaming\Code\User\workspaceStorage\XXxXXXXXXxxXxxxXXXxXXxxXxXxXXXXx\redhat.java\client.log.2024-10-15/: Unterminated group
at String.match (<anonymous>)
at c.getStream (c:\Users\myName(Gro\.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:293676)
at new f (c:\Users\myName(Gro\.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:1418356)
at t.initializeLogFile (c:\Users\myName(Gro\.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:940453)
at c:\Users\myName(Gro\.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:899088
at Generator.next (<anonymous>)
at s (c:\Users\myName(Gro\.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:890832)
2024-10-15 12:38:07.364 [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.
2024-10-15 12:38:07.467 [info] Eager extensions activated
Expected Behavior
No Error
Current Behavior
Error visible
Steps to Reproduce
Have opening bracket in user path
Environment
- Windows
- Mac
- Linux
- other (please specify)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked duplicate, vscode-java#3475, and the reported stack trace in dist/extension.js, especially String.match and c.getStream. Reproduce on Windows with an opening bracket in the user path, then verify that extension activation completes without the reported regular-expression error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100