Skip to content

Commit 866edac

Browse files
committed
feature/add-vs-code-integration
1 parent 6b68c41 commit 866edac

12 files changed

+69
-33
lines changed

Src/Consts/C4D.Wizard.Consts.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ TC4DConsts = class
111111
MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_CAPTION = 'Install DelphiLSP extension in VS Code';
112112
MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_NAME = 'C4DWizarVsCodeIntegrationInstallGithubCopilot1';
113113
MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_CAPTION = 'Install GitHub Copilot extension in VS Code';
114+
MENU_IDE_VSCODE_INTEGRATION_INSTALL_Supermaven_NAME = 'C4DWizarVsCodeIntegrationInstallSupermaven1';
115+
MENU_IDE_VSCODE_INTEGRATION_INSTALL_Supermaven_CAPTION = 'Install GitHub Supermaven extension in VS Code';
114116

115117
//FILE .INI REOPEN
116118
REOPEN_INI_Favorite = 'Favorite';

Src/IDE/CompileNotifier/C4D.Wizard.IDE.CompileNotifier.pas

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ implementation
2828
C4D.Wizard.Consts,
2929
C4D.Wizard.Utils,
3030
C4D.Wizard.Utils.OTA,
31-
C4D.Wizard.Settings.Model;
31+
C4D.Wizard.Settings.Model,
32+
C4D.Wizard.ProcessDelphi;
3233

