microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.3.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/common/exponent/exponentPlatform.ts

43lines · modeblame

1c32fe84Patricio Beltran9 years ago1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import {ErrorHelper} from "../error/errorHelper";
5import {InternalErrorCode} from "../error/internalErrorCode";
6import {IRunOptions} from "../launchArgs";
7import {Log} from "../log/log";
8import {GeneralMobilePlatform} from "../generalMobilePlatform";
9
10import * as Q from "q";
11
12export class ExponentPlatform extends GeneralMobilePlatform {
13private exponentTunnelPath: string;
14
15constructor(runOptions: IRunOptions, { remoteExtension = null } = {}) {
16super(runOptions, { remoteExtension: remoteExtension });
17this.exponentTunnelPath = null;
18}
19
20public runApp(): Q.Promise<void> {
280c0746Patricio Beltran9 years ago21const outputMessage = `Application is running on Exponent. Open your exponent app at ${this.exponentTunnelPath} to see it.`;
22Log.logMessage(outputMessage);
23this.remoteExtension.showInformationMessage(outputMessage);
1c32fe84Patricio Beltran9 years ago24return Q.resolve<void>(void 0);
25}
26
27public enableJSDebuggingMode(): Q.Promise<void> {
28Log.logMessage("Application is running on Exponent. Please shake device and select 'Debug JS Remotely' to enable debugging.");
29return Q.resolve<void>(void 0);
30}
31
32public startPackager(): Q.Promise<void> {
4052c7eddaserge9 years ago33Log.logMessage("Starting Exponent Packager.");
1c32fe84Patricio Beltran9 years ago34return this.remoteExtension.startExponentPackager()
35.then(exponentUrl => {
36if (!exponentUrl) {
37return Q.reject<void>(ErrorHelper.getInternalError(InternalErrorCode.ExpectedExponentTunnelPath,
38"No link provided by exponent. Is your project correctly setup?"));
39}
40this.exponentTunnelPath = exponentUrl;
41});
42}
43}