Skip to content

Link to a file position in Output Channel #586

Open

Description

From Artem Govorov (@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

Activity

  1. seanmcbreen commented on Nov 24, 2015

    @seanmcbreen
    Author

    From Benjamin Pasero (@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>.

  2. seanmcbreen commented on Nov 24, 2015

    @seanmcbreen
    Author

    From Artem Govorov (@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?

  3. seanmcbreen commented on Nov 24, 2015

    @seanmcbreen
    Author

    From Benjamin Pasero (@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.

    Dirk Bäumer (@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?

  4. seanmcbreen commented on Nov 24, 2015

    @seanmcbreen
    Author

    From Dirk Bäumer (@dbaeumer) on November 16, 2015 10:34

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

  5. added
    feature-request
    and removed on Nov 25, 2015
  6. farfromrefug commented on Aug 20, 2016

    @farfromrefug

    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.

  7. bpasero commented on Aug 20, 2016

    @bpasero
    Contributor

    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.

  8. TurkeyMan commented on Sep 19, 2016

    @TurkeyMan

    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?

  9. 12 remaining items

  10. added
    output
    and removed on Nov 16, 2017
  11. Apoorva-GA commented on Dec 15, 2017

    @Apoorva-GA

    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?

  12. AustinW4t1qbit commented on Jan 17, 2018

    @AustinW4t1qbit

    Are there working workarounds for this right now for OSX?

  13. AndreasLuckert commented on Sep 17, 2019

    @AndreasLuckert

    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 "::".

  14. zcfh commented on Jan 12, 2021

    @zcfh

    image
    Is this problem still unresolved?
    Is there any special treatment for this first path? It can be opened, but the following can not click.
    I run channel.appendLine('/Users/zcfh/myTest/vscode_test/xmake-vscode/src/terminal.ts: error'), output can not click.
    image

    Running cmake-tool through code can use cmd + click in the output panel.Did the cmake-tool extension do any special operations?
    image

  15. zcfh commented on Jan 12, 2021

    @zcfh

    image
    Is this problem still unresolved?
    Is there any special treatment for this first path? It can be opened, but the following can not click.
    I run channel.appendLine('/Users/zcfh/myTest/vscode_test/xmake-vscode/src/terminal.ts: error'), output can not click.
    image

    Running cmake-tool through code can use cmd + click in the output panel.Did the cmake-tool extension do any special operations?
    image

    I may find the reason, because I needed to provide highlighting for the output pannel before, so I customized tmlanguage. But I still don’t know how to solve this problem.

  16. zcfh commented on Jan 12, 2021

    @zcfh

    image
    Is this problem still unresolved?
    Is there any special treatment for this first path? It can be opened, but the following can not click.
    I run channel.appendLine('/Users/zcfh/myTest/vscode_test/xmake-vscode/src/terminal.ts: error'), output can not click.
    image
    Running cmake-tool through code can use cmd + click in the output panel.Did the cmake-tool extension do any special operations?
    image

    I may find the reason, because I needed to provide highlighting for the output pannel before, so I customized tmlanguage. But I still don’t know how to solve this problem.
    pakcage.json

      "languages": [
          {
              "id": "output-test",
              "mimetypes": [
                  "text/x-code-output"
              ],
              "configuration": "./language-configuration.json"
          }
      ],
      "grammars": [
          {
              "language": "output-test",
              "scopeName": "source.text",
              "path": "./syntaxes/output-test.tmLanguage.json"
          }
      ],
    {
        "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
        "name": "Output-test",
        "patterns": [],
        "scopeName": "source.text"
    }

    After deleting mimetypes, the absolute path of the file in the workspace can be clicked.
    image

    Can I use cmd+click path while customizing output highlighting?

  17. johandanforth commented on Feb 3, 2021

    @johandanforth

    Regards to dotnet build and OmniSharp, ctrl+click on an error doesn't work if path contains spaces.

  18. smm-h commented on Apr 12, 2021

    @smm-h

    Currently three things could be improved about this:

    1. Making relative to workspace paths also clickable and not just absolute ones.
    2. Making paths with spaces in them clickable.
    3. Allowing custom text to act as clickable.
  19. Toxicable commented on Jul 21, 2022

    @Toxicable

    I'm sure this had previously been working well when you have a TypeScript output like

    some/file.ts:72:35 - error TS2322
    

    However, something recently changed and now when ctrl + clicking a link like that takes me to the top of the file and not the line number

  20. gg569 commented on Dec 15, 2024

    @gg569

    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

  21. orxanhuseynzade47-del commented on Oct 1, 2025

    @orxanhuseynzade47-del
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestoutput

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions