Skip to content

Commit

Permalink
ref - Refactored the base prompt preset
Browse files Browse the repository at this point in the history
---

Type: ref
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 10, 2024
1 parent 81866a0 commit df73248
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
41 changes: 24 additions & 17 deletions public/Nitrocid/Shell/Prompts/PromptPresetBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
//

using Nitrocid.Kernel.Debugging;
using Nitrocid.Kernel.Exceptions;

namespace Nitrocid.Shell.Prompts
{
Expand All @@ -32,51 +31,59 @@ public class PromptPresetBase : IPromptPreset
public virtual string PresetName { get; } = "BasePreset";

/// <inheritdoc/>
public virtual string PresetPrompt { get; } = "> ";
public virtual string PresetPrompt =>
PresetPromptBuilder();

/// <inheritdoc/>
public virtual string PresetPromptCompletion { get; } = "[+] > ";
public virtual string PresetPromptCompletion =>
PresetPromptCompletionBuilder();

/// <inheritdoc/>
public virtual string PresetPromptShowcase { get; } = "> ";
public virtual string PresetPromptShowcase =>
PresetPromptBuilderShowcase();

/// <inheritdoc/>
public virtual string PresetPromptCompletionShowcase { get; } = "[+] > ";
public virtual string PresetPromptCompletionShowcase =>
PresetPromptCompletionBuilderShowcase();

/// <inheritdoc/>
public virtual string PresetShellType { get; } = "Shell";

internal virtual string PresetPromptBuilder()
{
DebugWriter.WriteDebug(DebugLevel.E, "Tried to call prompt builder on base.");
throw new KernelException(KernelExceptionType.NotImplementedYet);
DebugWriter.WriteDebug(DebugLevel.W, "Tried to call prompt builder on base.");
return "> ";
}

string IPromptPreset.PresetPromptBuilder() => PresetPromptBuilder();
string IPromptPreset.PresetPromptBuilder() =>
PresetPromptBuilder();

internal virtual string PresetPromptCompletionBuilder()
{
DebugWriter.WriteDebug(DebugLevel.E, "Tried to call prompt builder on base.");
throw new KernelException(KernelExceptionType.NotImplementedYet);
DebugWriter.WriteDebug(DebugLevel.W, "Tried to call prompt builder on base.");
return "[+] > ";
}

string IPromptPreset.PresetPromptCompletionBuilder() => PresetPromptCompletionBuilder();
string IPromptPreset.PresetPromptCompletionBuilder() =>
PresetPromptCompletionBuilder();

internal virtual string PresetPromptBuilderShowcase()
{
DebugWriter.WriteDebug(DebugLevel.E, "Tried to call prompt builder on base.");
throw new KernelException(KernelExceptionType.NotImplementedYet);
DebugWriter.WriteDebug(DebugLevel.W, "Tried to call prompt builder on base.");
return "> ";
}

string IPromptPreset.PresetPromptBuilderShowcase() => PresetPromptBuilderShowcase();
string IPromptPreset.PresetPromptBuilderShowcase() =>
PresetPromptBuilderShowcase();

internal virtual string PresetPromptCompletionBuilderShowcase()
{
DebugWriter.WriteDebug(DebugLevel.E, "Tried to call prompt builder on base.");
throw new KernelException(KernelExceptionType.NotImplementedYet);
DebugWriter.WriteDebug(DebugLevel.W, "Tried to call prompt builder on base.");
return "[+] > ";
}

string IPromptPreset.PresetPromptCompletionBuilderShowcase() => PresetPromptCompletionBuilderShowcase();
string IPromptPreset.PresetPromptCompletionBuilderShowcase() =>
PresetPromptCompletionBuilderShowcase();

}
}
8 changes: 0 additions & 8 deletions public/Nitrocid/Shell/Shells/UESH/Presets/Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ public class DefaultPreset : PromptPresetBase, IPromptPreset
/// <inheritdoc/>
public override string PresetName { get; } = "Default";

/// <inheritdoc/>
public override string PresetPrompt =>
PresetPromptBuilder();

/// <inheritdoc/>
public override string PresetPromptShowcase =>
PresetPromptBuilderShowcase();

internal override string PresetPromptBuilder()
{
var PresetStringBuilder = new StringBuilder();
Expand Down

0 comments on commit df73248

Please sign in to comment.