Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TypeFox/vscode-messenger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.1
Choose a base ref
...
head repository: TypeFox/vscode-messenger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 20, 2024

  1. Small readme updates

    dhuebner committed Dec 20, 2024
    Copy the full SHA
    a6fb04b View commit details
Showing with 17 additions and 12 deletions.
  1. +17 −12 README.md
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# VS Code Messenger

RPC messaging library for the VS Code extension platform. Makes the communication between your [VS Code extension](https://code.visualstudio.com/) and its [webviews](https://code.visualstudio.com/api/extension-guides/webview) much simpler.

[![npm](https://img.shields.io/npm/v/vscode-messenger)](https://www.npmjs.com/package/vscode-messenger) [![CI](https://github.com/TypeFox/vscode-messenger/actions/workflows/main.yml/badge.svg)](https://github.com/TypeFox/vscode-messenger/actions/workflows/main.yml) [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/typefox/vscode-messenger)


#### Diagnostics vs-code extension
[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/typefox.vscode-messenger-devtools?label=VS-Code%20Marketplace)](https://marketplace.visualstudio.com/items?itemName=typefox.vscode-messenger-devtools)


[Devtool vscode extension](https://github.com/TypeFox/vscode-messenger/tree/main/packages/vscode-messenger-devtools) helps inspecting messages interaction between your extension components.

#### Supported features

- Sending notification or an async request from an extension to a view, a view group or broadcast to all registered views
- Sending notification or an async request from a view to an other view, a view group or the host extension
- Support for sync and async request/notification handlers
- Typed API
- Sending notification or a request from an __extension to a view__, a __view group__ or __broadcast__ to all registered views
- Sending notification or a request from a __view to other view__, a view group or the host extension
- Support for __sync and async__ request/notification handlers
- Support for __request cancellation__
- __Typed__ API
- Automatically unregister views on view dispose
- Configurable logging

#### Diagnostics vs-code extension

[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/typefox.vscode-messenger-devtools?label=VS-Code%20Marketplace)](https://marketplace.visualstudio.com/items?itemName=typefox.vscode-messenger-devtools)

[Devtool vscode extension](https://github.com/TypeFox/vscode-messenger/tree/main/packages/vscode-messenger-devtools) helps inspecting messages interaction between your extension components.

#### Usage in an extension (TS example)

@@ -53,9 +53,10 @@ messenger.sendNotification(colorModifyType, {type: 'webview', webviewType: 'cali
const selectedColor = await messenger.sendRequest({ method: 'getSelectedColor' }, {type: 'webview', webviewType: 'calicoColors.colorsView' }, '');
```


#### Usage in a webview (JS Example)

Using JS in this example for simplicity. You can use TypeScript as well.

```js
const vscode = acquireVsCodeApi();
const vscode_messenger = require("vscode-messenger-webview");
@@ -84,3 +85,7 @@ messenger.start(); // start listening for incoming events
console.log(colors);

```

#### More examples

See tests for more examples.