Skip to content

Commit e51e939

Browse files
committed
do not exclude markdown when detecting comment for Delegate codelens
1 parent 2971ea4 commit e51e939

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/issues/issueTodoProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class IssueTodoProvider implements vscode.CodeActionProvider, vscode.Code
120120
if (!todoInfo) {
121121
continue;
122122
}
123-
if (!(await isComment(document, new vscode.Position(lineNumber, firstNonWhitespaceCharacterIndex)))) {
123+
if (!(await isComment(document, new vscode.Position(lineNumber, firstNonWhitespaceCharacterIndex), []))) {
124124
continue;
125125
}
126126
const { match, search, insertIndex } = todoInfo;

src/issues/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ export async function pushAndCreatePR(
516516
}
517517
}
518518

519-
export async function isComment(document: vscode.TextDocument, position: vscode.Position): Promise<boolean> {
520-
if (document.languageId !== 'markdown' && document.languageId !== 'plaintext') {
519+
export async function isComment(document: vscode.TextDocument, position: vscode.Position, excludedLanguageIds = ['markdown', 'plaintext']): Promise<boolean> {
520+
if (!excludedLanguageIds.includes(document.languageId)) {
521521
const tokenInfo = await vscode.languages.getTokenInformationAtPosition(document, position);
522522
if (tokenInfo.type !== vscode.StandardTokenType.Comment) {
523523
return false;

0 commit comments

Comments
 (0)