-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm][debugger] Revert don't need to escape special characters anymore #78320
Conversation
Tagging subscribers to this area: @thaystg Issue DetailsIf is a letter or a digit we don't need to escape which is the case of the swedish characters reported in #76777
|
Manual testing I've done - everything is OK:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only I don't understand the details of the colon-project change.
} | ||
|
||
[Fact] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows))]
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or [PlatformSpecific(TestPlatforms.AnyUnix)]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it doesn't work, it's trying to run it on windows:
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)]
| [2022-11-24T14:57:59] DevToolsProxy-0 Debug: sending error response for id: msg-:::5 -> [Result: IsOk: False, IsErr: True, Value: , Error: {
| "message": "Assembly 'debugger-test-with-colon-in-source-name.dll' not found,needed to get method location of 'DebuggerTests.CheckColonInSourceName:Evaluate'"
| } ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same error with this option:
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows))]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right: it looks like this one will work: [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsLinux))]
private static string EscapeAscii(string path) | ||
{ | ||
var builder = new StringBuilder(); | ||
foreach (var part in Regex.Split(path, @"([:/])")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The :
is needed only for windows. And for !windows, we can do a regular string split on /
.
If we must use regex here, then maybe move it to a static readonly field.
If is a letter or a digit we don't need to escape which is the case of the swedish characters reported in #76777