Skip to content

Commit

Permalink
Provide empty implementation for new Channel API relative to metadata an
Browse files Browse the repository at this point in the history
fileContent

Signed-off-by: Aurélien Pupier <[email protected]>
  • Loading branch information
apupier committed Sep 16, 2024
1 parent 27fc3c7 commit 1393a8a
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/webview/VSCodeKaotoEditorChannelApi.ts
Original file line number Diff line number Diff line change
@@ -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<VsCodeI18n>
) {
super(editor, resourceContentService, workspaceApi, backendProxy, notificationsApi, javaCodeCompletionApi, viewType, i18n);
this.currentEditedDocument = editor.document.document;
}

async getCatalogURL(): Promise<string | undefined> {
return await vscode.workspace.getConfiguration('kaoto').get('catalog.url');
}
Expand All @@ -19,4 +45,22 @@ export class VSCodeKaotoEditorChannelApi extends DefaultVsCodeKieEditorChannelAp

return new SettingsModel(settingsModel);
}

async getMetadata<T>(key: string): Promise<T | undefined> {
vscode.window.showErrorMessage(`getMetadata Not implemented. It was called with ${key}`);
return undefined;
}

async setMetadata<T>(key: string, value: T | undefined): Promise<void> {
vscode.window.showErrorMessage(`setMetadata Not implemented. It was called with ${key} and ${value}`);
}

async getResourceContent(relativePath: string): Promise<string | undefined> {
vscode.window.showErrorMessage(`getResourceContent Not implemented. It was called with ${relativePath}`);
return undefined;
}

async saveResourceContent(relativePath: string, content: string): Promise<void> {
vscode.window.showErrorMessage(`saveResourceContent Not implemented. It was called with ${relativePath} and ${content}`);
}
}

0 comments on commit 1393a8a

Please sign in to comment.