From 7624d1381953376bad8c5d1d03f69292f8ec2a5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9sar=20Cardoso?=
<33873267+Cesar4D@users.noreply.github.com>
Date: Wed, 12 Mar 2025 08:34:27 -0300
Subject: [PATCH 01/11] Update README.md
---
README.md | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/README.md b/README.md
index 55f3554..5d59006 100644
--- a/README.md
+++ b/README.md
@@ -15,28 +15,6 @@ Receive suggestions for creating and improving code directly in the IDE and take
[](https://go.hotmart.com/U81331747Y?dp=1)
[](mailto:contato@code4delphi.com.br)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
## 🚀 INSTALLATION
1 - Download Delphi AI Developer. You can download the .zip file or clone the project on your PC.
From 44697fefd8c2eeaebf22df746b12c2b4b9be59de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9sar=20Cardoso?=
<33873267+Cesar4D@users.noreply.github.com>
Date: Sun, 18 May 2025 15:14:14 -0300
Subject: [PATCH 02/11] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5d59006..9b37e71 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# Delphi AI Developer (Copilot)
-Inspired by GitHub Copilot, Delphi AI Developer is a plugin that adds Artificial intelligence (AI) interaction capabilities to the Delphi IDE, using both the OpenAI API, Gemini API and Groq API, as well as offering offline AI support.
+Inspired by GitHub Copilot, Delphi AI Developer is a plugin that adds Artificial intelligence (AI) interaction capabilities to the Delphi IDE, using both the OpenAI API, Gemini API, Mistral API and Groq API, as well as offering offline AI support.
With Delphi AI Developer, you will have assistance in generating and refactoring code, facilitating and accelerating development.
From 386c339d0b4000d4cdb1a6e23959f77bf840bc4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9sar=20Cardoso?=
<33873267+Cesar4D@users.noreply.github.com>
Date: Mon, 9 Jun 2025 12:02:35 -0300
Subject: [PATCH 03/11] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 9b37e71..63399fa 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Delphi AI Developer (Copilot)
+# Delphi AI Developer
Inspired by GitHub Copilot, Delphi AI Developer is a plugin that adds Artificial intelligence (AI) interaction capabilities to the Delphi IDE, using both the OpenAI API, Gemini API, Mistral API and Groq API, as well as offering offline AI support.
With Delphi AI Developer, you will have assistance in generating and refactoring code, facilitating and accelerating development.
From f6b2538a36660c3a666a44f4b941ee2f1633849a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9sar=20Cardoso?=
<33873267+Cesar4D@users.noreply.github.com>
Date: Thu, 15 Jan 2026 10:13:20 -0300
Subject: [PATCH 04/11] Update funding source to GitHub for Code4Delphi (#41)
---
.github/FUNDING.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 89e42ea..400998e 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1 +1 @@
-custom: ['https://pag.ae/7ZhEY1xKr']
+github: [Code4Delphi]
From 86989b7b45e2fb79a2b8a4e807539fdc43f14a84 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9sar=20Cardoso?=
<33873267+Cesar4D@users.noreply.github.com>
Date: Thu, 15 Jan 2026 11:48:15 -0300
Subject: [PATCH 05/11] Add custom funding link to FUNDING.yml (#42)
---
.github/FUNDING.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 400998e..5a6bb7d 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1 +1,2 @@
github: [Code4Delphi]
+custom: ['https://pag.ae/81pZhZW2G']
From ad81e36be72ffc2c3e113267118301d978232828 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9sar=20Cardoso?=
<33873267+Cesar4D@users.noreply.github.com>
Date: Thu, 15 Jan 2026 14:49:12 -0300
Subject: [PATCH 06/11] Update FUNDING.yml (#43)
---
.github/FUNDING.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 5a6bb7d..eb74729 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,2 +1,2 @@
github: [Code4Delphi]
-custom: ['https://pag.ae/81pZhZW2G']
+custom: ['https://code4delphi.com.br/blog/apoie-com-um-cafe/']
From 3dc891889787444cecb9d9e33a84f27a34219967 Mon Sep 17 00:00:00 2001
From: Gaitolini
Date: Tue, 27 Jan 2026 23:57:55 -0300
Subject: [PATCH 07/11] =?UTF-8?q?feat:=20Inje=C3=A7=C3=A3o=20autom=C3=A1ti?=
=?UTF-8?q?ca=20da=20interface=20da=20unit=20no=20contexto=20do=20Code=20C?=
=?UTF-8?q?ompletion?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.agent/rules/regra-1.md | 6 +
Package/DelphiAIDeveloper.dproj | 475 +++++++++++++-----
Package/DelphiAIDeveloper.res | Bin 688 -> 688 bytes
RULES.md | 4 +
.../DelphiAIDev.CodeCompletion.Search.pas | 7 +
.../DelphiAIDev.CodeCompletion.Vars.pas | 3 +
Src/Utils/DelphiAIDev.Utils.Context.pas | 64 +++
7 files changed, 441 insertions(+), 118 deletions(-)
create mode 100644 .agent/rules/regra-1.md
create mode 100644 RULES.md
create mode 100644 Src/Utils/DelphiAIDev.Utils.Context.pas
diff --git a/.agent/rules/regra-1.md b/.agent/rules/regra-1.md
new file mode 100644
index 0000000..513a1d3
--- /dev/null
+++ b/.agent/rules/regra-1.md
@@ -0,0 +1,6 @@
+---
+trigger: always_on
+glob:
+description:
+---
+
diff --git a/Package/DelphiAIDeveloper.dproj b/Package/DelphiAIDeveloper.dproj
index cc578f1..d6df9a5 100644
--- a/Package/DelphiAIDeveloper.dproj
+++ b/Package/DelphiAIDeveloper.dproj
@@ -7,7 +7,7 @@
True
Debug
Win32
- 1048577
+ 1
Package
DelphiAIDeveloper
@@ -39,11 +39,6 @@
Base
true
-
- true
- Base
- true
-
true
Base
@@ -103,13 +98,6 @@
rtl;bindengine;bindcomp;RESTComponents;vclFireDAC;FireDAC;FireDACCommonDriver;FireDACCommon;FireDACIBDriver;FireDACMySQLDriver;$(DCC_UsePackage)
-
- Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)
- Debug
- true
- 1033
- true
-
DEBUG;$(DCC_Define)
true
@@ -278,6 +266,10 @@
BITMAP
c4d_database_execute
+
+ Cfg_2
+ Base
+
Base
@@ -285,10 +277,6 @@
Cfg_1
Base
-
- Cfg_2
- Base
-
Delphi.Personality.12
@@ -306,11 +294,11 @@
Microsoft Office XP Sample Automation Server Wrapper Components
-
+
-
-
+
+
1
@@ -319,6 +307,16 @@
0
+
+
+ classes
+ 1
+
+
+ classes
+ 1
+
+
res\xml
@@ -329,6 +327,12 @@
1
+
+
+ library\lib\armeabi-v7a
+ 1
+
+
library\lib\armeabi
@@ -731,10 +735,6 @@
1
.framework
-
- 1
- .framework
-
0
@@ -748,10 +748,6 @@
1
.dylib
-
- 1
- .dylib
-
0
.dll;.bpl
@@ -766,7 +762,7 @@
1
.dylib
-
+
1
.dylib
@@ -778,10 +774,6 @@
1
.dylib
-
- 1
- .dylib
-
0
.bpl
@@ -800,7 +792,7 @@
0
-
+
0
@@ -809,174 +801,157 @@
0
-
- 0
-
0
-
-
+
+
+ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
1
-
+
+ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
1
-
-
-
-
-
- Contents\Resources
- 1
-
-
- Contents\Resources
+
+
+ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
1
-
- Contents\Resources
+
+ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
1
-
-
- library\lib\armeabi-v7a
+
+
+ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
1
-
- library\lib\arm64-v8a
+
+ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
1
+
+
1
1
-
+
1
-
+
+
+
1
-
+
1
-
+
1
-
+
+
+
1
-
- 0
+
+ 1
-
-
-
- library\lib\armeabi-v7a
+
1
-
-
+
+
1
-
+
1
-
+
1
-
+
- ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
1
- ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
1
-
- ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
+
1
-
-
-
-
+
1
1
-
+
1
-
-
- Assets
+
+
1
-
- Assets
+
1
-
-
-
- Assets
+
1
-
- Assets
+
+
+
1
-
-
- ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
1
-
- ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
+
1
-
+
+
+ 1
+
- ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
1
-
- ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
+
1
-
+
- ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
+ ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
1
- ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset
+ ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
1
-
+
+
+ 1
+
- ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
1
-
- ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
+
1
@@ -1040,6 +1015,105 @@
1
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
@@ -1050,6 +1124,17 @@
1
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
@@ -1060,6 +1145,50 @@
1
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset
@@ -1140,19 +1269,130 @@
1
-
-
-
+
+
+ 1
+
+
+ 1
+
+
+
+
+ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
+ 1
+
+
+ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
+ 1
+
+
+
+
+
+
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+
+
+
+
+
+ Contents\Resources
+ 1
+
+
+ Contents\Resources
+ 1
+
+
+
+
+ library\lib\armeabi-v7a
+ 1
+
+
+ library\lib\arm64-v8a
+ 1
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+ 1
+
+
+ 0
+
+
+
+
+ library\lib\armeabi-v7a
+ 1
+
+
+
+
+ 1
+
+
+ 1
+
+
+
+
+ Assets
+ 1
+
+
+ Assets
+ 1
+
+
+
+
+ Assets
+ 1
+
+
+ Assets
+ 1
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
False
@@ -1160,7 +1400,6 @@
False
True
False
- True
12
diff --git a/Package/DelphiAIDeveloper.res b/Package/DelphiAIDeveloper.res
index 4a3736958c96db4bf8b7cc4c4b21eaaaee609d94..9273b0906bbd637e9fa31e00b2dfb72f35131e39 100644
GIT binary patch
delta 16
XcmdnMx`A~=0TUzB 0 then
+ begin
+ SetLength(LBuffer, LFileSize);
+ LReader.GetText(0, PAnsiChar(LBuffer), LFileSize);
+
+ Result := String(LBuffer);
+
+ LImplPos := Pos('implementation', LowerCase(Result));
+ if LImplPos > 0 then
+ Result := Copy(Result, 1, LImplPos - 1);
+ end;
+ finally
+ LReader := nil;
+ end;
+end;
+
+end.
From 23c3dc40caaab11cf9713f4c9176a4616cbc6cd3 Mon Sep 17 00:00:00 2001
From: Gaitolini
Date: Wed, 28 Jan 2026 00:02:48 -0300
Subject: [PATCH 08/11] feat: Add test case and documentation for the global
context feature in AI code completion.
---
Src/Test/DelphiAIDev.Test.ContextDemo.pas | 47 ++++++++++++++++++++
TEST_CONTEXT_FEATURE.md | 53 +++++++++++++++++++++++
2 files changed, 100 insertions(+)
create mode 100644 Src/Test/DelphiAIDev.Test.ContextDemo.pas
create mode 100644 TEST_CONTEXT_FEATURE.md
diff --git a/Src/Test/DelphiAIDev.Test.ContextDemo.pas b/Src/Test/DelphiAIDev.Test.ContextDemo.pas
new file mode 100644
index 0000000..1af4ecf
--- /dev/null
+++ b/Src/Test/DelphiAIDev.Test.ContextDemo.pas
@@ -0,0 +1,47 @@
+unit DelphiAIDev.Test.ContextDemo;
+
+interface
+
+uses
+ System.SysUtils;
+
+type
+ // Classe de exemplo para testar o Contexto Global da IA
+ TShoppingCartItem = class
+ private
+ FItemName: string;
+ FQuantity: Integer;
+ FPrice: Currency;
+ FDiscount: Currency;
+ FTotal: Currency;
+ procedure SetTotal(const Value: Currency);
+ public
+ // A IA deve ser capaz de ler estas propriedades na interface
+ // mesmo que o cursor esteja lá embaixo na implementação.
+ property ItemName: string read FItemName write FItemName;
+ property Quantity: Integer read FQuantity write FQuantity;
+ property Price: Currency read FPrice write FPrice;
+ property Discount: Currency read FDiscount write FDiscount;
+ property Total: Currency read FTotal write SetTotal;
+
+ procedure CalculateFinalPrice;
+ end;
+
+implementation
+
+{ TShoppingCartItem }
+
+procedure TShoppingCartItem.SetTotal(const Value: Currency);
+begin
+ FTotal := Value;
+end;
+
+// -----------------------------------------------------------------------------
+// CASO DE TESTE:
+// Posicione o cursor na linha abaixo e acione o Code Completion (Alt+Enter padrão)
+// Tente algo como: "Implemente o metodo CalculateFinalPrice considerando desconto"
+// -----------------------------------------------------------------------------
+
+// << PONTO DE TESTE AQUI >>
+
+end.
diff --git a/TEST_CONTEXT_FEATURE.md b/TEST_CONTEXT_FEATURE.md
new file mode 100644
index 0000000..bb51986
--- /dev/null
+++ b/TEST_CONTEXT_FEATURE.md
@@ -0,0 +1,53 @@
+# Guia de Teste: Code Completion com Contexto Global
+
+Este guia explica como validar a feature `feature/contexto-global`.
+
+## O Cenário
+
+Criamos uma unit de exemplo em `Src/Test/DelphiAIDev.Test.ContextDemo.pas`. Ela possui uma classe `TShoppingCartItem` definida na `interface`, com campos privados (`FQuantity`, `FPrice`, `FDiscount`, `FTotal`).
+
+## Como Testar
+
+1. Abra o arquivo `Src/Test/DelphiAIDev.Test.ContextDemo.pas` no Delphi.
+2. Vá para a seção `implementation`, onde diz `// << PONTO DE TESTE AQUI >>`.
+3. Digite o seguinte comentário ou apenas posicione o cursor e abra o chat/completion:
+
+ ```delphi
+ // Implemente o procedure CalculateFinalPrice
+ ```
+
+4. Acione o atalho do **Code Completion** (Padrão: `Alt + Enter` ou conforme sua config).
+
+## Comparativo de Resultados
+
+### ❌ Antes (Sem Contexto)
+
+A IA recebia apenas a linha onde estava o cursor ou o texto selecionado.
+
+* **Provável Resposta**: A IA criaria um código genérico ou inventaria variáveis, pois não sabia que `FPrice` ou `FQuantity` existiam.
+
+ ```delphi
+ procedure TShoppingCartItem.CalculateFinalPrice;
+ begin
+ // A IA não sabe quais variáveis usar
+ // Pode inventar algo como: Result := A * B;
+ end;
+ ```
+
+### ✅ Agora (Com Feature Ativa)
+
+A IA recebe todo o código entre `unit` e `implementation`.
+
+* **Resultado Esperado**: A IA deve reconhecer os campos da classe e montar a lógica correta.
+
+ ```delphi
+ procedure TShoppingCartItem.CalculateFinalPrice;
+ begin
+ // A IA sabe que FTotal, FQuantity, FPrice e FDiscount existem!
+ FTotal := (FQuantity * FPrice) - FDiscount;
+ end;
+ ```
+
+## Dica Extra
+
+Experimente adicionar um `uses System.Math;` na interface e pedir para usar uma função matemática. A IA deverá saber que a unit já foi declarada e não sugerir adicioná-la novamente de forma redundante.
From 8c8761636cdc09801680fdc80aadef4a84cf91b2 Mon Sep 17 00:00:00 2001
From: Gaitolini
Date: Wed, 28 Jan 2026 00:28:36 -0300
Subject: [PATCH 09/11] feat: Create DelphiAIDeveloper package and add
DelphiAIDev.Utils.Context unit.
---
Package/DelphiAIDeveloper.dpk | 4 ++-
Package/DelphiAIDeveloper.dproj | 2 ++
Src/Utils/DelphiAIDev.Utils.Context.pas | 39 ++++++++++++++++---------
3 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/Package/DelphiAIDeveloper.dpk b/Package/DelphiAIDeveloper.dpk
index 28b6eda..081931c 100644
--- a/Package/DelphiAIDeveloper.dpk
+++ b/Package/DelphiAIDeveloper.dpk
@@ -115,6 +115,8 @@ contains
DelphiAIDev.Test.Client in '..\Src\Test\DelphiAIDev.Test.Client.pas',
DelphiAIDev.CodeCompletion.KeyTab in '..\Src\CodeCompletion\DelphiAIDev.CodeCompletion.KeyTab.pas',
DelphiAIDev.AI.Response in '..\Src\AI\DelphiAIDev.AI.Response.pas',
- DelphiAIDev.AI.Mistral in '..\Src\AI\DelphiAIDev.AI.Mistral.pas';
+ DelphiAIDev.AI.Mistral in '..\Src\AI\DelphiAIDev.AI.Mistral.pas',
+ DelphiAIDev.Utils.Context in '..\Src\Utils\DelphiAIDev.Utils.Context.pas',
+ DelphiAIDev.Test.ContextDemo in '..\Src\Test\DelphiAIDev.Test.ContextDemo.pas';
end.
diff --git a/Package/DelphiAIDeveloper.dproj b/Package/DelphiAIDeveloper.dproj
index d6df9a5..11a4ed5 100644
--- a/Package/DelphiAIDeveloper.dproj
+++ b/Package/DelphiAIDeveloper.dproj
@@ -234,6 +234,8 @@
+
+
BITMAP
c4d_Logo
diff --git a/Src/Utils/DelphiAIDev.Utils.Context.pas b/Src/Utils/DelphiAIDev.Utils.Context.pas
index d7fb88e..712a778 100644
--- a/Src/Utils/DelphiAIDev.Utils.Context.pas
+++ b/Src/Utils/DelphiAIDev.Utils.Context.pas
@@ -16,12 +16,17 @@ TUtilsContext = class
implementation
class function TUtilsContext.GetUnitInterfaceCode: string;
+const
+ ChunkSize = 1024;
var
LModule: IOTAModule;
LEditor: IOTASourceEditor;
LReader: IOTAEditReader;
- LBuffer: AnsiString;
- LFileSize: Integer;
+ LBuffer: array[0..ChunkSize - 1] of AnsiChar;
+ LPartStr: AnsiString;
+ LTotalText: AnsiString;
+ LPos: Integer;
+ LBytesRead: Integer;
LImplPos: Integer;
i: Integer;
begin
@@ -44,18 +49,24 @@ class function TUtilsContext.GetUnitInterfaceCode: string;
if not Assigned(LReader) then Exit;
try
- LFileSize := LReader.GetFileSize;
- if LFileSize > 0 then
- begin
- SetLength(LBuffer, LFileSize);
- LReader.GetText(0, PAnsiChar(LBuffer), LFileSize);
-
- Result := String(LBuffer);
-
- LImplPos := Pos('implementation', LowerCase(Result));
- if LImplPos > 0 then
- Result := Copy(Result, 1, LImplPos - 1);
- end;
+ LPos := 0;
+ LTotalText := '';
+
+ repeat
+ LBytesRead := LReader.GetText(LPos, PAnsiChar(@LBuffer), ChunkSize);
+ if LBytesRead > 0 then
+ begin
+ SetString(LPartStr, PAnsiChar(@LBuffer), LBytesRead);
+ LTotalText := LTotalText + LPartStr;
+ Inc(LPos, LBytesRead);
+ end;
+ until LBytesRead < ChunkSize;
+
+ Result := String(LTotalText);
+
+ LImplPos := Pos('implementation', LowerCase(Result));
+ if LImplPos > 0 then
+ Result := Copy(Result, 1, LImplPos - 1);
finally
LReader := nil;
end;
From 9cae427bbcc9a3c36ddcd3ff8cdb7f9afb366744 Mon Sep 17 00:00:00 2001
From: Gaitolini
Date: Wed, 28 Jan 2026 00:38:42 -0300
Subject: [PATCH 10/11] docs: Remove `TEST_CONTEXT_FEATURE.md` and `RULES.md`
documentation files.
---
.agent/rules/regra-1.md | 6 -----
RULES.md | 4 ----
TEST_CONTEXT_FEATURE.md | 53 -----------------------------------------
3 files changed, 63 deletions(-)
delete mode 100644 .agent/rules/regra-1.md
delete mode 100644 RULES.md
delete mode 100644 TEST_CONTEXT_FEATURE.md
diff --git a/.agent/rules/regra-1.md b/.agent/rules/regra-1.md
deleted file mode 100644
index 513a1d3..0000000
--- a/.agent/rules/regra-1.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-trigger: always_on
-glob:
-description:
----
-
diff --git a/RULES.md b/RULES.md
deleted file mode 100644
index a707531..0000000
--- a/RULES.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Regras do Agente (Agent Rules)
-
-1. **Idioma Padrão**: Todas as respostas, explicações e comentários no código devem ser feitos em **Português do Brasil (pt-BR)**, a menos que solicitado o contrário explicitamente.
-2. **Estilo de Código**: Manter o padrão do projeto Delphi (PascalCase, indentação de 2 espaços ou conforme arquivo existente, prefixos 'F' para campos privados, 'T' para tipos, etc.).
diff --git a/TEST_CONTEXT_FEATURE.md b/TEST_CONTEXT_FEATURE.md
deleted file mode 100644
index bb51986..0000000
--- a/TEST_CONTEXT_FEATURE.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# Guia de Teste: Code Completion com Contexto Global
-
-Este guia explica como validar a feature `feature/contexto-global`.
-
-## O Cenário
-
-Criamos uma unit de exemplo em `Src/Test/DelphiAIDev.Test.ContextDemo.pas`. Ela possui uma classe `TShoppingCartItem` definida na `interface`, com campos privados (`FQuantity`, `FPrice`, `FDiscount`, `FTotal`).
-
-## Como Testar
-
-1. Abra o arquivo `Src/Test/DelphiAIDev.Test.ContextDemo.pas` no Delphi.
-2. Vá para a seção `implementation`, onde diz `// << PONTO DE TESTE AQUI >>`.
-3. Digite o seguinte comentário ou apenas posicione o cursor e abra o chat/completion:
-
- ```delphi
- // Implemente o procedure CalculateFinalPrice
- ```
-
-4. Acione o atalho do **Code Completion** (Padrão: `Alt + Enter` ou conforme sua config).
-
-## Comparativo de Resultados
-
-### ❌ Antes (Sem Contexto)
-
-A IA recebia apenas a linha onde estava o cursor ou o texto selecionado.
-
-* **Provável Resposta**: A IA criaria um código genérico ou inventaria variáveis, pois não sabia que `FPrice` ou `FQuantity` existiam.
-
- ```delphi
- procedure TShoppingCartItem.CalculateFinalPrice;
- begin
- // A IA não sabe quais variáveis usar
- // Pode inventar algo como: Result := A * B;
- end;
- ```
-
-### ✅ Agora (Com Feature Ativa)
-
-A IA recebe todo o código entre `unit` e `implementation`.
-
-* **Resultado Esperado**: A IA deve reconhecer os campos da classe e montar a lógica correta.
-
- ```delphi
- procedure TShoppingCartItem.CalculateFinalPrice;
- begin
- // A IA sabe que FTotal, FQuantity, FPrice e FDiscount existem!
- FTotal := (FQuantity * FPrice) - FDiscount;
- end;
- ```
-
-## Dica Extra
-
-Experimente adicionar um `uses System.Math;` na interface e pedir para usar uma função matemática. A IA deverá saber que a unit já foi declarada e não sugerir adicioná-la novamente de forma redundante.
From fb83f2813b7b8fc505c27b06b68ec73e8c3d48fd Mon Sep 17 00:00:00 2001
From: Gaitolini
Date: Wed, 28 Jan 2026 00:45:28 -0300
Subject: [PATCH 11/11] feat: add `DelphiAIDev.Test.ContextDemo` for testing AI
global context and code completion.
---
Src/Test/DelphiAIDev.Test.ContextDemo.pas | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Src/Test/DelphiAIDev.Test.ContextDemo.pas b/Src/Test/DelphiAIDev.Test.ContextDemo.pas
index 1af4ecf..a4931a1 100644
--- a/Src/Test/DelphiAIDev.Test.ContextDemo.pas
+++ b/Src/Test/DelphiAIDev.Test.ContextDemo.pas
@@ -1,4 +1,4 @@
-unit DelphiAIDev.Test.ContextDemo;
+unit DelphiAIDev.Test.ContextDemo;
interface
@@ -24,7 +24,8 @@ TShoppingCartItem = class
property Discount: Currency read FDiscount write FDiscount;
property Total: Currency read FTotal write SetTotal;
- procedure CalculateFinalPrice;
+// Descomente a linha abaixo antes do teste, parao Delphi não reclamar..
+// procedure CalculateFinalPrice;
end;
implementation