Skip to content

Refactor editor integration to be more asynchronous and flexible #14666

Closed

Description

@sergiou87

Context: #14664 (comment)

As of today, GitHub Desktop builds the list of compatible editors right when the app starts. This is ok as long as that task is quick, but some integrating some editors might require the use of external processes to find out their location, as can be shown in #14664, which would slow the app start down.

Another thing one can realize from #14664 is how using Registry keys to detect editors restricts us, since in that PR we could directly use vswhere to determine the location of the executable to open, instead of using it to determine the Registry keys where we can find that location.

With all that in mind, we could do the following refactors:

  1. When the app starts, only have a lightweight list with the compatible editors, and defer checking which ones are actually available until they're needed.
  2. While keeping the Registry approach as the default one, provide more flexible ways to look for editors if needed or more convenient.

Activity

  1. herboren commented on May 23, 2022

    @herboren

    There are multiple editors, give people a list box of programs to choose from that might be present on their system and have the GUI automatically detect the process they are using on their system, then update the GitHub UI accordingly based on running process. Then just restart the GitHub interface for the visual studio community to appear as an option after the entry has been updated inside a config.

    Edit:

    Others mentioning vswhere:

    PS C:\Users\Daddy\Documents\Library\PackageCache\[email protected]\Editor\VSWhere> .\vswhere.exe | findstr 'productPath:'
    productPath: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe
    

    Seems to do the trick. I think this would greatly help and save the team a ton of programming. Just extract the output of vswhere.exe. Althought, it doesn't target registry location

  2. AraHaan commented on May 23, 2022

    @AraHaan

    Also cant vswhere be used to locate VSCode? If so, that would be an option to remove checking the registry entirely.

  3. AraHaan commented on May 23, 2022

    @AraHaan

    Oh look it looks like vswhere is ok to be bundled with github desktop as well 🥳.
    image

  4. tsvetilian-ty commented on May 23, 2022

    @tsvetilian-ty
    Member

    There are several types of issues that I've faced myself or seen another dev face with the current setup:

    • Unstable keys - VS is the most notable in this category. The unstable key (different on each installation or PC) leads to issues with detection in the registry and requires custom handling.
    • Not using registry key - Eclipse can't be easily integrated because of that. The IDE's executable can be installed anywhere, and there is no simple way to find it, even with custom handling.
    • Requires launch arguments/options (rare case) - I don't remember what the exact option was, but I think Adobe's Dreamweaver was IDE that requires one to work correctly.

    I will base my proposal on these 3 points!

    My proposal is high on the flexibility scale and doesn't require heavy computation, but it is manual by definition. All currently supported editors will not change, and every new editor with the correct registry entries will be integrated the old way.

    We add two new fields in Options > Integrations:

    We can use the name of the .exe on Windows, the characters from the chosen application on macOS, and the name of the selected file on Linux as a name for the editor.

    • Arguments field (optional for the proposal, but included to address the "requires launch arguments" point) - this field lets the user set launch arguments. For example: from executable picker user chooses vscode and sets --new-window as an argument.

    Potential problematic areas:

    • UX: we need to communicate with the user which editor is currently in use... the one with build-in support or the custom one.
    • At the moment, I don't think we can set launch arguments for an editor
  5. sergiou87 commented on Aug 15, 2024

    @sergiou87
    MemberAuthor

    With the work from #18954 this is not needed anymore 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions