From 464c3686bcd20be3a571f16d90f185caa8d37b02 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Tue, 19 May 2020 11:56:04 +0200 Subject: [PATCH] Create unique ID for each provider We must give each provider a unique ID, otherwise results get mixed up. We derive the ID from the UUID of this extension and the product key of the product. --- extension.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/extension.ts b/extension.ts index 0ed785b..1df4fb9 100644 --- a/extension.ts +++ b/extension.ts @@ -247,14 +247,16 @@ const resultMetaForProject = (idea: Gio.DesktopAppInfo) => ( * projects, since JetBrains products dont provide an interface start a recent * projects search within the app. * - * @param projects The project to search in - * @param app The application info for the product the projects belong to + * @param product The product to create a search provider for. + * @param app The application info for the product. + * @param projects The recent projects of the product. */ const createProvider = ( - projects: ProjectMap, - app: Gio.DesktopAppInfo + product: ProductInfo, + app: Gio.DesktopAppInfo, + projects: ProjectMap ): SearchProvider => ({ - id: Self.uuid, + id: `${Self.uuid}-${product.key}`, isRemoteProvider: false, canLaunchSearch: true, appInfo: app, @@ -461,7 +463,7 @@ function init(): ExtensionState { ); return; } - providers.push(createProvider(projects, app)); + providers.push(createProvider(product, app, projects)); }); providers.forEach((provider) => {