diff --git a/package.json b/package.json index edef184..092c10c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "weaudit", "displayName": "weAudit", "description": "Bookmark findings and quickly navigate to areas of interest in the codebase", - "version": "1.2.2", + "version": "1.2.3", "publisher": "trailofbits", "author": "Trail of Bits", "categories": [], diff --git a/src/codeMarker.ts b/src/codeMarker.ts index fc9a9f8..6bf6d99 100644 --- a/src/codeMarker.ts +++ b/src/codeMarker.ts @@ -3396,7 +3396,11 @@ export class CodeMarker implements vscode.TreeDataProvider { const otherNoteDecorations: vscode.Range[] = []; const labelDecorations: vscode.DecorationOptions[] = []; - for (const treeItem of this.treeEntries) { + const sortedTreeEntries = this.treeEntries.sort((a, b) => + a.entryType === b.entryType ? a.label.localeCompare(b.label) : a.entryType === EntryType.Finding ? -1 : 1, + ); + + for (const treeItem of sortedTreeEntries) { const isOwnEntry = this.username === treeItem.author; const findingDecoration = isOwnEntry ? ownDecorations : otherDecorations; const noteDecoration = isOwnEntry ? ownNoteDecorations : otherNoteDecorations;