Created by: levrik
I decided to go with an a bit different approach for Windows than on macOS. This resolves the first two issues mentioned below.
The new approach detects only by the file name and re-uses the whole path found in the process list to launch the editor. On macOS this was not possible because some executables did not match the command needed to run (if I understood that right).
Regarding the third one:
We could improve that by launching a PowerShell at the beginning in the background and just pipe the commands in then. This would require to switch to a Promise/callback-based implementation of the whole feature. I would pick that up in a second PR later on if you're okay with it
Tested on Windows 10 with latest VS Code, Atom and Sublime Text 3.
The original content of this PR:
So, this is a first try to get the auto-detect feature of the editor for the error overlay working on Windows. There are a few issues with the current implementation so I would like to discuss these issues first.
- At the moment it's only working if the found editor has its executable on
PATH
. Unfortunately we have drive letters on Windows so we cannot hardcode a path.- For example Atom installs itself into the user profile and has one folder per version. The current implemented detection does not work here. Do we need to require the full path for the detection or can we just search by the executable's name?
- The whole process feels somehow slow. Mostly caused by the PowerShell's startup time (about 500 ms on my system).
Also you can find the previous code here: levrik/create-react-app@adee1d0