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
$tsc-watch
background problem matcher is locale specific
#46373
Comments
(Experimental duplicate detection) |
For now I will add a.m. and p.m. to the patterns. If we detect more locale variants for am / pm we need to investigate if we go with a different solution. |
I did a quick check with the locales found in this StackOverflow post check using
|
@victorandree thanks. I will reopen the issue and see what a better solution would be. |
Supporting localized problem matchers is more of a feature than a bug. |
@mjbvz I've gotten a whole bunch of these issues recently. Do you think it would be safe to match on just the the [hh:mm:ss] pattern and accept any other characters before or after the times? That would capture most of these times. |
That sounds reasonable to me. Do you want to make the change or should I? |
Sweet. I made the change and confirmed that English still works. I'll follow up with the people who hit this in other issues after we have an Insiders build and see if they can verify it. |
The tsc problem matchers can't be made completely locale agnostic, but closing since this should be improved over the previous behavior. |
@alexr00 please add a test plan or verification needed |
To verify, make sure that problems in English can still be detected with the $tsc-watch problem matcher. If you happen to also have a machine with a language other than English that uses one of the other separators, verify there too (not required). |
The
beginsPattern
andendsPattern
for the$tsc-watch
problem matcher match on lines where the time is reported in a specific format (11:12:13 PM
). The tsc watch output, however, usestoLocaleTimeString
which changes depending on your locale (e.g.11:12:13 p.m.
). This results in the task never ending if your locale is wrong.From extensions/typescript/package.json:
Output from
tsc-watch
on my machine is:A quick test shows that this doesn't match the
endsPattern
in package.json, because my AM/PM is capitalized the way it is. If I create a custom matcher, the task finishes successfully.Is it necessary to match the full line? If not, simply matching the end of each line might be sufficient (expressions not JSON escaped).
It's probably not a fun project to try and build a regex capturing all different ways to format times, so maybe the liberal
^\s*(?:message TS6042:|.*? -)
could work if you want a pattern for the full line?I'm running the latest version of relevant software:
* This format seems pretty Node/v8 specific, because I really use 24 hour time and in Language & Region in System Preferences, I do have AM/PM as the chosen before/after noon markers. If run
new Date().toLocaleTimeString()
innode
, I get the above formatting (node 9.8.0) -- but in Chrome it's 24 hour time.Here's a full tasks.json which could work for other people:
I'm pretty sure the diagnostic is generated by TypeScript in createWatchStatusReporter in src/compiler/watch.ts:
The text was updated successfully, but these errors were encountered: