Skip to content

Commit 218277c

Browse files
committed
Merge branch 'develop'
2 parents 81d6b6d + 866edac commit 218277c

File tree

42 files changed

+816
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+816
-230
lines changed

Package/C4DWizard.dpk

+5-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ contains
130130
C4D.Wizard.UsesOrganization.ListOfUses in '..\Src\UsesOrganization\C4D.Wizard.UsesOrganization.ListOfUses.pas',
131131
C4D.Wizard.FormatSource.View in '..\Src\FormatSource\C4D.Wizard.FormatSource.View.pas' {C4DWizardFormatSourceView},
132132
C4D.Wizard.Notes.View in '..\Src\Notes\C4D.Wizard.Notes.View.pas' {C4DWizardNotesView},
133-
C4D.Wizard.Utils.OTA.Codex in '..\Src\Utils\C4D.Wizard.Utils.OTA.Codex.pas';
133+
C4D.Wizard.Utils.OTA.Codex in '..\Src\Utils\C4D.Wizard.Utils.OTA.Codex.pas',
134+
C4D.Wizard.VsCodeIntegration in '..\Src\VsCodeIntegration\C4D.Wizard.VsCodeIntegration.pas',
135+
C4D.Wizard.IDE.ToolBars.VsCodeIntegration in '..\Src\IDE\ToolBars\C4D.Wizard.IDE.ToolBars.VsCodeIntegration.pas',
136+
C4D.Wizard.IDE.ToolBars.Utils in '..\Src\IDE\ToolBars\C4D.Wizard.IDE.ToolBars.Utils.pas',
137+
C4D.Wizard.IDE.MainMenu.VsCodeIntegration in '..\Src\IDE\MainMenu\C4D.Wizard.IDE.MainMenu.VsCodeIntegration.pas';
134138

135139
end.

Package/C4DWizard.dproj

+8
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@
292292
<FormType>dfm</FormType>
293293
</DCCReference>
294294
<DCCReference Include="..\Src\Utils\C4D.Wizard.Utils.OTA.Codex.pas"/>
295+
<DCCReference Include="..\Src\VsCodeIntegration\C4D.Wizard.VsCodeIntegration.pas"/>
296+
<DCCReference Include="..\Src\IDE\ToolBars\C4D.Wizard.IDE.ToolBars.VsCodeIntegration.pas"/>
297+
<DCCReference Include="..\Src\IDE\ToolBars\C4D.Wizard.IDE.ToolBars.Utils.pas"/>
298+
<DCCReference Include="..\Src\IDE\MainMenu\C4D.Wizard.IDE.MainMenu.VsCodeIntegration.pas"/>
295299
<RcItem Include="Img\C4D_Logo.bmp">
296300
<ResourceType>BITMAP</ResourceType>
297301
<ResourceId>C4D_Logo</ResourceId>
@@ -424,6 +428,10 @@
424428
<ResourceType>BITMAP</ResourceType>
425429
<ResourceId>c4d_clean_and_start</ResourceId>
426430
</RcItem>
431+
<RcItem Include="Img\c4d_vscode.bmp">
432+
<ResourceType>BITMAP</ResourceType>
433+
<ResourceId>c4d_vscode</ResourceId>
434+
</RcItem>
427435
<BuildConfiguration Include="Release">
428436
<Key>Cfg_2</Key>
429437
<CfgParent>Base</CfgParent>

Package/Img/c4d_vscode.bmp

822 Bytes
Binary file not shown.

Src/Consts/C4D.Wizard.Consts.pas

+18
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ TC4DConsts = class
103103
MENU_IDE_FormatSource_CAPTION = 'Format Source';
104104
MENU_IDE_NOTES_NAME = 'C4DWizarNotes1';
105105
MENU_IDE_NOTES_CAPTION = 'Notes';
106+
MENU_IDE_VSCODE_INTEGRATION_NAME = 'C4DWizarVsCodeIntegration1';
107+
MENU_IDE_VSCODE_INTEGRATION_CAPTION = 'Vs Code Integration';
108+
MENU_IDE_VSCODE_INTEGRATION_OPEN_NAME = 'C4DWizarVsCodeIntegrationOpen1';
109+
MENU_IDE_VSCODE_INTEGRATION_OPEN_CAPTION = 'Open In VS Code';
110+
MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_NAME = 'C4DWizarVsCodeIntegrationInstallDelphiLSP1';
111+
MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_CAPTION = 'Install DelphiLSP extension in VS Code';
112+
MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_NAME = 'C4DWizarVsCodeIntegrationInstallGithubCopilot1';
113+
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';
106116

