Skip to content

Support relative paths for markdown images in doc comments #2390

Open

Description

@jifalops

I'm trying to have an image appear for each IconData in our icon font, similar to Icons.foo in Flutter.

I finally got the images generated from the .ttf file, but they only show correctly in the doc-comment-popup if it uses an absolute path to the image, which means it won't work for anyone else.

// Works
/// ![icon](/home/jacob/the_project/doc/icons/icon.png|width=32,height=32)
static const icon = IconData(\x0000, fontFamily: 'MyFont');

// Does not work
/// ![icon](doc/icons/icon.png|width=32,height=32)
static const icon = IconData(\x0000, fontFamily: 'MyFont');

I have tried relative paths:

  • plain (like above)
  • with leading ./
  • with leading / (html style)
  • using .../../.. as necessary to navigate from the file to the root of the project
  • using <img src="">

Activity

  1. DanTup commented on Apr 23, 2020

    @DanTup
    Member

    Thanks for the report! The markdown here is rendered by VS Code, so this would be best fixed there (the same bug exists in other languages - the relative path is resolved from the VS Code application folder). I've opened an issue you can put a 👍 on here:

    microsoft/vscode#95947

  2. added
    upstream in vs code / lsp / dap
    on Apr 23, 2020
  3. added this to the On Deck milestone on Apr 23, 2020
  4. DanTup commented on May 4, 2020

    @DanTup
    Member

    The VS Code issue was closed as a dupe of microsoft/vscode#86564. I'll close this as a dupe too, as I believe once fixed in VS Code, it'll just work here. Thanks!

  5. removed this from the On Deck milestone on May 4, 2020
  6. DanTup commented on May 26, 2022

    @DanTup
    Member

    I suspect this won't get done without a contribution to the VS Code LSP Client, so re-opening this as a placeholder/reminder.

  7. reopened this on May 26, 2022
  8. added
    is enhancement
    in editor
    and removed
    upstream in vs code / lsp / dap
    on May 26, 2022
  9. added this to the v3.44.0 milestone on May 26, 2022
  10. changed the title [-]Relative path resolution for markdown images in doc comments.[/-] [+]Support relative paths for markdown images in doc comments[/+] on May 26, 2022
  11. added
    blocked on vs code / lsp / dap
    on Jun 22, 2022
  12. modified the milestones: v3.44.0, Backlog on Jun 22, 2022
  13. added
    in lsp/analysis server
    and removed
    blocked on vs code / lsp / dap
    on Aug 8, 2022
  14. Dabbit-Chan commented on Sep 29, 2024

    @Dabbit-Chan

    any update?

  15. DanTup commented on Sep 30, 2024

    @DanTup
    Member

    This is blocked on support from VS Code - see microsoft/vscode#86564. Once supported there, it may require an update to the VS Code LSP client library.

    Edit: microsoft/language-server-protocol#1443

  16. added
    blocked on vs code / lsp / dap
    on Oct 7, 2026
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

    blocked on vs code / lsp / dapin editorin lsp/analysis serveris enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions