-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Copy extension link #234210
base: main
Are you sure you want to change the base?
Copy extension link #234210
Conversation
@microsoft-github-policy-service agree |
@cachandlerdev If you go in the Extensions and you apply a filter some extension should show up. |
Hi, I noticed that behavior as well, but I believe it's the case because those extensions are built-in by default and don't have links. If you look at the existing "Copy" code, you'll see that no link gets created for those extensions. I tried to hide the context item altogether using the "when" keyword, but it didn't seem to apply to every built-in extension (e.g. Git). I would separately test external marketplace extensions if I could to double check that the link functionality works on extensions with marketplace links, but I only was able to see built-in extensions from the application when using |
Ah, I see what you mean. However, this appears to be standard behavior for the "Copy" context menu item that I have not touched on this development version. I find this odd because when I run VSCode normally (not the development version), the URL is retrieved when clicking the "Copy" context menu item button. Here is the result of clicking the normal "Copy" button in VSCode on that extension:
And here's the result in the version I get when running
|
Then instead of the "Copy" item you might copy the logic from "Copy Extension Id" and just add a prefix:
Something like this. |
Alright, I changed that code and corrected the |
}, | ||
run: async (accessor: ServicesAccessor, id: string) => { | ||
const clipboardService = accessor.get(IClipboardService); | ||
const extensionLinkPrefix = 'https://marketplace.visualstudio.com/items?itemName='; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to get the marketplace link from the productService and not to hard code it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I initially tried to do that by using the "Copy" context menu item logic, but then noticed that development versions don't seem to retrieve a valid extension URL for any extension, including ones that aren't built-in. I discussed this with another fellow on the GitHub PR page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now fixed that issue.
@cachandlerdev I think i figured out why using the logic from "Copy" doesn't work: you must be connected to internet, and the application built from the source code doesn't have internet access. |
I see what you mean. In that case, I'll revert to the prior logic (which should work because it's directly taken from the existing "Copy" item) but only display the context menu item when the user is connected to the internet. |
Hi, I added a context menu item for "Copy Extension Link" in accordance with #233915. I'm afraid I'm not quite sure how to test it on extensions from the vscode marketplace because they don't show up when running
./scripts/code.sh
, but the logic is copied from the "Copy" item above, and I believe it appropriately handles built-in extensions.