Commit Graph

26 Commits

Author SHA1 Message Date
Dan Abramov
bd0ffb72aa Fix click-to-open on Windows (#5431)
* Fix click-to-open on Windows

* Oops
2018-10-14 19:27:34 +01:00
Irvin Denzel Torcuato
bf5a4bf989 Feed correct line number to gvim on launch (#5202)
Clicking Error overlay should feed the correct line number for gvim.

Added `gvim` in `COMMON_EDITORS_LINUX`, launches new gvim when it is running.

Tested with gvim 8.0.707 on a Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux VM

Relates to https://github.com/facebook/create-react-app/issues/2636.
2018-10-01 22:08:53 +01:00
Joe Haddad
e41c67dfce Upgrade Prettier 2018-09-19 14:48:04 -04:00
Andrew Clark
577a274d8c Use file name whitelist to prevent RCE (#4866)
* Use file name whitelist to prevent RCE

Use a whitelist to validate user-provided file names. This doesn't cover
the entire range of valid filenames but should cover almost all of them
in practice. Allows letters, numbers, periods, dashes, and underscores.
Opting to use a whitelist instead of a blacklist because getting this
wrong leaves us vulnerable to a RCE attack.

* Allow alphabet characters from all languages

Updated the whitelist to /^[\p{L}0-9/.\-_]+$/u, which matches
alphanumeric characters, periods, dashes, and underscores. Unicode
property support is stage 4 so I've inlined the transpiled version.

* Only use file name whitelist on Windows

* Log error message if file name does not pass whitelist
2018-08-22 17:35:24 +01:00
Igor Fedyukin
03604a46f0 Autodetect GoLand editor (#3980) 2018-02-05 16:05:36 +00:00
Levin Rickert
346ea1cc8d Use wmic to get process list on Windows (#3808) 2018-01-17 19:32:05 +00:00
Tharaka Wijebandara
10b05c7662 Open editor to exact column from build error overlay (#3465)
* Open editor to exact column from build error overlay

* Update launch editor validations
2018-01-09 15:47:22 +00:00
shrynx
85bf3a937b added code-insiders to the editor list (#3652) 2018-01-09 15:46:46 +00:00
Evan You
bef40eeb84 Add editor support for Sublime Dev & VSCode Insiders (#3700) 2018-01-09 15:10:31 +00:00
Rafael E. Poveda
e3e8cdd699 Support setting none in REACT_EDITOR env variable (#3721)
* add support to set REACT_EDITOR to none

* change README message

* change condition to avoid problems with editor being null

* move condition to avoid extra code
2018-01-09 12:35:43 +00:00
Ernesto García
1b067c5659 Autodetect MacVim editor (#3545)
Adds support for the error overlay to detect and open the file with the error in MacVim.

Relates to #2636.
2018-01-08 21:08:29 +00:00
Sophie Alpert
2e82ebb337 BSD+Patents -> MIT (#3189)
* File headers BSD+Patents -> MIT

* BSD+Patents -> MIT
2017-09-26 10:30:05 +01:00
gulderov
1faee66a77 Auto-detect running editor on Linux for error overlay (#3077)
* Auto-detect running editor on Linux for error overlay

Basic support of auto detecting running editor for #2636.
Tested on Ubuntu 16.04.
It detects few editors. JetBrains products should start by
wrapper like /usr/local/bin/webstorm. Otherwise it takes a
lot of time to open editor.

* Comments fixed.

* List all processes owned by you

* Comment rewording
2017-09-11 08:31:28 -04:00
Ade Viankakrisna Fadlil
44cfbccfda Rerun prettier and pin version (#3058)
* rerun prettier for all files

* pin prettier to 1.6.1
2017-09-10 01:12:38 -04:00
Dan Ristea
3ca6bae25f Autodetect JetBrains IDEs (#2754)
Autodetect PyCharm (Pro and CE), WebStorm, PhpStorm, IntelliJ IDEA, RubyMine, CLion, and AppCode

Added IntelliJ IDEA, RubyMine, CLion, and AppCode to list of IDEs. It has the same signature as WebStorm and PhpStorm `<editor> <projectPath> --line <number> <filePath>` so it can reuse the logic from those.

Removed older integrations of AppCode, IntelliJ IDEA

https://www.jetbrains.com/help/idea/opening-files-from-command-line.html
https://www.jetbrains.com/help/pycharm/opening-files-from-command-line.html
https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html
https://www.jetbrains.com/help/ruby/opening-files-from-command-line.html
https://www.jetbrains.com/help/webstorm/opening-files-from-command-line.html

Tested with Appcode 2017.1.3, CLion 2017.1.3, Intellij Idea 2017.1.5, PhpStorm 2017.1.4, PyCharm (Pro and CE) 2017.1.4, RubyMine 2017.1.5, and WebStorm 2017.1.4 on MacOS 10.12
Tested with 64-bit CLion 2017.1.3, Intellij Idea 2017.1.5, PhpStorm 2017.1.4, PyCharm (Pro and CE) 2017.1.4, RubyMine 2017.1.5, and WebStorm 2017.1.4 on a Windows 10 VM

Relates to #2636
2017-07-09 22:15:43 +01:00
Dan Ristea
804ac00095 Support PyCharm in launchEditor (#2740)
PyCharm has the same signature as WebStorm and PhpStorm `<editor> <projectPath> --line <number> <filePath>` so it can reuse the logic from those.

https://www.jetbrains.com/help/pycharm/opening-files-from-command-line.html

Tested with PyCharm Pro 2017.1.4 on MacOS 10.12
2017-07-07 11:34:56 +01:00
Trygve Aaberge
f495c15578 Reorder vim arguments in launchEditor so --remote works (#2723)
This allows you to set REACT_EDITOR to 'vim --remote', so the file can
be opened in an already running vim process. When using vim without
remote, it works in the same way as before.

When launching vim without --remote, the order of the line and path
arguments doesn't matter. However, when using --remote the line argument
has to precede the path. This happens to be the same as joe and emacs
uses, so the vim cases were just moved there.

I haven't tested this with mvim, but the documentation says the same as
the vim documentation, so I assume it works the same.
2017-07-04 23:44:55 +01:00
Dan Abramov
a171d93064 Reformat source code with Prettier 1.5.2 2017-06-28 16:23:16 +01:00
Pete Nykänen
84299ceb23 Add Brackets to launchEditor.js (#2637) 2017-06-27 21:46:59 +01:00
Marius Wirtherle
6a09ed1e6e docs: added REACT_EDITOR to Advanced Configuration section (#2445)
* docs: added REACT_EDITOR to `Advanced Configuration` section

* Update README.md

* Update launchEditor.js
2017-06-27 16:30:26 +01:00
Levin Rickert
2874e1209e Auto-detect running editor on Windows for error overlay (#2552)
* Auto-detect running editor on Windows for error overlay

* Ignore process output if powershell call fails

* Support Notepad++
2017-06-27 16:16:02 +01:00
Mikhail Osher
58ef08f798 Support PhpStorm in launchEditor (#2622)
https://www.jetbrains.com/help/webstorm/opening-files-from-command-line.html
https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html

Both editors have the same signature `<editor> <projectPath> --line <number> <filePath>` to open file from the command line.
It seems to work even if `<projectPath>` is omitted (commit 02f88ba157).

Tested on `Win10`+`PhpStorm2016` and `macOS 10.12`+`PhpStorm2017`.
2017-06-26 16:19:21 +01:00
Marius Wirtherle
02f88ba157 Add WebStorm >2017 launchEditor Support (#2414) 2017-05-30 14:00:16 +01:00
Malcolm
d3e85364fe Add WSL support to launchEditor utility (#2282) 2017-05-20 17:52:58 +01:00
Dan Abramov
10c734b66a Print error messages for editor integration (#2150) 2017-05-14 23:52:27 +01:00
Dan Abramov
4434467a43 Click to view source from error overlay (#2141)
* Click to view source

* Update package.json

* Update package.json

* Fix lint
2017-05-14 12:17:05 +01:00