Skip to content

Commit 764f30b

Browse files
BlakeLazarineblakelaz-amazonlaileni-aws
authored
fix(amazonq): add back line numbers next to code issue (#7810)
## Problem There was previously a task "Remove `[Ln 34, Col 1]` from Code Issues panel from each issue`". Originally, this was meant to just mean remove `, Col 1`, but I interpreted it to mean remove the whole blob. ## Solution This change adds the line back, but without the `, Col 1` <img width="432" height="341" alt="image" src="https://github.com/user-attachments/assets/63ed938d-7f2d-4718-8ca4-ceb5b4e50a96" /> --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: Blake Lazarine <[email protected]> Co-authored-by: Laxman Reddy <[email protected]>
1 parent 986534e commit 764f30b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/amazonq/test/unit/codewhisperer/service/securityIssueTreeViewProvider.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ describe('SecurityIssueTreeViewProvider', function () {
150150
item.iconPath?.toString().includes(`${item.issue.severity.toLowerCase()}.svg`)
151151
)
152152
)
153-
assert.ok(issueItems.every((item) => !item.description?.toString().startsWith('[Ln ')))
153+
assert.ok(issueItems.every((item) => item.description?.toString().startsWith('[Ln ')))
154154
}
155155
})
156156
})

packages/core/src/codewhisperer/service/securityIssueTreeViewProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,11 @@ export class IssueItem extends vscode.TreeItem {
189189
}
190190

191191
private getDescription() {
192+
const positionStr = `[Ln ${this.issue.startLine + 1}]`
192193
const groupingStrategy = CodeIssueGroupingStrategyState.instance.getState()
193-
return groupingStrategy !== CodeIssueGroupingStrategy.FileLocation ? `${path.basename(this.filePath)}` : ''
194+
return groupingStrategy !== CodeIssueGroupingStrategy.FileLocation
195+
? `${path.basename(this.filePath)} ${positionStr}`
196+
: positionStr
194197
}
195198

196199
private getContextValue() {

0 commit comments

Comments
 (0)