Context-Aware Code Completion Delays

Feature Request: Context-Aware Code Completion Delays

Current Behavior

When writing comments in code, Cursor provides immediate code completion suggestions that:

  1. Often mispredict my intentions while writing comments
  2. Are visually distracting while trying to write clear documentation
  3. Frequently need to be dismissed or ignored

Proposed Behavior

Implement context-aware completion delays that:

  1. Disable immediate code completions while writing comments (lines starting with //, /*, or *)
  2. Maintain delayed spelling/grammar suggestions for comments after a brief pause in typing
  3. Keep the current immediate completion behavior for actual code

Benefits

  • Improved comment writing experience with less visual noise
  • Better focus on writing clear documentation
  • Maintains helpful spelling/grammar suggestions for comments
  • Preserves the existing powerful code completion features for actual code

Technical Considerations

  • Could be implemented by detecting comment context through:
    • Line prefix detection (//, /*, *)
    • File type awareness
    • Cursor position relative to comment markers
  • Could use existing completion delay mechanisms, just with context-specific timing
  • Could be configurable through settings.json

User Experience

  • Users writing comments would see a cleaner interface without irrelevant code suggestions
  • After a brief pause in typing, they’d still get helpful spelling/grammar suggestions
  • The transition between code and comments would be seamless
  • No configuration needed by default, but options available for power users

Related Issues

  • None found in current issue tracker
  • Similar to general completion control requests but with specific focus on comment context