Skip to content

Conversation

@joshspicer
Copy link
Member

@joshspicer joshspicer commented Oct 9, 2025

fix for #7954 being far too verbose.

@connor4312
Copy link
Member

connor4312 commented Oct 9, 2025

I suggest adding * (with surrounding spaces_ for JS/TS docblock comments too, and /// for Rust and C# docblock styles

@joshspicer
Copy link
Member Author

nice

image

@joshspicer joshspicer mentioned this pull request Oct 9, 2025
@joshspicer joshspicer marked this pull request as ready for review October 9, 2025 22:00
@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 9, 2025
@joshspicer joshspicer enabled auto-merge (squash) October 9, 2025 22:16
package.json Outdated
Comment on lines 625 to 630
"default": [
"//",
"#",
"--",
" * ",
"///"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems suspicious. It's something that would be language specific too.

<!-- TODO: ...... -->
/*
TODO: some multi-line
comment with context
*/
<#
TODO: PowerShell block comments are weird
I know
#>

https://github.com/microsoft/vscode/blob/55f06131905f07dde60f301aa56be6e2f52155a3/extensions/make/language-configuration.json#L2-L7

The comment syntax is declared by the language support, I feel like we should somehow leverage that if we can.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/microsoft/vscode/blob/55f06131905f07dde60f301aa56be6e2f52155a3/src/vs/editor/common/languages/languageConfigurationRegistry.ts#L35-L47

we have this in core... and we have a number of commands in core that are about retrieval of symbols:
https://code.visualstudio.com/api/references/commands#commands

I wonder if this warrants some way to get the LanguageConfiguration via a Command. Or at least just the comment stuff...

@hediet @alexdima I see your name around this code, maybe you have ideas

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointers, this looks a lot more correct.

I justified that this was ok since it's configurable via a setting and did not know we could possibly leverage core for this information.

Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should have two setting that both control whether the code action/codelens show.

Can we instead just remove "BUG" from the list of defaults?

@joshspicer joshspicer disabled auto-merge October 10, 2025 17:01
@joshspicer
Copy link
Member Author

@alexr00 I still think it's incorrect to match outside of a comment. Do you disagree?

@TylerLeonhardt thanks for the idea/pointers

@joshspicer joshspicer marked this pull request as draft October 10, 2025 18:24
* Initial plan

* Fix IssueTodoProvider test by enabling codeLens setting

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
@alexr00
Copy link
Member

alexr00 commented Oct 13, 2025

We can check if there's a comment at that position:

export async function isComment(document: vscode.TextDocument, position: vscode.Position): Promise<boolean> {
if (document.languageId !== 'markdown' && document.languageId !== 'plaintext') {

@joshspicer
Copy link
Member Author

isComment works great - thank you @alexr00!

image

const line = document.lineAt(lineNumber).text;
const textLine = document.lineAt(lineNumber);
const { text: line, firstNonWhitespaceCharacterIndex } = textLine;
if (!(await isComment(document, new vscode.Position(lineNumber, firstNonWhitespaceCharacterIndex)))) {
Copy link
Member Author

@joshspicer joshspicer Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't decide what is more efficient/correct to do first, the comment check or the findTodoInLine() check. @alexr00 preference?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, isComment ends up being a round trip to the renderer, so findTodoInLine is probably cheaper time-wise to do first.

@joshspicer joshspicer changed the base branch from main to joshspicer-patch-1 October 13, 2025 16:03
@joshspicer joshspicer marked this pull request as ready for review October 13, 2025 16:04
alexr00
alexr00 previously approved these changes Oct 13, 2025
joshspicer added a commit that referenced this pull request Oct 13, 2025
* Change default value for codingAgent.codeLens setting

While #7962 is under discussion

* [WIP] Fix test for codingAgent.codeLens setting (#7982)

* Initial plan

* Fix IssueTodoProvider test by enabling codeLens setting

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Base automatically changed from joshspicer-patch-1 to main October 13, 2025 16:34
@joshspicer joshspicer dismissed alexr00’s stale review October 13, 2025 16:34

The base branch was changed.

@joshspicer joshspicer marked this pull request as draft October 13, 2025 16:37
@joshspicer joshspicer marked this pull request as ready for review October 13, 2025 17:25
@joshspicer joshspicer closed this Oct 13, 2025
@joshspicer joshspicer reopened this Oct 13, 2025
@joshspicer joshspicer enabled auto-merge (squash) October 13, 2025 19:53
@joshspicer joshspicer merged commit d37dac6 into main Oct 13, 2025
6 checks passed
@joshspicer joshspicer deleted the joshspicer/todo-fix branch October 13, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants