You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Data class representing a prompt configuration with a template string.
14
+
* Templates contain placeholders that will be replaced with actual values.
15
+
*/
16
+
data classCostrictCodeSupportPromptConfig(valtemplate:String)
17
+
18
+
/**
19
+
* Collection of predefined prompt configurations for different use cases.
20
+
* Each configuration contains a template with placeholders for dynamic content.
21
+
*
22
+
* now organized under the Costrict extension.
23
+
*/
24
+
object CostrictCodeSupportPromptConfigs {
25
+
/**
26
+
* Template for enhancing user prompts.
27
+
* Instructs the AI to generate an improved version of the user's input.
28
+
*/
29
+
valENHANCE=CostrictCodeSupportPromptConfig(
30
+
"""Generate an enhanced version of this prompt (reply with only the enhanced prompt - no conversation, explanations, lead-in, bullet points, placeholders, or surrounding quotes):
31
+
32
+
${'$'}{userInput}"""
33
+
)
34
+
35
+
/**
36
+
* Template for explaining code.
37
+
* Provides structure for code explanation requests with file path and line information.
38
+
*/
39
+
valEXPLAIN=CostrictCodeSupportPromptConfig(
40
+
"""Explain the following code from file path ${'$'}{filePath}:${'$'}{startLine}-${'$'}{endLine}
41
+
${'$'}{userInput}
42
+
43
+
```
44
+
${'$'}{selectedText}
45
+
```
46
+
47
+
Please provide a clear and concise explanation of what this code does, including:
48
+
1. The purpose and functionality
49
+
2. Key components and their interactions
50
+
3. Important patterns or techniques used"""
51
+
)
52
+
53
+
/**
54
+
* Template for fixing code issues.
55
+
* Includes diagnostic information and structured format for issue resolution.
56
+
*/
57
+
valFIX=CostrictCodeSupportPromptConfig(
58
+
"""Fix any issues in the following code from file path ${'$'}{filePath}:${'$'}{startLine}-${'$'}{endLine}
59
+
${'$'}{diagnosticText}
60
+
${'$'}{userInput}
61
+
62
+
```
63
+
${'$'}{selectedText}
64
+
```
65
+
66
+
Please:
67
+
1. Address all detected problems listed above (if any)
68
+
2. Identify any other potential bugs or issues
69
+
3. Provide corrected code
70
+
4. Explain what was fixed and why"""
71
+
)
72
+
73
+
/**
74
+
* Template for improving code quality.
75
+
* Focuses on readability, performance, best practices, and error handling.
76
+
*/
77
+
valIMPROVE=CostrictCodeSupportPromptConfig(
78
+
"""Improve the following code from file path ${'$'}{filePath}:${'$'}{startLine}-${'$'}{endLine}
79
+
${'$'}{userInput}
80
+
81
+
```
82
+
${'$'}{selectedText}
83
+
```
84
+
85
+
Please suggest improvements for:
86
+
1. Code readability and maintainability
87
+
2. Performance optimization
88
+
3. Best practices and patterns
89
+
4. Error handling and edge cases
90
+
91
+
Provide the improved code along with explanations for each enhancement."""
92
+
)
93
+
94
+
/**
95
+
* Template for adding code to context.
96
+
* Simple format that includes file path, line range, and selected code.
0 commit comments