Skip to content

Commit

Permalink
feat: add custom command arguments setting for editor launch
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanzyTHEbar committed Feb 18, 2025
1 parent eb158a5 commit 1c7bc4b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<description>Path to your editor binary (code, codium, code-insiders) or 'auto' for
automatic detection</description>
</key>
<key name="custom-cmd-args" type="s">
<default>''</default>
<summary>Custom CMD Args</summary>
<description>Arguments to pass to the editors' cli</description>
</key>
<key name="new-window" type="b">
<default>false</default>
<summary>New Window</summary>
Expand Down
1 change: 1 addition & 0 deletions gnome-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
// TODO: Sort by Path, Recent, Saved
// TODO: Ability to mark as favorite
// TODO: Show favourites at the top separated by a separator

// TODO: Implement support for snap, and flatpak installations

interface Workspace {
Expand Down
22 changes: 20 additions & 2 deletions gnome-extension/src/prefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class VSCodeWorkspacesPreferences extends ExtensionPreferences {
const editorLocation = new Adw.EntryRow({
title: _('editor Location'),
showApplyButton: true,
inputPurpose: Gtk.InputPurpose.TERMINAL,
inputPurpose: Gtk.InputPurpose.FREE_FORM,
inputHints: Gtk.InputHints.WORD_COMPLETION,
});

Expand All @@ -51,9 +51,20 @@ export default class VSCodeWorkspacesPreferences extends ExtensionPreferences {
subtitle: _('Whether to prefer the workspace file over the workspace directory if a workspace file is present'),
});

const customCmdArgs = new Adw.EntryRow({
title: _('Custom CMD Args'),
showApplyButton: true,
inputPurpose: Gtk.InputPurpose.FREE_FORM,
inputHints: Gtk.InputHints.NONE,
child: new Gtk.Entry({
placeholder_text: _('Custom command line arguments for launching the editor'),
})
});

editorGroup.add(editorLocation);
editorGroup.add(preferWorkspaceFile);
editorGroup.add(debug);
editorGroup.add(customCmdArgs);
page.add(editorGroup);

// Group for Refresh Interval setting
Expand Down Expand Up @@ -90,7 +101,7 @@ export default class VSCodeWorkspacesPreferences extends ExtensionPreferences {
const nofailEntry = new Adw.EntryRow({
title: _('No-fail Workspaces'),
showApplyButton: true,
inputPurpose: Gtk.InputPurpose.TERMINAL,
inputPurpose: Gtk.InputPurpose.FREE_FORM,
inputHints: Gtk.InputHints.WORD_COMPLETION,
child: new Gtk.Entry({
placeholder_text: _('Comma separated list of workspace directories to not fail'),
Expand Down Expand Up @@ -135,6 +146,13 @@ export default class VSCodeWorkspacesPreferences extends ExtensionPreferences {
Gio.SettingsBindFlags.DEFAULT
);

_settings.bind(
'custom-cmd-args',
customCmdArgs,
'text',
Gio.SettingsBindFlags.DEFAULT
);

// Bind new settings
_settings.bind(
'cleanup-orphaned-workspaces',
Expand Down

0 comments on commit 1c7bc4b

Please sign in to comment.