From df2fa9b3f27af2bd93ed8f21c3cacdd925403d25 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 3 Oct 2024 13:21:49 -0500 Subject: [PATCH] doc: Update widgets.md (#610) - content seems to be .tsx not .ts - typo in the widget command --- src/docs/widgets.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/docs/widgets.md b/src/docs/widgets.md index 0e03c7df..f45b2373 100644 --- a/src/docs/widgets.md +++ b/src/docs/widgets.md @@ -61,7 +61,7 @@ In the following code examples, we use `ReactWidget` as a base class. As shown b * `closable`: Whether the user can close the widget (via the “x” in the tab or via right click menu). * `iconClass`: The icon shown in the tab when the widget is opened. -**mywidget-widget.ts** +**mywidget-widget.tsx** ```typescript @injectable() @@ -83,7 +83,7 @@ protected async init(): Promise < void> { When using the respective base class, the implementation of a widget can be really minimal and focused on the custom UI part. In our example, we just implement the render function that will create our actual custom UI (using JSX/React). The example UI contains a button that will trigger the `displayMessage` function below. -**mywidget-widget.ts** +**mywidget-widget.tsx** (continued) ```typescript protected render(): React.ReactNode { @@ -151,7 +151,7 @@ export class MyWidgetContribution extends AbstractViewContribution { } registerCommands(commands: CommandRegistry): void { - commands.registerCommand(WidgetCommand, { + commands.registerCommand(MyWidgetCommand, { execute: () => super.openView({ activate: false, reveal: true }) }); }