Fixes launching Visual Studio Code due to args being a nested array.

Summary:
**Motivation**

Visual Studio Code appears to have been accidentally borked in RN 38 & 39.

[Here you see](a643784144 (diff-9ad1aafc931637a94d74b60c06b46871R153)) args become an array to support the new `shell-quote` support.

Problem is, `getArgumentsForLineNumber` also returns an array.

[And because we](a643784144 (diff-9ad1aafc931637a94d74b60c06b46871R161)) `push` instead of `concat`, we get hawt array-on-array action.

Surprisingly Atom works.  But Code doesn't like this at all.

**Test plan (required)**

On RN 0.38 and 0.39, what's happening when I click on the simulator stack frame, Code opens with the array as a string...

![image](https://cloud.githubusercontent.com/assets/68273/20971724/83a3d7c4-bc60-11e6-8170-a1c2a4adee60.png)

I've tested Vim, Code and Atom (all on 10.11.6) as well as all combinations of `REACT_EDITOR` both set
Closes https://github.com/facebook/react-native/pull/11345

Differential Revision: D4339963

Pulled By: lacker

fbshipit-source-id: 030cb9e3d84fd6861f28e3652bebfe2eef28dd62
This commit is contained in:
Steve Kellock 2016-12-16 10:16:51 -08:00 committed by Facebook Github Bot
parent 20938ae88c
commit f49093f397
1 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ function launchEditor(fileName, lineNumber, projectRoots) {
return;
}
const [editor, ...args] = guessEditor();
let [editor, ...args] = guessEditor();
if (!editor) {
printInstructions('PRO TIP');
return;
@ -159,7 +159,7 @@ function launchEditor(fileName, lineNumber, projectRoots) {
var workspace = findRootForFile(projectRoots, fileName);
if (lineNumber) {
args.push(getArgumentsForLineNumber(editor, fileName, lineNumber, workspace));
args = args.concat(getArgumentsForLineNumber(editor, fileName, lineNumber, workspace));
} else {
args.push(fileName);
}