From 1393a8a8d3351ee58e920dcabebcb9eb5451260f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Fri, 13 Sep 2024 14:59:46 +0200 Subject: [PATCH] Provide empty implementation for new Channel API relative to metadata an fileContent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Pupier --- src/webview/VSCodeKaotoEditorChannelApi.ts | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/webview/VSCodeKaotoEditorChannelApi.ts b/src/webview/VSCodeKaotoEditorChannelApi.ts index 70a8168f..70b21128 100644 --- a/src/webview/VSCodeKaotoEditorChannelApi.ts +++ b/src/webview/VSCodeKaotoEditorChannelApi.ts @@ -1,9 +1,35 @@ import { KaotoEditorChannelApi } from '@kaoto/kaoto'; import { ISettingsModel, NodeLabelType, SettingsModel } from '@kaoto/kaoto/models'; +import { BackendProxy } from '@kie-tools-core/backend/dist/api'; +import { NotificationsChannelApi } from "@kie-tools-core/notifications/dist/api"; +import { ResourceContentService, WorkspaceChannelApi } from "@kie-tools-core/workspace/dist/api"; +import { I18n } from '@kie-tools-core/i18n/dist/core'; import { DefaultVsCodeKieEditorChannelApiImpl } from '@kie-tools-core/vscode-extension/dist/DefaultVsCodeKieEditorChannelApiImpl'; +import { VsCodeI18n } from '@kie-tools-core/vscode-extension/dist/i18n'; +import { VsCodeKieEditorController } from '@kie-tools-core/vscode-extension/dist/VsCodeKieEditorController'; +import { JavaCodeCompletionApi } from '@kie-tools-core/vscode-java-code-completion/dist/api'; import * as vscode from 'vscode'; +import { VsCodeKieEditorCustomDocument } from '@kie-tools-core/vscode-extension/dist/VsCodeKieEditorCustomDocument'; +import * as path from 'path'; export class VSCodeKaotoEditorChannelApi extends DefaultVsCodeKieEditorChannelApiImpl implements KaotoEditorChannelApi { + + private readonly currentEditedDocument: vscode.TextDocument | VsCodeKieEditorCustomDocument; + + constructor( + editor: VsCodeKieEditorController, + resourceContentService: ResourceContentService, + workspaceApi: WorkspaceChannelApi, + backendProxy: BackendProxy, + notificationsApi: NotificationsChannelApi, + javaCodeCompletionApi: JavaCodeCompletionApi, + viewType: string, + i18n: I18n + ) { + super(editor, resourceContentService, workspaceApi, backendProxy, notificationsApi, javaCodeCompletionApi, viewType, i18n); + this.currentEditedDocument = editor.document.document; + } + async getCatalogURL(): Promise { return await vscode.workspace.getConfiguration('kaoto').get('catalog.url'); } @@ -19,4 +45,22 @@ export class VSCodeKaotoEditorChannelApi extends DefaultVsCodeKieEditorChannelAp return new SettingsModel(settingsModel); } + + async getMetadata(key: string): Promise { + vscode.window.showErrorMessage(`getMetadata Not implemented. It was called with ${key}`); + return undefined; + } + + async setMetadata(key: string, value: T | undefined): Promise { + vscode.window.showErrorMessage(`setMetadata Not implemented. It was called with ${key} and ${value}`); + } + + async getResourceContent(relativePath: string): Promise { + vscode.window.showErrorMessage(`getResourceContent Not implemented. It was called with ${relativePath}`); + return undefined; + } + + async saveResourceContent(relativePath: string, content: string): Promise { + vscode.window.showErrorMessage(`saveResourceContent Not implemented. It was called with ${relativePath} and ${content}`); + } }