-
-
Notifications
You must be signed in to change notification settings - Fork 102
Add open-in-editor action #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This change adds a quick-action for opening the current repo in editor. Right now, it is hardcoded to open it in VSCodium, since that is what I have installed, but the next change should make it configurable.
This change adds a setting/preference for the external editor to open all projects with. This change does not yet add per-project editor settings. The setting is also not used anywhere yet.
We now use the editor configured through the app settings to open the repo
We now display an error notification when no editor was set.
The check for whether the editor setting is set was done at the usage site in RepositoryOpenViewModel until now. But this logic could be relevant in other places as well. This change moves it into a new property on the AppSettingsRepository
Previously we used the Kotlin navtive API for starting the process for opening the repo in an external editor. But I just discovered the IShellManager service and assume that it is better to use this. So this change refactores to use that service.
There is now a keybind for opening the repo in an external editor. For now it is set to CTRL+SHIFT+A to match GitHub Desktop
Until now the logic for opening the current repository using an external editor was hosted in the RepositoryOpenViewModel. I noticed that the logic for opening the repo in terminal was hosted in its own use-case object, so this change also introduces such an object for the open-in-editor action
This change adds a global menu button for opening the repo in the configured external editor.
|
Hi,
With that, those 3 points of improvements (validate editor path, better handling of error and per-project override become useless). In the hope it helps. |
|
@Escain seems like you are talking about a separate feature. 'Open file' and 'Open project' are two different things. I understand you would like to see the 'Open file' feature added, but this has nothing to do with this PR, which is about 'Open project'. Maybe open a separate issue for your suggestion?
I don't know what you mean. GitHub Desktop has this feature and I use it regularly. I do it via shortcut instead of UI button, but still. If I have a project which is restricted to one folder and I would work on this project by opening that folder in say VS Code, then this is a common action to take at the start of a work session. |
|
I see, so it just opens the folder with the given editor/explorer. Understood. |
This PR implements functionality to open the current repository in an external editor. Below are the main changes:
Things that could still be added:
not an editorinto the editor, it will still be saved and only fails once it tries to actually run that command. We then get an ugly error notification with some low-level error details. Would be nice to hide thoseA few notes:
This PR partially resolves #230