Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !2552

Auto-detect running editor on Windows for error overlay

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/levrik/detect-editor-windows into master Jun 17, 2017
  • Overview 6
  • Commits 3
  • Pipelines 0
  • Changes 1

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

2017-06-17_12-25-40

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/levrik/detect-editor-windows