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

[feature]: Add support for calling the vscode API directly via svelte #2144

Open
1 task done
SkySingh04 opened this issue Jul 28, 2024 · 2 comments · May be fixed by keploy/vscode-extension#13
Open
1 task done

[feature]: Add support for calling the vscode API directly via svelte #2144

SkySingh04 opened this issue Jul 28, 2024 · 2 comments · May be fixed by keploy/vscode-extension#13
Labels
Enhancement New feature or request keploy

Comments

@SkySingh04
Copy link
Contributor

SkySingh04 commented Jul 28, 2024

Is there an existing feature request for this?

  • I have searched the existing issues

Summary

Repository : https://github.com/keploy/vscode-extension

The current version of the vscode extension uses sidebar.js inorder to call the Vsode API and perform interactions with the Typescript backend using vscode.Postmessage. Here is an example of this:

if (openRecordPageButton) {
  openRecordPageButton.addEventListener('click', async () => {
    console.log("openRecordPageButton clicked");
    vscode.postMessage({
      type: "navigate",
      value: "Keploy"
    });
  });
}

Ideally, we should be able to call the vscode API directly from our svelte files inorder to remove redundacny and ultimately cut the need for the presence of this extra script.

References:

Ben awad has implemented this in his tutorial and the same can be implemented via following it : https://www.youtube.com/watch?v=a5DX5pQ9p5M&t=9571s

Deliverables:

  • Be able to call the vscode api from svelte and make calls to typescript backend using vscode.postMessage from svelte.
  • Be able to listen to messages from typescript backend using window.addEventListener('message',()=>{}) from svelte.
  • Ultimately reduce the need for sidebar.js file and migrate all functionality to respective svelte files.

Why should this be worked on?

Improvements to code quality

Repository

keploy

@SkySingh04 SkySingh04 added the Enhancement New feature or request label Jul 28, 2024
@ayush3160
Copy link
Contributor

I would like to work on this

@SkySingh04
Copy link
Contributor Author

Go for it! Do ping if you face any difficulty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request keploy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants