Sharing links to specific code snippets in Azure DevOps (ADO) can be a cumbersome process for developers. The current process requires the developer to search for the relevant keyword (such as class name or function name) in ADO, navigate to the source code file, and then copy the link to the desired snippet. This process can be frustrating and time-consuming.
To streamline this process, we propose adding a 'Get code link' option directly in Visual Studio Code. This option would generate a link to the selected snippet from any repository on ADO, eliminating the need to search for the same code in ADO and share it from there. This would save developers time and make sharing code snippets more efficient.
Features
Copy ADO URL: Copies the ADO code link for the selected code in the editor to the system clipboard. If the local branch has not been pushed to remote, the extension will prompt the user to push.
Copy Hyperlink: Copies a hyperlink that can be directly pasted into Office applications. The hyperlink includes the display text as '[Source file name] line [x] - [y]' and the address as an ADO URL.
Known Issues
Copying the hyperlink may take 1-2 seconds due to the extension's underlying process of generating the hyperlink in RTF and writing it to the clipboard. Please wait for the information message to appear at the bottom right corner before pasting.
The hyperlink can be displayed correctly as a clickable link in Teams, Outlook, Word, and Excel, but it appears empty in PowerPoint. This issue is likely due to a bug in the HTML format template used to generate the hyperlink.
The input box for customizing the display text of the hyperlink has been removed to simplify the flow. In the future, a second-level context menu may be added to allow users to choose between default display text or customization.
Release Notes
0.0.1 Provides "Copy ADO URL" and "Copy Hyperlink" functionality.
Contributors
@Jinlong Zhu, @Zixuan Wang, @Tongchen Gu, and @Joseph Qiu.
Special thanks to @Zixuan Wang! This extension was inspired by his Code Path Helper.