IBM-Cloud / vscode-log-output-colorizer

Language extension for VSCode that adds syntax colorization for both the output/debug/extensions panel and *.log files.
https://marketplace.visualstudio.com/items?itemName=IBM.output-colorizer
MIT License
111 stars 28 forks source link

[FR] link/file detection #8

Closed farfromrefug closed 7 years ago

farfromrefug commented 7 years ago

I know it's kind of out of that extention's name scope but as you already regex the output ... Would be awesome to detect file/links/errors in output

triceam commented 7 years ago

What do you mean by "file/links/errors in output"? this should already work for the output panel. Do you mean the Debug Console?

farfromrefug commented 7 years ago

Oh sorry i mean detect things like this:

/Volumes/data/dev/Movea/mtools/trunk/common/Models/mtuserprofile.cpp:252:122: error: invalid operands to binary expression ('basic_ostream<char, std::__1::char_traits<char> >' and 'std::vector<std::string>'
      (aka 'vector<basic_string<char, char_traits<char>, allocator<char> > >'))

This would be awesome, that way you can go directly at the source of the error. The thing is that i know there are multiple ways of showing it. But getting a way to link to errors from the output would be such a great help.

EDIT: actually i think i might clone your extension and create a new one just for that. Kind of make sense

ArtemGovorov commented 7 years ago

this should already work for the output panel.

It does work without the extension, so the extension seem to break it. When I install the extension, I get colours, but the built-in link detection doesn't work anymore.

triceam commented 7 years ago

I still see clickable links, at least for URLs. Ex:

image

and

image

Are you seeing this specifically for filesystem links? Or, do you mean that this used to get highlighted?

/Volumes/data/dev/Movea/mtools/trunk/common/Models/mtuserprofile.cpp

ArtemGovorov commented 7 years ago

Are you seeing this specifically for filesystem links?

Correct, for absolute paths like /a/b/c/file.txt.

triceam commented 7 years ago

ok, thx. I'll have to look into this one... I see the problem. Now, I just have to fix it without breaking other regex. :)

kaestlyn commented 7 years ago

Any movement on this? We have something like c:\Some\Path\to\file.ext:233:38 which normally is picked up as a link by VSCode, but once I install this extension, it's no longer a link.

felipegtx commented 7 years ago

I too am interested in this feature/fix!

triceam commented 7 years ago

Thanks everyone - I totally forgot about this one. let me see what I can do...

farfromrefug commented 7 years ago

I actually found the fix for this, and its really easy! Simply change your language id from log to Log. This is what vscode expects

kaestlyn commented 7 years ago

Nice @farfromrefug - I've sent a PR with the fix!

triceam commented 7 years ago

Nice find! I am away until Monday, but will check it out (and hopefully push a release) when I get back.

Sent from my iPhone

On Dec 29, 2016, at 9:20 AM, Tyler Lamb notifications@github.com wrote:

Nice @farfromrefug - I've sent a PR with the fix!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

triceam commented 7 years ago

Just pushed a build with this fix. Can you pull from the marketplace and verify for me? Thx

triceam commented 7 years ago

Its working for me for both http:// and file:// URIs. Not sure about the other error conditions people were seeing.

triceam commented 7 years ago

@ArtemGovorov @twlamb with the colorizer extension uninstalled, Either I'm blind, or I don't see links like this getting recognized: /a/b/c/file.txt Is there some other extension you have installed that might be recognizing them?

I've tried both .log files and the output panel. Can anyone confirm if this fixed worked? Only http(s) and file URIs appear for me.

kaestlyn commented 7 years ago

I'd guess if VSCode doesn't make them links w/o your extension, not sure how you could make them, the only thing I noticed is VSCode tags links with the class "detected-link".

Things such as "c:/whatever/path/file.txt" get picked up just fine as well as "c:/whatever/path/file.txt:13:23"

triceam commented 7 years ago

To clarify, those windows file paths are working for you with the Colorizer extension? I'm on a mac, and they don't get recognized for me.

kaestlyn commented 7 years ago

Yes they are working with the Colorizer extension on Windows.

triceam commented 7 years ago

Thanks! I'll consider this issue closed then. 😄