-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Add fileName as prefix to error message to support Visual Studio #356
Conversation
This allows Visual Studio to search the output of ts-loader for errors and show them in its error list. See https://msdn.microsoft.com/en-us/library/yxkt8b26.aspx for a description of the format. The path is normalized so the platform's path separator is used (Visual Studio doesn't handle those forward slashes very well - i.e. jumping to the line number does not work).
I wonder if this should be behind a flag (not advocating that it should be, just thinking out loud). The existing format is really meant to be compatible with other webpack output, and having the file name twice seems kind of repetitive. On the other hand, having the output display in Visual Studio seems useful for those who use it. |
Yes, this would be better if someone attempts to parse the exact output. But I am not sure how the tests could be modified to fit this behaviour. |
Ah - yes I think I misunderstood your original issue. I'd say that I agree with @jbrantly that if this goes in it should definitely behind a flag as for the general use case as we'd want ts-loader to remain consistent with WebPack. Would you be willing to amend your PR to put this behind a flag called something like |
If you're after a good candidate |
Yes sure - I will be making that change tomorrow morning. It feels a lot better to just add a test/feature than breaking existsing stuff. Just for giggles: |
OUCH 😄 |
See GitHub PR TypeStrong#356: Revert changes to test cases as preparation to make Visual Studio output configurable
Sorry for the delay, but I got sick on friday. I implemented the changes:
I am not quite sure if the tests with |
Cool - could you update the documentation in the readme with the new option please? |
Done. |
Thanks! |
One more question: is it possible to reference the latest version through npm or do i have to reference my fork? |
You can reference ts-loader on GitHub now your fork has been merged in. It's not been published to npm yet. |
Ok, thanks! |
This allows Visual Studio to search the output of ts-loader for errors and show them in its error list.
See https://msdn.microsoft.com/en-us/library/yxkt8b26.aspx for a description of the format.
The path is normalized so the platform's path separator is used (Visual Studio doesn't handle those forward slashes very well - i.e. jumping to the line number does not work).