Skip to content
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

Link to a file position in Output Channel #586

Open
seanmcbreen opened this issue Nov 24, 2015 · 21 comments
Open

Link to a file position in Output Channel #586

seanmcbreen opened this issue Nov 24, 2015 · 21 comments

Comments

@seanmcbreen
Copy link
Contributor

@seanmcbreen seanmcbreen commented Nov 24, 2015

From @ArtemGovorov on October 19, 2015 2:0

As mentioned in this issue, output channel supports link rendering. I'd like to append a link to a workspace file position (by providing a file name, line and column in some form). If it's already possible, could you please paste an example on how to do it?

Copied from original issue: Microsoft/vscode-extensionbuilders#41

@seanmcbreen

This comment has been minimized.

Copy link
Contributor Author

@seanmcbreen seanmcbreen commented Nov 24, 2015

From @bpasero on October 19, 2015 6:15

You should be able to link to a file line and column with the syntax <path>:<line>:<column>.

@seanmcbreen

This comment has been minimized.

Copy link
Contributor Author

@seanmcbreen seanmcbreen commented Nov 24, 2015

From @ArtemGovorov on October 19, 2015 6:36

Thanks, I have been trying the syntax, didn't work for me with a relative path. Only works with a full path.

Is it possible to make it work with paths relative to the opened project/folder?

Also, is it possible to supply a custom text, but still render it as a file position link?

@seanmcbreen

This comment has been minimized.

Copy link
Contributor Author

@seanmcbreen seanmcbreen commented Nov 24, 2015

From @bpasero on October 19, 2015 7:5

I see. We have a limited set of default patterns that we use to match against the output to show links. Currently relative paths are not in there.

@dbaeumer can also comment maybe. I think it is possible to contribute patterns from a task to control links in the output, but I might be wrong?

@seanmcbreen

This comment has been minimized.

Copy link
Contributor Author

@seanmcbreen seanmcbreen commented Nov 24, 2015

From @dbaeumer on November 16, 2015 10:34

@bpasero: no the task framework doesn't contribute any link patterns. There is no API to do so.

@farfromrefug

This comment has been minimized.

Copy link

@farfromrefug farfromrefug commented Aug 20, 2016

Is there any news on this?
I really need this. I would be ok writing an extension to handle this. But we would need an API to interact with the output.

@bpasero

This comment has been minimized.

Copy link
Member

@bpasero bpasero commented Aug 20, 2016

Thanks so much for your interest in this issue! It is currently assigned to the backlog. Every month we pick items from the backlog to plan for the current iteration. Please see https://github.com/Microsoft/vscode/wiki/Issue-Tracking#planning for more information.

Since we are a small team of developers, there is only so many feature requests and issues we can work on for one milestone. Nevertheless we always welcome pull requests and are happy to accept them if they meet our quality standards.

@TurkeyMan

This comment has been minimized.

Copy link

@TurkeyMan TurkeyMan commented Sep 19, 2016

How is this not maximum priority? O_0
And how is it that there isn't a sea of complaints here... there must be some workaround that people are using?

@ArtemGovorov

This comment has been minimized.

Copy link
Contributor

@ArtemGovorov ArtemGovorov commented Sep 20, 2016

We are using the vscode.languages.registerDocumentLinkProvider for this. Like this:

vscode.languages.registerDocumentLinkProvider({language: 'wallaby-output'}, {
        provideDocumentLinks: doc => {
          ...
        }
});

where the wallaby-output is our output channel language name, but for now unfortunately we have to apply it for all output channels (using "text/x-code-output" mimetype):

"contributes": {
    ...
    "languages": [
      {
        "id": "wallaby-output",
        "mimetypes": [
          "text/x-code-output"
        ]
      }
    ],
    ...
  },

Once this feature request is implemented, and specifying a language for an output channel is allowed, one could simply add any custom link provider to custom output channels.

@ChuckJonas

This comment has been minimized.

Copy link

@ChuckJonas ChuckJonas commented Nov 3, 2016

