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

this is always true, otherwise we would have crashed way before here

Mark IJbema 4 месяцев назад
Родитель
Сommit
0f6e700b1f
1 измененных файлов с 3 добавлено и 6 удалено
  1. 3 6
      src/services/ghost/strategies/CommentDrivenStrategy.ts

+ 3 - 6
src/services/ghost/strategies/CommentDrivenStrategy.ts

@@ -76,12 +76,9 @@ export class CommentDrivenStrategy implements PromptStrategy {
 		prompt += `- Language: ${language}\n`
 		prompt += `- Language: ${language}\n`
 		prompt += `- Comment to Implement:\n\`\`\`\n${comment}\n\`\`\`\n\n`
 		prompt += `- Comment to Implement:\n\`\`\`\n${comment}\n\`\`\`\n\n`
 
 
-		// Add the full document with cursor marker
-		if (context.document) {
-			prompt += "## Full Code\n"
-			prompt += formatDocumentWithCursor(context.document, context.range)
-			prompt += "\n\n"
-		}
+		prompt += "## Full Code\n"
+		prompt += formatDocumentWithCursor(context.document, context.range)
+		prompt += "\n\n"
 
 
 		prompt += `## Instructions\n`
 		prompt += `## Instructions\n`
 		prompt += `Generate code that implements the functionality described in the comment.\n`
 		prompt += `Generate code that implements the functionality described in the comment.\n`