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

Make private members to be protected for DefaultVsCodeKieEditorChannelApiImpl #2584

Closed
lordrip opened this issue Sep 13, 2024 · 3 comments · Fixed by #2606
Closed

Make private members to be protected for DefaultVsCodeKieEditorChannelApiImpl #2584

lordrip opened this issue Sep 13, 2024 · 3 comments · Fixed by #2606
Labels
lang:typescript Pull requests that update Javascript code

Comments

@lordrip
Copy link
Contributor

lordrip commented Sep 13, 2024

Is it possible to make the private constructor arguments protected in the DefaultVsCodeKieEditorChannelApiImpl class class?

In the DefaultVsCodeKieEditorChannelApiImpl class, all of its members are private, making complicated for other classes extending it to use them.

Here's an extract of the constructor:

export class DefaultVsCodeKieEditorChannelApiImpl implements KogitoEditorChannelApi, JavaCodeCompletionChannelApi {
  constructor(
-    private readonly editor: VsCodeKieEditorController,
-    private readonly resourceContentService: ResourceContentService,
-    private readonly workspaceApi: WorkspaceChannelApi,
-    private readonly backendProxy: BackendProxy,
-    private readonly notificationsApi: NotificationsChannelApi,
-    private readonly javaCodeCompletionApi: JavaCodeCompletionApi,
-    private readonly viewType: string,
-    private readonly i18n: I18n<VsCodeI18n>
+    protected readonly editor: VsCodeKieEditorController,
+    protected readonly resourceContentService: ResourceContentService,
+    protected readonly workspaceApi: WorkspaceChannelApi,
+    protected readonly backendProxy: BackendProxy,
+    protected readonly notificationsApi: NotificationsChannelApi,
+    protected readonly javaCodeCompletionApi: JavaCodeCompletionApi,
+    protected readonly viewType: string,
+    protected readonly i18n: I18n<VsCodeI18n>
  ) {}

The goal is to access the underlying file path from the API.

For instance, doing something like the following:

method() {
    const uri = this.editor.document.document.uri;
}
@tiagobento
Copy link
Contributor

@lordrip No objections at all. Feel free to send a PR.

@tiagobento
Copy link
Contributor

If this is something you absolutely need ASAP, consider bringing this to [email protected], as version 10.0 is frozen for features already, and it might be a few months until we're able to release 10.1.

@lordrip
Copy link
Contributor Author

lordrip commented Sep 19, 2024

Hi @tiagobento, thanks, since 10.0 is frozen, it's ok to wait for the next release, I'll prepare a PR and you decide when is a good moment to include it, we're not blocked, we have a workaround in the meantime ✌️

lordrip added a commit to lordrip/incubator-kie-tools that referenced this issue Sep 20, 2024
Expose constructor parameters to subclasses of the `DefaultVsCodeKieEditorChannelApiImpl` class.

fix: apache#2584
@github-project-automation github-project-automation bot moved this from 📋 Backlog to 🎯 Done in 🦉 KIE Podling Board Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:typescript Pull requests that update Javascript code
Projects
Status: 🎯 Done
3 participants