microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
9cf5eef212122b370d9c6b3e7a690dcda708e67a

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/rn-extension.ts

22lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3import * as vscode from 'vscode';
4import {ReactNativeProjectHelper} from './utils/reactNativeProjectHelper';
5import {ReactNativeCommandHelper} from './utils/reactNativeCommandHelper';
6
7export function activate(context: vscode.ExtensionContext): void {
8 // TODO: Get the project root (vscode.workspace.rootPath) and return if it is not a react-native project
9 // check if package.json of user project has dependency on react-native
10
11
12 // Register react native commands
13 context.subscriptions.push(vscode.commands.registerCommand('reactNative.runAndroid',
14 () => ReactNativeCommandHelper.executeReactNativeCommand(vscode.workspace.rootPath, "runAndroid")));
15 context.subscriptions.push(vscode.commands.registerCommand('reactNative.runIos',
16 () => ReactNativeCommandHelper.executeReactNativeCommand(vscode.workspace.rootPath, "runIos")));
17 context.subscriptions.push(vscode.commands.registerCommand('reactNative.startPackager',
18 () => ReactNativeCommandHelper.executeReactNativeCommand(vscode.workspace.rootPath, "startPackager")));
19 context.subscriptions.push(vscode.commands.registerCommand('reactNative.stopPackager',
20 () => ReactNativeCommandHelper.executeReactNativeCommand(vscode.workspace.rootPath, "stopPackager")));
21
22}