Links don't seem to work for me even when I format them <path>:<line>:<column> with abs path

Example:
/Users/jonas/Documents/mm/Project/src/classes/MyClass.ts:9:1

@GarethLewin

This comment has been minimized.

Copy link

@GarethLewin GarethLewin commented Feb 3, 2017

Could we consider this to be taken out of the backlog please?

The different golang tools create relative paths, for example

./server_test.go:45: undefined: newServer

wayou added a commit to wayou/vscode-todo-highlight that referenced this issue Mar 1, 2017
@wayou

This comment has been minimized.

Copy link

@wayou wayou commented Mar 2, 2017

I find out that on Unix <path>:<line>:<column> this pattern works while on Windows is <path>#<line>

@FrankCai

This comment has been minimized.

Copy link

@FrankCai FrankCai commented Mar 19, 2017

+1

@linw1995

This comment has been minimized.

Copy link

@linw1995 linw1995 commented Apr 6, 2017

Can apply the same on the debug and terminal? manipulate the output

@andy-wood

This comment has been minimized.

Copy link

@andy-wood andy-wood commented Apr 12, 2017

There are many extensions currently using the path#line format, and this appears to be broken across the board on Mac right now.
vscode_error

@zjhmale zjhmale mentioned this issue Apr 14, 2017
1 of 3 tasks complete
@hendrics

This comment has been minimized.

Copy link

@hendrics hendrics commented May 20, 2017

I wonder if this issue can be prioritised during planning for the next iteration?
It seems that at least 5 issues were consolidated into this with 12 participants at this stage.
Linking the output window to the place in the code is one of the nicest features in eclipse for example. It works there simply by defining a problem matcher. Thank you for all the hard work. I believe this update could really make vscode eclipse other editor! (sorry, couldn't resist :) )

@felocru

This comment has been minimized.

Copy link

@felocru felocru commented Aug 3, 2017

I'm on linux, apparently the pattern <file>#<line> works.
Version:
VS: 1.14.2
Shell: 1.6.6
Node 7.4.0

So I had to put:
todohighlight.toggleURI to true

@dostrog

This comment has been minimized.

Copy link

@dostrog dostrog commented Oct 19, 2017

On MAC. There is an error

screen shot 2017-10-19 at 10 33 40

@sarbash

This comment has been minimized.

Copy link

@sarbash sarbash commented Nov 13, 2017

I have the same trouble on Linux with the latest code version (1.18.0)
As in the home as in the work.
As on Debian as on Ubuntu.
Links in the output panel of "TODO Parser" plugin don't work.
I've switched from path:file:line:char to path#file#line#char forth and back with no success.
default

@bpasero bpasero added output and removed workbench labels Nov 16, 2017
@Apoorva-GA

This comment has been minimized.

Copy link

@Apoorva-GA Apoorva-GA commented Dec 15, 2017

If the file path has a space in the file name. VSCode treats link only until the space is found. Is there a way to get around this problem?

How to handle links in output channel with space in the filename?

@AustinW4t1qbit

This comment has been minimized.

Copy link

@AustinW4t1qbit AustinW4t1qbit commented Jan 17, 2018

Are there working workarounds for this right now for OSX?

@AndyLuckert

This comment has been minimized.

Copy link

@AndyLuckert AndyLuckert commented Sep 17, 2019

Even though this issue has been closed already, I didn't get how to implement what'd been said under
#586 (comment) in order to achieve the desired output:

Where do I have to insert "::" (in combination with "Callstack.itemToString()" ??) that the vs-code console shows me something like
"~/path/script.py in project_variable_return(..), line 66" I can jump directly to via Ctrl + Left-click, instead of having (in my case the default) output where only the file is clickable, but not the line mentioned in the error output:
~/path/script.py in project_variable_return(..)
64 blabla = "bla"
65 if not os.path.exists(blabla):
---> 66 os.mkdir(blabla)

Thanks in advance for stating more clearly how (or WHERE) to implement "::".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.