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
Copy file name to clipboardExpand all lines: packages/amazonq/src/lsp/chat/commands.ts
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,11 @@ export function registerCommands(provider: AmazonQChatViewProvider) {
41
41
})
42
42
}
43
43
44
-
constvisibleMessageInChat=`_Explain **${issue.title}** issue in **${path.basename(filePath)}** at \`(${issue.startLine}, ${issue.endLine})\`_`
44
+
constlineRange=
45
+
issue.startLine===issue.endLine-1
46
+
? `[${issue.startLine+1}]`
47
+
: `[${issue.startLine+1}, ${issue.endLine}]`
48
+
constvisibleMessageInChat=`_Explain **${issue.title}** issue in **${path.basename(filePath)}** at \`${lineRange}\`_`
45
49
46
50
// The message that gets sent to the backend
47
51
constcontextMessage=`Provide a small description of the issue. Do not attempt to fix the issue, only explain it. Code issue - ${JSON.stringify(issue)}`
@@ -73,7 +77,11 @@ export function registerCommands(provider: AmazonQChatViewProvider) {
73
77
})
74
78
}
75
79
76
-
constvisibleMessageInChat=`_Fix **${issue.title}** issue in **${path.basename(filePath)}** at \`(${issue.startLine}, ${issue.endLine})\`_`
80
+
constlineRange=
81
+
issue.startLine===issue.endLine-1
82
+
? `[${issue.startLine+1}]`
83
+
: `[${issue.startLine+1}, ${issue.endLine}]`
84
+
constvisibleMessageInChat=`_Fix **${issue.title}** issue in **${path.basename(filePath)}** at \`${lineRange}\`_`
77
85
78
86
// The message that gets sent to the backend
79
87
constcontextMessage=`Generate a fix for the following code issue. Do not explain the issue, just generate and explain the fix. The user should have the option to accept or reject the fix before any code is changed. Code issue - ${JSON.stringify(issue)}`
0 commit comments