Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhyll authored and tauri-bot committed May 25, 2024
1 parent 9bc6136 commit 697c9e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions src/content/docs/develop/Debug/intellij.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ sidebar:
variant: caution
---

{ /* TODO: REVISE COPY TO V2 */}
{ /* TODO: Update links and internal navigation */}
{ /* TODO: Add support to light/dark mode images */}
{ /* TODO: Revise this change: Debugging in CLion > Debug in CLion */}
{/* TODO: REVISE COPY TO V2 */}
{/* TODO: Update links and internal navigation */}
{/* TODO: Add support to light/dark mode images */}
{/* TODO: Revise this change: Debugging in CLion > Debug in CLion */}

In this guide, we'll be setting up IntelliJ CLion for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).

Expand All @@ -33,17 +33,17 @@ Before you proceed, make sure that your project is fully loaded. If the indexing
We will set up a Run/Debug configuration that we can use to launch our Tauri app in debugging mode. To create a configuration, go to Edit Configurations, click **+**, and then select Cargo Command.

![Add Run/Debug Configuration](@assets/develop/Debug/rustrover/add-cargo-config-light.png)
{ /* ![Add Run/Debug Configuration](@assets/debugging/clion/add-cargo-config-dark.png#gh-dark-mode-only) */}
{/* ![Add Run/Debug Configuration](@assets/debugging/clion/add-cargo-config-dark.png#gh-dark-mode-only) */}

With that created we need to configure CLion so it instructs Cargo to build our app without any default features. This will tell Tauri to use your development server instead of reading assets from disk. Normally this flag is passed by the Tauri CLI, but since we're completely sidestepping that here, we need to pass the flag manually.

![Add `--no-default-features` flag](@assets/develop/Debug/rustrover/set-no-default-features-light.png)
{ /* ![Add `--no-default-features` flag](@assets/develop/Debug/rustrover/set-no-default-features-dark.png#gh-dark-mode-only) */}
{/* ![Add `--no-default-features` flag](@assets/develop/Debug/rustrover/set-no-default-features-dark.png#gh-dark-mode-only) */}

Now we can optionally rename the Run/Debug Configuration to something more memorable, in this example we called it "Run Tauri App", but you can name it whatever you want.

![Rename Configuration](@assets/develop/Debug/rustrover/rename-configuration-light.png)
{ /* ![Rename Configuration](@assets/develop/Debug/rustrover/rename-configuration-dark.png#gh-dark-mode-only) */}
{/* ![Rename Configuration](@assets/develop/Debug/rustrover/rename-configuration-dark.png#gh-dark-mode-only) */}

:::caution

Expand Down
16 changes: 8 additions & 8 deletions src/content/docs/develop/Debug/rustrover.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ sidebar:
variant: caution
---

{ /* TODO: Update links and internal navigation */}
{ /* TODO: Add support to light/dark mode images */}
{/* TODO: Update links and internal navigation */}
{/* TODO: Add support to light/dark mode images */}

In this guide, we'll be setting up JetBrains RustRover for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).

Expand Down Expand Up @@ -41,17 +41,17 @@ You will need to set up two separate Run/Debug configurations:
- To create a new configuration, click **+** on the toolbar and select **Cargo**.

![Add Run/Debug Configuration](@assets/develop/Debug/rustrover/add-cargo-config-light.png)
{ /* ![Add Run/Debug Configuration](@assets/develop/Debug/rustrover/add-cargo-config-dark.png#gh-dark-mode-only) */}
{/* ![Add Run/Debug Configuration](@assets/develop/Debug/rustrover/add-cargo-config-dark.png#gh-dark-mode-only) */}

With that created, we need to configure RustRover, so it instructs Cargo to build our app without any default features. This will tell Tauri to use your development server instead of reading assets from the disk. Normally this flag is passed by the Tauri CLI, but since we're completely sidestepping that here, we need to pass the flag manually.

![Add `--no-default-features` flag](@assets/develop/Debug/rustrover/set-no-default-features-light.png)
{ /* ![Add `--no-default-features` flag](@assets/develop/Debug/rustrover/set-no-default-features-dark.png#gh-dark-mode-only) */}
{/* ![Add `--no-default-features` flag](@assets/develop/Debug/rustrover/set-no-default-features-dark.png#gh-dark-mode-only) */}

Now we can optionally rename the Run/Debug Configuration to something more memorable, in this example we called it "Run Tauri App", but you can name it whatever you want.

![Rename Configuration](@assets/develop/Debug/rustrover/rename-configuration-light.png)
{ /* ![Rename Configuration](@assets/develop/Debug/rustrover/rename-configuration-dark.png#gh-dark-mode-only) */}
{/* ![Rename Configuration](@assets/develop/Debug/rustrover/rename-configuration-dark.png#gh-dark-mode-only) */}

### Development Server

Expand All @@ -66,21 +66,21 @@ To create the corresponding Run configuration, you need to check the actual deve
For `npm`, `pnpm`, or `yarn`, you could use the **npm** Run Configuration, for example:

![NPM Configuration](@assets/develop/Debug/rustrover/npm-configuration-light.png)
{ /* ![NPM Configuration](@assets/develop/Debug/rustrover/npm-configuration-dark.png#gh-dark-mode-only) */}
{/* ![NPM Configuration](@assets/develop/Debug/rustrover/npm-configuration-dark.png#gh-dark-mode-only) */}

Make sure you have the correct values in the **Command**, **Scripts**, and **Package Manager** fields.

If your development server is `trunk` for Rust-based WebAssembly frontend frameworks, you could use the generic **Shell Script** Run Configuration:

![Trunk Serve Configuration](@assets/develop/Debug/rustrover/trunk-configuration-light.png)
{ /* ![Trunk Serve Configuration](@assets/develop/Debug/rustrover/trunk-configuration-dark.png#gh-dark-mode-only) */}
{/* ![Trunk Serve Configuration](@assets/develop/Debug/rustrover/trunk-configuration-dark.png#gh-dark-mode-only) */}

## Launching a Debugging Session

To launch a debugging session, you first need to run your development server, and then start debugging the Tauri App by clicking the **Debug** button next to the Run Configurations Switcher. RustRover will automatically recognize breakpoints placed in any Rust file in your project and stop on the first one hit.

![Debug Session](@assets/develop/Debug/rustrover/debug-session-light.png)
{ /* ![Debug Session](@assets/develop/Debug/rustrover/debug-session-dark.png#gh-dark-mode-only) */}
{/* ![Debug Session](@assets/develop/Debug/rustrover/debug-session-dark.png#gh-dark-mode-only) */}

From this point, you can explore the values of your variables, step further into the code, and check what's going at runtime in detail.

Expand Down

0 comments on commit 697c9e3

Please sign in to comment.