Просмотр исходного кода

deduplicate, we do not need both a name and a strategy

Mark IJbema 4 месяцев назад
Родитель
Сommit
bfc7bd31f2

+ 0 - 3
src/services/ghost/PromptStrategyManager.ts

@@ -50,9 +50,6 @@ export class PromptStrategyManager {
 		return strategy
 	}
 
-	/**
-	 * Get all available strategy names
-	 */
 	getAvailableStrategies(): string[] {
 		return [...this.strategies.map((s) => s.name), this.autoTriggerStrategy.name]
 	}

+ 1 - 2
src/services/ghost/strategies/AutoTriggerStrategy.ts

@@ -1,11 +1,10 @@
 import { GhostSuggestionContext } from "../types"
-import { PromptStrategy, UseCaseType } from "../types/PromptStrategy"
+import { PromptStrategy } from "../types/PromptStrategy"
 import { CURSOR_MARKER } from "../ghostConstants"
 import { formatDocumentWithCursor, getBaseSystemInstructions } from "./StrategyHelpers"
 
 export class AutoTriggerStrategy implements PromptStrategy {
 	name = "Auto Trigger"
-	type = UseCaseType.AUTO_TRIGGER
 
 	canHandle(context: GhostSuggestionContext): boolean {
 		// This is the fallback strategy, so it can handle anything

+ 1 - 2
src/services/ghost/strategies/CommentDrivenStrategy.ts

@@ -1,11 +1,10 @@
 import { GhostSuggestionContext } from "../types"
-import { PromptStrategy, UseCaseType } from "../types/PromptStrategy"
+import { PromptStrategy } from "../types/PromptStrategy"
 import { CURSOR_MARKER } from "../ghostConstants"
 import { formatDocumentWithCursor, getBaseSystemInstructions } from "./StrategyHelpers"
 
 export class CommentDrivenStrategy implements PromptStrategy {
 	name = "Comment Driven"
-	type = UseCaseType.COMMENT_DRIVEN
 
 	canHandle(context: GhostSuggestionContext): boolean {
 		if (!context.document || !context.range) return false

+ 1 - 2
src/services/ghost/strategies/UserRequestStrategy.ts

@@ -1,12 +1,11 @@
 import type { Range, TextDocument } from "vscode"
 import { GhostSuggestionContext } from "../types"
-import { PromptStrategy, UseCaseType } from "../types/PromptStrategy"
+import { PromptStrategy } from "../types/PromptStrategy"
 import { CURSOR_MARKER } from "../ghostConstants"
 import { formatDiagnostics, formatDocumentWithCursor, getBaseSystemInstructions } from "./StrategyHelpers"
 
 export class UserRequestStrategy implements PromptStrategy {
 	name = "User Request"
-	type = UseCaseType.USER_REQUEST
 
 	canHandle(context: GhostSuggestionContext): boolean {
 		return !!context.userInput && context.userInput.trim().length > 0

+ 0 - 22
src/services/ghost/types/PromptStrategy.ts

@@ -1,33 +1,11 @@
 import { GhostSuggestionContext } from "../types"
 
-/**
- * Enum representing different use case types for prompt strategies
- */
-export enum UseCaseType {
-	USER_REQUEST = "USER_REQUEST",
-	ERROR_FIX = "ERROR_FIX",
-	NEW_LINE = "NEW_LINE",
-	INLINE_COMPLETION = "INLINE_COMPLETION",
-	COMMENT_DRIVEN = "COMMENT_DRIVEN",
-	SELECTION_REFACTOR = "SELECTION_REFACTOR",
-	AUTO_TRIGGER = "AUTO_TRIGGER",
-	FIM_CODESTRAL = "FIM_CODESTRAL",
-}
-
 /**
  * Interface for prompt strategies that generate context-aware prompts
  */
 export interface PromptStrategy {
-	/**
-	 * Human-readable name of the strategy
-	 */
 	name: string
 
-	/**
-	 * The use case type this strategy handles
-	 */
-	type: UseCaseType
-
 	/**
 	 * Determines if this strategy can handle the given context
 	 * @param context The suggestion context to evaluate

+ 1 - 1
src/test-llm-autocompletion/strategy-tester.ts

@@ -80,7 +80,7 @@ export class StrategyTester {
 	}
 
 	/**
-	 * Get the name of the strategy that would be selected for the given code
+	 * Get the type of the strategy that would be selected for the given code
 	 */
 	getSelectedStrategyName(code: string): string {
 		const context = this.createContext(code)