3334
var
3435
IndexNotifier: Integer = -1;
@@ -53,6 +54,7 @@ procedure TC4DWizardIDECompileNotifier.ProjectCompileStarted(const Project: IOTA
5354
var
5455
LIOTAProject: IOTAProject;
5556
LCurrentBinaryPath: string;
57+
LCommand: string;
5658
begin
5759
if(not C4DWizardSettingsModel.BeforeCompilingCheckRunning)then
5860
Exit;
@@ -67,8 +69,12 @@ procedure TC4DWizardIDECompileNotifier.ProjectCompileStarted(const Project: IOTA
6769
begin
6870
if(TC4DWizardUtils.ProcessWindowsExists(ExtractFileName(LCurrentBinaryPath), LCurrentBinaryPath))then
6971
begin
70-
if(not TC4DWizardUtils.ShowQuestion2('The application is already running, do you wish to continue?'))then
72+
if(not TC4DWizardUtils.ShowQuestion2('The application is already running, do you wish to continue (Kills current process)?'))then
7173
Abort;
74+
75+
LCommand := 'taskkill /f /IM ' + ExtractFileName(Project.ProjectOptions.TargetName);
76+
TC4DWizardProcessDelphi.RunCommand([LCommand]);
77+
Sleep(1000);
7278
end;
7379
end;
7480
end;

Src/IDE/MainMenu/C4D.Wizard.IDE.MainMenu.Clicks.pas

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ TC4DWizardIDEMainMenuClicks = class
2222
class procedure ReplaceClick(Sender: TObject);
2323
class procedure NotesClick(Sender: TObject);
2424
class procedure VsCodeIntegrationOpenInVsCodeClick(Sender: TObject);
25-
class procedure VsCodeIntegrationInstallGithubCopilotClick(Sender: TObject);
2625
class procedure VsCodeIntegrationInstallDelphiLSPClick(Sender: TObject);
26+
class procedure VsCodeIntegrationInstallGithubCopilotClick(Sender: TObject);
27+
class procedure VsCodeIntegrationInstallSupermavenClick(Sender: TObject);
2728
class procedure DefaultFilesInOpeningProjectClick(Sender: TObject);
2829
class procedure BackupExportClick(Sender: TObject);
2930
class procedure BackupImportClick(Sender: TObject);
@@ -141,14 +142,20 @@ class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationOpenInVsCodeClick(S
141142
TC4DWizardVsCodeIntegration.Open;
142143
end;
143144

145+
class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallDelphiLSPClick(Sender: TObject);
146+
begin
147+
TC4DWizardVsCodeIntegration.InstallDelphiLSP;
148+
end;
149+
150+
144151
class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallGithubCopilotClick(Sender: TObject);
145152
begin
146153
TC4DWizardVsCodeIntegration.InstallGithubCopilot;
147154
end;
148155

149-
class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallDelphiLSPClick(Sender: TObject);
156+
class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallSupermavenClick(Sender: TObject);
150157
begin
151-
TC4DWizardVsCodeIntegration.InstallDelphiLSP;
158+
TC4DWizardVsCodeIntegration.InstallSupermaven;
152159
end;
153160

154161
class procedure TC4DWizardIDEMainMenuClicks.DefaultFilesInOpeningProjectClick(Sender: TObject);

Src/IDE/MainMenu/C4D.Wizard.IDE.MainMenu.VsCodeIntegration.pas

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ TC4DWizardIDEMainMenuVsCodeIntegration = class(TInterfacedObject, IC4DWizardID
2020
procedure AddMenuVsCodeIntegration;
2121
procedure AddSubMenuItemOpen;
2222
procedure AddSeparator(AName: string);
23-
procedure AddSubMenuInstallGithubCopilot;
2423
procedure AddSubMenuInstallDelphiLSP;
24+
procedure AddSubMenuInstallGithubCopilot;
25+
procedure AddSubMenuInstallSupermaven;
2526
function GetShortcutOpenInVsCode: string;
2627
protected
2728
function Process: IC4DWizardIDEMainMenuVsCodeIntegration;
@@ -54,8 +55,9 @@ function TC4DWizardIDEMainMenuVsCodeIntegration.Process: IC4DWizardIDEMainMenuVs
5455
Self.AddMenuVsCodeIntegration;
5556
Self.AddSubMenuItemOpen;
5657
Self.AddSeparator('C4DVsCodeIntegrationSeparator01');
57-
Self.AddSubMenuInstallGithubCopilot;
5858
Self.AddSubMenuInstallDelphiLSP;
59+
Self.AddSubMenuInstallGithubCopilot;
60+
Self.AddSubMenuInstallSupermaven;
5961
end;
6062

6163
procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSeparator(AName: string);
@@ -92,27 +94,27 @@ procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuItemOpen;
9294
FMenuItemVsCodeIntegration.Add(LMenuItem);
9395
end;
9496

95-
procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuInstallGithubCopilot;
97+
procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuInstallDelphiLSP;
9698
var
9799
LMenuItem: TMenuItem;
98100
begin
99101
LMenuItem := TMenuItem.Create(FMenuItemVsCodeIntegration);
100-
LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_NAME;
101-
LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_CAPTION;
102+
LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_NAME;
103+
LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_CAPTION;
102104
LMenuItem.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexImport;
103-
LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallGithubCopilotClick;
105+
LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallDelphiLSPClick;
104106
FMenuItemVsCodeIntegration.Add(LMenuItem);
105107
end;
106108

107-
procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuInstallDelphiLSP;
109+
procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuInstallGithubCopilot;
108110
var
109111
LMenuItem: TMenuItem;
110112
begin
111113
LMenuItem := TMenuItem.Create(FMenuItemVsCodeIntegration);
112-
LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_NAME;
113-
LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_CAPTION;
114+
LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_NAME;
115+
LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_CAPTION;
114116
LMenuItem.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexImport;
115-
LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallDelphiLSPClick;
117+
LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallGithubCopilotClick;
116118
FMenuItemVsCodeIntegration.Add(LMenuItem);
117119
end;
118120

@@ -123,4 +125,16 @@ function TC4DWizardIDEMainMenuVsCodeIntegration.GetShortcutOpenInVsCode: string;
123125
Result := C4DWizardSettingsModel.ShortcutVsCodeIntegrationOpen.Trim;
124126
end;
125127

128+
procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuInstallSupermaven;
129+
var
130+
LMenuItem: TMenuItem;
131+
begin
132+
LMenuItem := TMenuItem.Create(FMenuItemVsCodeIntegration);
133+
LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_Supermaven_NAME;
134+
LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_Supermaven_CAPTION;
135+
LMenuItem.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexImport;
136+
LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallSupermavenClick;
137+
FMenuItemVsCodeIntegration.Add(LMenuItem);
138+
end;
139+
126140
end.

Src/OpenExternal/C4D.Wizard.OpenExternal.AddEdit.View.dfm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ object C4DWizardOpenExternalAddEditView: TC4DWizardOpenExternalAddEditView
103103
BevelOuter = bvNone
104104
ParentBackground = False
105105
TabOrder = 1
106-
ExplicitTop = -3
107106
DesignSize = (
108107
676
109108
412)

Src/OpenExternal/C4D.Wizard.OpenExternal.View.dfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ object C4DWizardOpenExternalView: TC4DWizardOpenExternalView
209209
Caption = 'Search'
210210
TabOrder = 0
211211
OnClick = btnSearchClick
212+
ExplicitTop = 11
212213
end
213214
object edtSearch: TEdit
214215
AlignWithMargins = True

Src/Reopen/C4D.Wizard.Reopen.View.Edit.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ procedure TC4DWizardReopenViewEdit.FillFields;
100100
LFolderGit: string;
101101
begin
102102
mmFilePath.Lines.Text := FC4DWizardReopenData.FilePath;
103-
ColorBox1.Selected := TC4DWizardUtils.stringToColorDef(FC4DWizardReopenData.Color);
103+
ColorBox1.Selected := TC4DWizardUtils.StringToColorDef(FC4DWizardReopenData.Color);
104104

105105
edtNickname.Text := FC4DWizardReopenData.Nickname;
106106
if(Trim(edtNickname.Text).IsEmpty)then
@@ -120,7 +120,7 @@ procedure TC4DWizardReopenViewEdit.FillFields;
120120
procedure TC4DWizardReopenViewEdit.btnConfirmClick(Sender: TObject);
121121
begin
122122
FC4DWizardReopenData.Nickname := edtNickname.Text;
123-
FC4DWizardReopenData.Color := ColorTostring(ColorBox1.Selected);
123+
FC4DWizardReopenData.Color := ColorToString(ColorBox1.Selected);
124124
FC4DWizardReopenData.FolderGit := Trim(edtFolderGit.Text);
125125
if(cBoxGroup.ItemIndex >= 0)then
126126
FC4DWizardReopenData.GuidGroup := TC4DWizardGroups(cBoxGroup.Items.Objects[cBoxGroup.ItemIndex]).Guid;

Src/Reopen/C4D.Wizard.Reopen.View.dfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ object C4DWizardReopenView: TC4DWizardReopenView
9393
Images = ImageList1
9494
TabOrder = 0
9595
OnClick = btnSearchClick
96+
ExplicitLeft = 807
9697
end
9798
object edtSearch: TEdit
9899
AlignWithMargins = True

Src/Reopen/C4D.Wizard.Reopen.View.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ procedure TC4DWizardReopenView.ListViewHistoryCustomDrawSubItem(Sender: TCustomL
350350
LColorStr := Item.SubItems[C_INDEX_SUBITEM_Color].Trim;
351351
if(not LColorStr.IsEmpty)then
352352
begin
353-
LColor := TC4DWizardUtils.stringToColorDef(LColorStr);
353+
LColor := TC4DWizardUtils.StringToColorDef(LColorStr);
354354
if(LColor <> clBlack)then
355355
Sender.Canvas.Font.Color := LColor
356356
end;

Src/Utils/C4D.Wizard.Utils.OTA.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ class function TC4DWizardUtilsOTA.AddImgIDEResourceName(AResourceName: string):
168168
LMaskColor: TColor;
169169
begin
170170
Result := -1;
171-
if(FindResource(hInstance, PChar(AResourceName), RT_BITMAP) <= 0)then
171+
if(FindResource(HInstance, PChar(AResourceName), RT_BITMAP) <= 0)then
172172
Exit;
173173

174174
LBitmap := TBitmap.Create;
175175
try
176176
try
177-
LBitmap.LoadFromResourceName(hInstance, AResourceName);
177+
LBitmap.LoadFromResourceName(HInstance, AResourceName);
178178
{$IF CompilerVersion = 35} //Alexandria
179179
LMaskColor := clLime;
180180
{$ELSE}

0 commit comments

Comments
 (0)