File tree Expand file tree Collapse file tree 7 files changed +7
-32
lines changed
src/services/ghost/strategies Expand file tree Collapse file tree 7 files changed +7
-32
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ Provide non-intrusive completions after a typing pause. Be conservative and help
3434 /**
3535 * Build minimal prompt for auto-trigger
3636 */
37- protected buildUserPrompt ( context : Partial < GhostSuggestionContext > ) : string {
37+ getUserPrompt ( context : GhostSuggestionContext ) : string {
3838 let prompt = ""
3939
4040 // Start with recent typing context
Original file line number Diff line number Diff line change @@ -85,15 +85,7 @@ EXAMPLE:
8585 /**
8686 * Generates the user prompt with context
8787 */
88- getUserPrompt ( context : GhostSuggestionContext ) : string {
89- return this . buildUserPrompt ( context )
90- }
91-
92- /**
93- * Builds the user prompt from the relevant context
94- * Must be implemented by each strategy
95- */
96- protected abstract buildUserPrompt ( context : GhostSuggestionContext ) : string
88+ abstract getUserPrompt ( context : GhostSuggestionContext ) : string
9789
9890 /**
9991 * Adds the cursor marker to the document text at the specified position
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export class CommentDrivenStrategy extends BasePromptStrategy {
6565- When using search/replace format, include ALL existing code to preserve it`
6666 }
6767
68- protected buildUserPrompt ( context : Partial < GhostSuggestionContext > ) : string {
68+ getUserPrompt ( context : GhostSuggestionContext ) : string {
6969 if ( ! context . document || ! context . range ) {
7070 return "No context available for comment-driven generation."
7171 }
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export class InlineCompletionStrategy extends BasePromptStrategy {
6565- Match the existing code style`
6666 }
6767
68- protected buildUserPrompt ( context : Partial < GhostSuggestionContext > ) : string {
68+ getUserPrompt ( context : GhostSuggestionContext ) : string {
6969 if ( ! context . document || ! context . range ) {
7070 return "No context available for inline completion."
7171 }
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ Important:
6464 /**
6565 * Build prompt focused on surrounding context
6666 */
67- protected buildUserPrompt ( context : Partial < GhostSuggestionContext > ) : string {
67+ getUserPrompt ( context : GhostSuggestionContext ) : string {
6868 let prompt = ""
6969
7070 // Start with cursor context
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class SelectionRefactorStrategy extends BasePromptStrategy {
4646Remember: The goal is to improve the code quality while keeping the exact same behavior.`
4747 }
4848
49- protected buildUserPrompt ( context : Partial < GhostSuggestionContext > ) : string {
49+ getUserPrompt ( context : GhostSuggestionContext ) : string {
5050 if ( ! context . document || ! context . range ) {
5151 return "No selection available for refactoring."
5252 }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ Common Request Patterns:
5353 /**
5454 * Build the user prompt with all relevant context
5555 */
56- protected buildUserPrompt ( context : Partial < GhostSuggestionContext > ) : string {
56+ getUserPrompt ( context : GhostSuggestionContext ) : string {
5757 let prompt = ""
5858
5959 // User request is the most important part
@@ -123,23 +123,6 @@ Common Request Patterns:
123123 return prompt
124124 }
125125
126- /**
127- * Override to provide more context for certain types of requests
128- */
129- override getUserPrompt ( context : GhostSuggestionContext ) : string {
130- // For certain requests, we might want to include more context
131- const request = context . userInput ?. toLowerCase ( ) || ""
132-
133- // If the request mentions other files or imports, include more context
134- if ( request . includes ( "import" ) || request . includes ( "from" ) ) {
135- // Could potentially include information about available modules
136- // For now, we'll use the standard approach
137- }
138-
139- // Use the standard prompt building
140- return super . getUserPrompt ( context )
141- }
142-
143126 /**
144127 * Gets the file path from the document
145128 */
You can’t perform that action at this time.
0 commit comments