Skip to content

Commit adb2df5

Browse files
authored
Better messages depending on issue count (#6392)
1 parent 4b78634 commit adb2df5

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/lm/tools/displayIssuesTool.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,19 @@ export class DisplayIssuesTool extends ToolBase<DisplayIssuesParameters> {
124124
const maxDisplay = 10;
125125
const foundIssuesCount = this.foundIssuesCount(options.parameters);
126126
const actualDisplay = Math.min(maxDisplay, foundIssuesCount);
127-
return {
128-
invocationMessage: vscode.l10n.t('Found {0} issues. Generating a markdown table of the first {1}', foundIssuesCount, actualDisplay)
129-
};
127+
if (actualDisplay === 0) {
128+
return {
129+
invocationMessage: vscode.l10n.t('No issues found')
130+
};
131+
} else if (actualDisplay < foundIssuesCount) {
132+
return {
133+
invocationMessage: vscode.l10n.t('Found {0} issues. Generating a markdown table of the first {1}', foundIssuesCount, actualDisplay)
134+
};
135+
} else {
136+
return {
137+
invocationMessage: vscode.l10n.t('Found {0} issues. Generating a markdown table', foundIssuesCount)
138+
};
139+
}
130140
}
131141

132142
async invoke(options: vscode.LanguageModelToolInvocationOptions<DisplayIssuesParameters>, token: vscode.CancellationToken): Promise<vscode.LanguageModelToolResult | undefined> {

0 commit comments

Comments
 (0)