34 references to CreateSection
aspire (3)
Agents\AgentInstructionsFile.cs (3)
234
var content = $"# Agent instructions{newLine}{newLine}{
CreateSection
(relativeAppHostPath, aspireSkillsPluginRegistered, newLine)}{newLine}";
245
var section =
CreateSection
(relativeAppHostPath, aspireSkillsPluginRegistered, lineBreak);
536
/// <see cref="
CreateSection
"/> writes each marker at the start of its own line. Users also mention the
Aspire.Cli.Tests (31)
Agents\AgentInstructionsFileTests.cs (21)
40
existing + "\r\n\r\n" + AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\r\n") + "\r\n",
49
var oldSection = AgentInstructionsFile.
CreateSection
("old.cs", false, "\n");
58
$"# Rules\n\n{AgentInstructionsFile.
CreateSection
("apphost.cs", aspireSkillsPluginRegistered: true, "\n")}\n\n## More rules\nKeep tests green.\n",
75
Assert.Equal($"# Team rules\n\n{AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\n")}\n", await File.ReadAllTextAsync(target));
96
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("App/apphost.cs", false, newLine)}{newLine}",
113
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("app/apphost.cs", false, newLine)}{newLine}",
131
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("apphost.cs", false, newLine)}{newLine}",
140
var existing = $"# Rules\n\n<!-- aspire:begin -->\nAn unterminated section.\n\nKeep this team rule.\n\n{AgentInstructionsFile.
CreateSection
("old.cs", false, "\n")}\n";
157
await File.WriteAllTextAsync(GetFilePath(workspace), $"# Rules\n\n{earlierText}\nKeep this team rule.\n\n{AgentInstructionsFile.
CreateSection
("old.cs", false, "\n")}\n");
163
$"# Rules\n\n{earlierText}\nKeep this team rule.\n\n{AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\n")}\n",
185
$"{existing}\n{AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\n")}\n",
210
var existing = $"# Rules\n\n```\nAn unclosed code block.\n\n{AgentInstructionsFile.
CreateSection
("old.cs", false, "\n")}\n";
226
await File.WriteAllTextAsync(GetFilePath(workspace), $"# Rules\n\n{AgentInstructionsFile.
CreateSection
("old.cs", false, "\n")}\n{after}");
232
$"# Rules\n\n{AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\n")}\n{after}",
255
var oldSection = AgentInstructionsFile.
CreateSection
("old.cs", false, "\n");
262
$"# Rules\n\n{AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\n")} Keep this team rule.\nMore rules.\n",
320
existing + "\n" + AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\n") + "\n",
335
$"# Rules\n\n{AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\n")}\nMore rules.\n",
348
var section = AgentInstructionsFile.
CreateSection
(appHostPath, false, "\n");
402
byte[] expected = [.. encoding.Preamble, .. encoding.GetBytes($"# R\u00E8gles\n\n{AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\n")}\n")];
417
byte[] expected = [.. encoding.Preamble, .. encoding.GetBytes($"# R\u00E8gles\r\n\r\n{AgentInstructionsFile.
CreateSection
("apphost.cs", false, "\r\n")}\r\n")];
Commands\AgentInitCommandTests.cs (8)
179
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("src/AppHost/apphost.cs", aspireSkillsPluginRegistered: false, newLine)}{newLine}",
210
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("src/AppHost/apphost.cs", aspireSkillsPluginRegistered: false, newLine)}{newLine}",
240
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("src/AppHost/apphost.cs", aspireSkillsPluginRegistered: true, newLine)}{newLine}",
263
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("src/AppHost/apphost.cs", aspireSkillsPluginRegistered, newLine)}{newLine}",
286
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("App.AppHost/App.AppHost.csproj", aspireSkillsPluginRegistered: false, newLine)}{newLine}",
320
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("B.AppHost/B.AppHost.csproj", aspireSkillsPluginRegistered: false, newLine)}{newLine}",
355
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("src/AppHost/AppHost.csproj", aspireSkillsPluginRegistered: false, newLine)}{newLine}",
387
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("App.AppHost/App.AppHost.csproj", aspireSkillsPluginRegistered: false, newLine)}{newLine}",
Commands\NewCommandLocalTemplateTests.cs (1)
1425
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
(expectedAppHost, aspireSkillsPluginRegistered: false, newLine)}{newLine}",
Commands\NewCommandTests.cs (1)
1498
$"# Agent instructions{newLine}{newLine}{AgentInstructionsFile.
CreateSection
("apphost.cs", aspireSkillsPluginRegistered: false, newLine)}{newLine}",