Skip to content

Commit

Permalink
Documentation: debugging in vscode workspace (#2075)
Browse files Browse the repository at this point in the history
* Update

* Update
  • Loading branch information
EzioLi01 committed Nov 28, 2023
1 parent 2499544 commit 7bdde98
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Using this extension, you can **debug your code and quickly run `react-native` c
- [TypeScript and Haul based applications](#typescript-and-haul)
- [Debugger configuration properties](#debugger-configuration-properties)
- [Customization](#customization)
- [Debug in vscode workspace](#debug-in-vscode-workspace)
- [Logging](#logging)
- [Build APK and generate bundle](#build-apk-and-generate-bundle)
- [Specifying custom arguments for `react-native run-*` command](#specifying-custom-arguments-for-react-native-run--command)
Expand Down Expand Up @@ -183,7 +184,7 @@ The extension allows you to debug multiple devices and configurations, please re

## Hermes engine

**Note**: Now react-native [0.70.0](https://github.com/facebook/react-native/releases/tag/v0.70.0) set Hermes as default engine to instead of JSCore. Please see [official documentation](https://reactnative.dev/blog/2022/07/08/hermes-as-the-default) to get details.
From [0.70.0](https://github.com/facebook/react-native/releases/tag/v0.70.0), react-native set Hermes as default engine. Please see [official documentation](https://reactnative.dev/blog/2022/07/08/hermes-as-the-default) to get details.

The Hermes engine is an open source JavaScript engine created by Facebook to optimize building and running React Native applications. It improves app performance and decreases app size.

Expand Down Expand Up @@ -683,6 +684,24 @@ The following is a list of all the configuration properties the debugger accepts

The extension can be further customized for other React Native scenarios. These are the most common:

## Debug in vscode workspace

Extension supports vscode multiple root workspace for development. If you have several react-native project in workspace, extension will show project selection list when react-native packager is starting. Also you can add settings in workspace to ignore specific project in selection list.

- Open vscode command palette, select `Preferences: Open Workspace Settings (JSON)` to open workspace settings file.
- Add below settings in the file:

```
"settings": {
"react-native.workspace.exclude": [
"ProjectFolderName1",
"ProjectFolderName2"
]
}
```

- Since the folder selection list is handled by vscode rather than extension, we must set exclude folder when extension is not activated. If you add exclude folder after extension activating, you must re-activate you extension or reopen your vscode.

## Logging

The extension logging is divided by several output channels:
Expand Down
2 changes: 1 addition & 1 deletion src/extension/settingsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import * as path from "path";
import * as fs from "fs";
import * as vscode from "vscode";
import stripJsonComments = require("strip-json-comments");
import { ConfigurationReader } from "../common/configurationReader";
import { Packager } from "../common/packager";
import { SystemColorTheme } from "../common/editorColorThemesHelper";
import { LogLevel } from "./log/LogHelper";
import { PackagerStatusIndicator } from "./packagerStatusIndicator";
import stripJsonComments = require("strip-json-comments");

export class SettingsHelper {
/**
Expand Down

0 comments on commit 7bdde98

Please sign in to comment.