Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix clicking on URLs in the terminal (for VS Code users) #48
EDIT: I misunderstood the original problem as I did this PR. I've left most of what I've written in place but please do read all the way to the end. It will all make a little more sense then I promise
The motivation behind this PR has very little to do with getting reported errors closer to ts-loader's "style". (I honestly have no opinion on the style as is.) This PR essentially flows from my addiction to using VS Code as my editor. Let me explain. At present the formatted output of an error looks like this:
Which is great in terms of information. However; there's a gotcha. When using the integrated terminal in VS Code I like being able to click on a file in the terminal and navigate straight there. The existing formatting in the
EDIT: I misunderstood the reason this wasn't "clickable" - read on and you'll see more.
This is clickable in VS Code
My team is running with this fork locally now (
What do you think about this? I'd really like to get this merged. More generally I think there could be some work done to allow people to supply their own formatters but in a future PR perhaps.
Yeah - the actual issue with not being able to click the URLs was the colours. The formatting used to switch colours partway through the message; as it moved from the filename to the error line / column. That's hard to understand; this should clarify it:
This colour change screwed up the link clickability which is what got me looking at this in the first place.
Anyway, the fix was simple; just keep the same colour for the filename, line number and column number. This fixes the issue completely; files open when you click on them and to the exact position of the lint / error in question!
So I think this is good to merge now - sorry for my original misdiagnosis of the issue.
Details of a workaround for those waiting on this PR being merged: https://blog.johnnyreilly.com/2017/09/fork-ts-checker-webpack-plugin-code.html