Skip to content
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

Dev notes on using extension services #236760

Open
roblourens opened this issue Dec 20, 2024 · 0 comments
Open

Dev notes on using extension services #236760

roblourens opened this issue Dec 20, 2024 · 0 comments
Assignees

Comments

@roblourens
Copy link
Member

Inspired by #236537

I've found it a little confusing to find the right extension service to work with so here are some random notes on things that have tripped me up.

  • There are many different services with "extension" in the name, and when I need to do something, it's hard to know where to start.
    • Probably the most common ones are IExtensionService, IExtensionsWorkbenchService, IExtensionManagementService, and I don't fully understand the distinction
  • In the above issue, we used IExtensionManagementService#getInstalled
    getInstalled(type?: ExtensionType, profileLocation?: URI, productVersion?: IProductVersion): Promise<ILocalExtension[]>;
    to check whether the Copilot extension was installed. This seemed reasonable but it actually returns all local and remote extensions, whether enabled or disabled due to being in the wrong EH. And, it returns them the two sets in random order based on a race. I think this is a serious footgun.
    • And I think we've made the same mistake in other places. If I look at references to getInstalled I see a lot of usages. eg I get @ext: completions in the settings editor for workspace extensions in a remote window that are only installed locally and not on the remote
    • I think IExtensionsWorkbenchService#queryLocal was the right thing to use but there's also IExtensionService#extensions and I'm not sure what the difference is
  • There are two different types called IExtension at and
    export interface IExtension {
  • The name queryLocal and ILocalExtension were a little confusing now that "remote extensions" exist

Some things that might help could be some tsdoc on the services and methods that explain when to use them or what exactly they return. Or a .md doc file with a "guide to extensions services" that lays this stuff out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants