Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 7, 2025

Summary: Implement CodeLens for TODO Comments ✅

This PR successfully implements a CodeLens provider to make TODO comment actions more visible to users by displaying them directly above the code lines.

Implementation Checklist:

  • Understand the current implementation (CodeActionProvider in IssueTodoProvider)
  • Extend IssueTodoProvider to also implement CodeLensProvider interface
  • Implement provideCodeLenses method to detect TODO comments and return CodeLens objects
  • Register the CodeLens provider in issueFeatureRegistrar.ts
  • Update tests to verify CodeLens functionality
  • Refactor to extract common logic and reduce code duplication
  • Update documentation to reflect the new feature
  • Add setting to disable CodeLens (on by default)
  • Remove d.ts file changes
  • Address code review feedback
  • Lint and validate all changes
  • Code review completed successfully
  • All checks pass

What Changed:

Before this PR:

  • TODO actions only available via lightbulb quick fix menu
  • Users had to hover or use keyboard shortcuts
  • Poor discoverability

After this PR:

  • Clickable actions appear directly above TODO comments
  • "Create GitHub Issue" and "Delegate to coding agent" links visible inline
  • One-click access to features
  • New setting to disable CodeLens if preferred (enabled by default)
  • Backward compatible - lightbulb still works

Recent Updates:

  • Removed unused lineNumber parameter from findTodoInLine method
  • Renamed cacheAndReturn to setCachedResult for better clarity

Files Changed:

  1. src/issues/issueTodoProvider.ts

    • Implemented both CodeActionProvider and CodeLensProvider interfaces
    • Added provideCodeLenses method with setting check
    • Removed unused parameter from helper method
  2. src/github/copilotRemoteAgent.ts

    • Improved function naming for caching logic
  3. src/issues/issueFeatureRegistrar.ts

    • Registered CodeLens provider alongside CodeAction provider
  4. src/common/settingKeys.ts

    • Added CREATE_ISSUE_TRIGGERS_SHOW_CODE_LENS constant
  5. package.json

    • Added githubIssues.createIssueTriggersShowCodeLens boolean setting
  6. package.nls.json

    • Added localized description for the new setting
  7. src/test/issues/issueTodoProvider.test.ts

    • Added comprehensive test case for CodeLens functionality
  8. documentation/IssueFeatures.md

    • Updated documentation to describe the new feature and setting

Quality Assurance:

✅ All existing tests pass
✅ ESLint: No warnings or errors
✅ Hygiene checks: Pass
✅ TypeScript compilation: Success
✅ Code review feedback addressed
✅ Setting properly integrated with VS Code configuration system
✅ Documentation updated


Status: ✅ Ready for review and merge
Breaking Changes: None
Migration Required: None


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits October 7, 2025 17:49
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add code lens above lines of code for better visibility Implement CodeLens for TODO comments to improve action visibility Oct 7, 2025
Copilot AI requested a review from joshspicer October 7, 2025 18:08
Copilot finished work on behalf of joshspicer October 7, 2025 18:08
@joshspicer
Copy link
Member

@copilot this works great. Add a setting (on by default) to disable these code lens

@joshspicer
Copy link
Member

@copilot remove the d.ts file changes!

Copy link
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot this works great. Add a setting (on by default) to disable these code lens

Added the setting githubIssues.createIssueTriggersShowCodeLens (enabled by default). Users can disable CodeLens by setting it to false, and the quick fix actions will still be available via the lightbulb menu. (commit: TBD)

@copilot this works great. Add a setting (on by default) to disable these code lens

Added the setting githubIssues.createIssueTriggersShowCodeLens (enabled by default). Users can disable CodeLens by setting it to false, and the quick fix actions will still be available via the lightbulb menu. (commit: 4a30078)

Copilot finished work on behalf of joshspicer October 7, 2025 21:13
Copy link
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot remove the d.ts file changes!

Removed the uncommitted d.ts file changes. The PR now only contains the intended changes for the CodeLens feature. The d.ts changes were already reverted in commit 761e28d, and I've cleaned up any additional uncommitted modifications.

Copilot finished work on behalf of joshspicer October 7, 2025 21:21
@joshspicer joshspicer force-pushed the copilot/add-code-lens-visibility branch from 4a30078 to 98b217c Compare October 7, 2025 22:38
@joshspicer joshspicer requested a review from alexr00 October 7, 2025 22:53
@joshspicer joshspicer marked this pull request as ready for review October 7, 2025 22:53
@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 7, 2025
alexr00
alexr00 previously approved these changes Oct 8, 2025
…tion

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Copilot finished work on behalf of joshspicer October 8, 2025 16:14
@joshspicer joshspicer enabled auto-merge (squash) October 8, 2025 17:07
@joshspicer joshspicer merged commit e74c935 into main Oct 8, 2025
6 checks passed
@joshspicer joshspicer deleted the copilot/add-code-lens-visibility branch October 8, 2025 17:14
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