Skip to content

Commit

Permalink
Only show inline code generation for the first 5 times.
Browse files Browse the repository at this point in the history
  • Loading branch information
samyakkkk committed Mar 5, 2024
1 parent 570e1cf commit 9591bae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vscode/src/tools/inline-hints/inlint-hints-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ export async function activateInlineHints(cacheManager: CacheManager) {
const isComment = activeEditor.document.lineAt(currentLine).text.trim().startsWith('//');

// If the user has not used inline completion for 5 times, show hint for the same
// if (inlineCount < 5) {
if (inlineCount < 5) {
if (lineText.length === 0) {
if (isComment || await isFirstLineOfSymbol(activeEditor)) {
// Set decoration on the current line
const range = new vscode.Range(currentLine + 1, activeEditor.document.lineAt(currentLine).range.end.character, currentLine + 1, activeEditor.document.lineAt(currentLine).range.end.character);
activeEditor.setDecorations(completionDecoration, [{ range }]);
}
// }
}
}
}
});
Expand Down

0 comments on commit 9591bae

Please sign in to comment.