profile
viewpoint

Ask questionsSupport for custom link handler in Markdown Cell and Webviews

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ --> <!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ --> <!-- Please search existing issues to avoid creating duplicates. --> <!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->

  • VSCode Version:
  • OS Version:

1. Add support to handle Notebook output link clicks in extension code 2. Add support to handle Notebook Markdown cell link clicks in extension code.

  • Currently we (Python Extension) displays custom links in the webviews (our notebook implementation).
    • We do this in the Markdown of a cell
    • We do this in output of a cell.
  • We handle these clicks by monitoring the click event of the document.
  • Any link clicked that has an href starting with vscode is handled by our code in webview and then passed onto the extension.

With the new VS Code notebooks, we'll need to do the same to handle links displayed in the output. I can see two solutions (for outputs):

  • Use our own renderer when rendering HTML & and highjack all clicks to handle our custom links (not preferred, as I'd prefer to use VS Code renderers as much as possible).
  • Add links in HTML using href=javascript:acquireVsCodeAPI().postMessage(....).

However, we won't be able to handle click events in markdown

  • At least not with the above approach
  • Open to alternatives

Had a chat with @rebornix and it was suggested that VSCode could provide a custom API that works in Markdown + Output rendered in WebViews as well as Notebooks

microsoft/vscode

Answer questions rebornix

Moving this to June and we still need to discuss what's the right solution for this problem. Command links work well in VS Code but they are not platform agnostic.

useful!

Related questions

the terminal process terminated with exit code #259 hot 6
The terminal shell CWD &#34;/c:/User...&#34; does not exist - vscode hot 4
Bad message: Cannot launch program 'c:\...'; setting the 'outFiles' attribute might help. hot 3
Show offending file path, when "Tokenization is skipped for long lines for performance reasons. The length of a long line can be configured via `editor.maxTokenizationLineLength`." hot 3
format code alt + shift + f hot 2
Corrupt ZIP: end of central directory record signature not found hot 2
"Initializing JS/TS Language Features" appears every time I open a JS file hot 2
Logitech MX Master: Horizontal scrolling via scroll wheel doesn't work hot 2
VS Code doesn't read Git packed-refs hot 2
Is it possible to use wsl bash php for php.validate.executablePath hot 2
Virtual Space is not implemented. hot 2
EISDIR: illegal operation on a directory, read error when trying to REMOTE-SSH hot 2
Failed to save ...: The content of the file is newer. Please compare your version with the file contents. hot 2
Insiders - We cannot connect to the Extensions Marketplace hot 2
error on trying to open terminal hot 2
Github User Rank List