You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor editor integration to be more asynchronous and flexible #14666
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:
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.
While keeping the Registry approach as the default one, provide more flexible ways to look for editors if needed or more convenient.
Reacted by Tsvetilian Yankov, Nicolas Connor, BlairMcClelland, Valentine Briese and NinjaMojo
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.
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
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:
Executable picker - the first field will be a pick dialog. At the start of GitHub Desktop, we need to check if the chosen path is still accessible... if not set one of the built-in editors or none if not available
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
Reacted by Sergio Padrino, snailzrus and hell-racer
Activity
herboren commentedon May 23, 2022
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:
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
AraHaan commentedon May 23, 2022
Also cant vswhere be used to locate VSCode? If so, that would be an option to remove checking the registry entirely.
AraHaan commentedon May 23, 2022
Oh look it looks like vswhere is ok to be bundled with github desktop as well 🥳.

tsvetilian-ty commentedon May 23, 2022
There are several types of issues that I've faced myself or seen another dev face with the current setup:
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:.exe.defaults read /Applications/{APP_NAME}.app/Contents/Info CFBundleIdentifier(example from https://github.com/desktop/desktop/blob/development/docs/technical/editor-integration.md#find-bundle-identifier).--new-windowas an argument.Potential problematic areas:
sergiou87 commentedon Aug 15, 2024
With the work from #18954 this is not needed anymore 😄