107117
//FILE .INI REOPEN
108118
REOPEN_INI_Favorite = 'Favorite';
@@ -171,6 +181,14 @@ TC4DConsts = class
171181
//TOOLBAR UTILITIES INI
172182
TOOL_BAR_UTILITIES_INI_Visible = 'Visible';
173183

184+
//TOOLBAR VS Code Integration
185+
TOOL_BAR_VsCodeIntegration_NAME = 'C4DToolBarVsCodeIntegration';
186+
TOOL_BAR_VsCodeIntegration_CAPTION = 'C4D VS Code Integration';
187+
TOOL_BAR_VsCodeIntegration_TOOL_BUTTON_OpenInVsCode_NAME = 'C4DToolButtoVsCodeIntegrationOpen';
188+
TOOL_BAR_VsCodeIntegration_TOOL_BUTTON_OpenInVsCode_CAPTION = 'Open In VS Code';
189+
//TOOLBAR VS Code Integration INI
190+
TOOL_BAR_VsCodeIntegration_INI_Visible = 'Visible';
191+
174192
EXTENSIONS_PERMITTED_BACKUP_EXPORT: TC4DExtensionsOfFiles = [TC4DExtensionsFiles.INI,
175193
TC4DExtensionsFiles.BMP];
176194

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

+8-2
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/EditServicesNotifier/C4D.Wizard.IDE.EditServicesNotifier.pas

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ procedure TC4DWizardIDEEditServicesNotifier.EditorViewActivated(const EditWindow
8080
procedure TC4DWizardIDEEditServicesNotifier.EditorViewModified(const EditWindow: INTAEditWindow; const EditView: IOTAEditView);
8181
begin
8282
// AddLogInternal('EditorViewModified: ' +
83-
// ' Linha atual: ' + EditView.Buffer.EditPosition.Row.Tostring +
84-
// ' Coluna atual: ' + EditView.Buffer.EditPosition.Column.Tostring +
85-
// ' Ultima linha: ' + EditView.Buffer.EditPosition.LastRow.Tostring);
83+
// ' Linha atual: ' + EditView.Buffer.EditPosition.Row.ToString +
84+
// ' Coluna atual: ' + EditView.Buffer.EditPosition.Column.ToString +
85+
// ' Ultima linha: ' + EditView.Buffer.EditPosition.LastRow.ToString);
8686
end;
8787

8888
procedure TC4DWizardIDEEditServicesNotifier.WindowActivated(const EditWindow: INTAEditWindow);
@@ -92,7 +92,7 @@ procedure TC4DWizardIDEEditServicesNotifier.WindowActivated(const EditWindow: IN
9292

9393
procedure TC4DWizardIDEEditServicesNotifier.WindowCommand(const EditWindow: INTAEditWindow; Command, Param: Integer; var Handled: Boolean);
9494
begin
95-
//AddLogInternal('WindowCommand: Command: ' + Command.Tostring + ' - Param: ' + Param.Tostring);
95+
//AddLogInternal('WindowCommand: Command: ' + Command.ToString + ' - Param: ' + Param.ToString);
9696
//if(Command = 22)then
9797
//begin
9898
// ShowMessage('Você teclou Ctrl + C e essa opção não é permitida');

Src/IDE/ImageListMain/C4D.Wizard.IDE.ImageListMain.pas

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ TC4DWizardIDEImageListMain = class
3737
FImgIndexVerifyDocument: Integer;
3838
FImgIndexNotes: Integer;
3939
FImgIndexCleanAndStart: Integer;
40+
FImgIndexVsCode: Integer;
4041
constructor Create;
4142
public
4243
property ImgIndexC4D_Logo: Integer read FImgIndexC4D_Logo;
@@ -67,6 +68,7 @@ TC4DWizardIDEImageListMain = class
6768
property ImgIndexVerifyDocument: Integer read FImgIndexVerifyDocument;
6869
property ImgIndexNotes: Integer read FImgIndexNotes;
6970
property ImgIndexCleanAndStart: Integer read FImgIndexCleanAndStart;
71+
property ImgIndexVsCode: Integer read FImgIndexVsCode;
7072
class function GetInstance: TC4DWizardIDEImageListMain;
7173
end;
7274

@@ -115,6 +117,7 @@ constructor TC4DWizardIDEImageListMain.Create;
115117
FImgIndexVerifyDocument := TC4DWizardUtilsOTA.AddImgIDEResourceName('c4d_verify_document');
116118
FImgIndexNotes := TC4DWizardUtilsOTA.AddImgIDEResourceName('c4d_notes');
117119
FImgIndexCleanAndStart := TC4DWizardUtilsOTA.AddImgIDEResourceName('c4d_clean_and_start');
120+
FImgIndexVsCode := TC4DWizardUtilsOTA.AddImgIDEResourceName('c4d_vscode');
118121
end;
119122

120123
initialization

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface
99
C4D.Wizard.Backup.Interfaces;
1010

1111
type
12-
TC4DWizardIDEMainMenuBakcups = class(TInterfacedObject, IC4DWizardIDEMainMenuBackup)
12+
TC4DWizardIDEMainMenuBackup = class(TInterfacedObject, IC4DWizardIDEMainMenuBackup)
1313
private
1414
FMenuItemC4D: TMenuItem;
1515
FMenuItemSave: TMenuItem;
@@ -30,24 +30,24 @@ implementation
3030
C4D.Wizard.IDE.ImageListMain,
3131
C4D.Wizard.IDE.MainMenu.Clicks;
3232

33-
class function TC4DWizardIDEMainMenuBakcups.New(AMenuItemParent: TMenuItem): IC4DWizardIDEMainMenuBackup;
33+
class function TC4DWizardIDEMainMenuBackup.New(AMenuItemParent: TMenuItem): IC4DWizardIDEMainMenuBackup;
3434
begin
3535
Result := Self.Create(AMenuItemParent);
3636
end;
3737

38-
constructor TC4DWizardIDEMainMenuBakcups.Create(AMenuItemParent: TMenuItem);
38+
constructor TC4DWizardIDEMainMenuBackup.Create(AMenuItemParent: TMenuItem);
3939
begin
4040
FMenuItemC4D := AMenuItemParent;
4141
end;
4242

43-
function TC4DWizardIDEMainMenuBakcups.Process: IC4DWizardIDEMainMenuBackup;
43+
function TC4DWizardIDEMainMenuBackup.Process: IC4DWizardIDEMainMenuBackup;
4444
begin
4545
Self.AddMenuItemSave;
4646
Self.AddMenuItemExport;
4747
Self.AddMenuItemImport;
4848
end;
4949

50-
procedure TC4DWizardIDEMainMenuBakcups.AddMenuItemSave;
50+
procedure TC4DWizardIDEMainMenuBackup.AddMenuItemSave;
5151
begin
5252
FMenuItemSave := TMenuItem.Create(FMenuItemC4D);
5353
FMenuItemSave.Name := TC4DConsts.MENU_IDE_BACKUP_NAME;
@@ -56,7 +56,7 @@ procedure TC4DWizardIDEMainMenuBakcups.AddMenuItemSave;
5656
FMenuItemC4D.Add(FMenuItemSave);
5757
end;
5858

59-
procedure TC4DWizardIDEMainMenuBakcups.AddMenuItemExport;
59+
procedure TC4DWizardIDEMainMenuBackup.AddMenuItemExport;
6060
var
6161
LItemExport: TMenuItem;
6262
begin
@@ -68,7 +68,7 @@ procedure TC4DWizardIDEMainMenuBakcups.AddMenuItemExport;
6868
FMenuItemSave.Add(LItemExport);
6969
end;
7070

71-
procedure TC4DWizardIDEMainMenuBakcups.AddMenuItemImport;
71+
procedure TC4DWizardIDEMainMenuBackup.AddMenuItemImport;
7272
var
7373
LItemImport: TMenuItem;
7474
begin

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

+28-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ TC4DWizardIDEMainMenuClicks = class
2121
class procedure FindClick(Sender: TObject);
2222
class procedure ReplaceClick(Sender: TObject);
2323
class procedure NotesClick(Sender: TObject);
24+
class procedure VsCodeIntegrationOpenInVsCodeClick(Sender: TObject);
25+
class procedure VsCodeIntegrationInstallDelphiLSPClick(Sender: TObject);
26+
class procedure VsCodeIntegrationInstallGithubCopilotClick(Sender: TObject);
27+
class procedure VsCodeIntegrationInstallSupermavenClick(Sender: TObject);
2428
class procedure DefaultFilesInOpeningProjectClick(Sender: TObject);
2529
class procedure BackupExportClick(Sender: TObject);
2630
class procedure BackupImportClick(Sender: TObject);
@@ -52,7 +56,8 @@ implementation
5256
C4D.Wizard.View.About,
5357
C4D.Wizard.DefaultFilesInOpeningProject,
5458
C4D.Wizard.FormatSource.View,
55-
C4D.Wizard.Notes.View;
59+
C4D.Wizard.Notes.View,
60+
C4D.Wizard.VsCodeIntegration;
5661

5762
class procedure TC4DWizardIDEMainMenuClicks.UsesOrganizationClick(Sender: TObject);
5863
var
@@ -132,11 +137,30 @@ class procedure TC4DWizardIDEMainMenuClicks.NotesClick(Sender: TObject);
132137
C4D.Wizard.Notes.View.C4DWizardNotesViewShowDockableForm;
133138
end;
134139

140+
class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationOpenInVsCodeClick(Sender: TObject);
141+
begin
142+
TC4DWizardVsCodeIntegration.Open;
143+
end;
144+
145+
class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallDelphiLSPClick(Sender: TObject);
146+
begin
147+
TC4DWizardVsCodeIntegration.InstallDelphiLSP;
148+
end;
149+
150+
151+
class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallGithubCopilotClick(Sender: TObject);
152+
begin
153+
TC4DWizardVsCodeIntegration.InstallGithubCopilot;
154+
end;
155+
156+
class procedure TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallSupermavenClick(Sender: TObject);
157+
begin
158+
TC4DWizardVsCodeIntegration.InstallSupermaven;
159+
end;
160+
135161
class procedure TC4DWizardIDEMainMenuClicks.DefaultFilesInOpeningProjectClick(Sender: TObject);
136162
begin
137-
TC4DWizardDefaultFilesInOpeningProject
138-
.New(Self.GetFileNameCurrentProject)
139-
.SelectionFilesForDefaultOpening;
163+
TC4DWizardDefaultFilesInOpeningProject.New(Self.GetFileNameCurrentProject).SelectionFilesForDefaultOpening;
140164
end;
141165

142166
class procedure TC4DWizardIDEMainMenuClicks.BackupExportClick(Sender: TObject);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function TC4DWizardIDEMainMenuOpenExternal.CreateSubMenu(const AMenuItemParent:
196196
LMenuItem: TMenuItem;
197197
begin
198198
LMenuItem := TMenuItem.Create(AMenuItemParent);
199-
LMenuItem.Name := 'C4DOpenExternalItemMenu' + TC4DWizardUtils.IncInt(FCont).Tostring;
199+
LMenuItem.Name := 'C4DOpenExternalItemMenu' + TC4DWizardUtils.IncInt(FCont).ToString;
200200
LMenuItem.Caption := AC4DWizardOpenExternal.Description;
201201
LMenuItem.OnClick := Self.ItemMenuClick;
202202
LMenuItem.Hint := AC4DWizardOpenExternal.Path + TC4DConsts.OPEN_EXTERNAL_Separator_PARAMETERS + AC4DWizardOpenExternal.Parameters;

0 commit comments

Comments
 (0)