Skip to content

Conversation

@solidprinciples
Copy link

@solidprinciples solidprinciples commented Jan 31, 2026

Summary

image

It looks like you're writing code without a judgmental paperclip watching your every keystroke! Bold choice. Let me fix that for you.

This PR teaches Clippy to do what Clippy was born to do: pop up with helpful (or sarcastic, or encouraging—your choice!) tips as you navigate your code. Finally, a feature nobody asked for but everyone secretly wanted since 1997.


This adds an opt-in feature where your pet gives contextual tips as you code - detecting patterns like
console.log statements, TODOs, class definitions, and more. Tips appear in a speech bubble with the
personality of your choice.

Why?

vscode-pets is about fun. This makes pets feel alive - they're not just sitting there, they're watching
you code and have opinions about it.

Features

4 Personalities

  • Helpful: Constructive suggestions ("Logging is great for debugging, but remember to clean up
    before committing!")
  • Sarcastic: Witty feedback ("Ah yes, the ancient art of print-debugging.")
  • Encouraging: Positive reinforcement ("Debugging is learning! Every bug teaches something.")
  • Roast: Harsh but humorous ("Print statement debugging? What year is it?")

Smart detection across vscode supported languages

  • Uses VS Code's semantic APIs to detect classes, functions, methods, etc. in any language
  • Language-specific patterns for TypeScript/JavaScript (console.log, debugger, TODO, FIXME)
  • Context-aware messages: "A UserRepository class with 12 members. Is it getting too big?"

Non-intrusive

  • Off by default
  • Frequency control: always / sometimes / rarely
  • Rate-limited to prevent spam

Settings

{                                                                                                       
  "vscode-pets.clippyHover.enabled": true,                                                              
  "vscode-pets.clippyHover.personality": "helpful",                                                     
  "vscode-pets.clippyHover.frequency": "sometimes"                                                      
}                                                                                                       

Architecture

src/extension/clippy/
├── provider.ts # Event subscriptions (selection, save, open) - core logic
├── semanticDetector.ts # VS Code symbol API integration
├── languages/ # Language registry + triggers for things like logging functions, etc
├── handlers/ # Document & file event handlers
├── messages.ts # i18n + template replacement
└── rateLimit.ts # Frequency control

Key decisions:

  • Symbol-first detection - Uses VS Code's DocumentSymbolProvider for reliable cross-language support
    rather than fragile regex-only approach
  • Message queue - Tips display sequentially (6s each) without interrupting each other
  • Debounced events - 150ms debounce on cursor movement to avoid excessive API calls

Test Plan

  • Tips appear when hovering over supported patterns
  • Frequency settings respected (cooldowns work)
  • All 4 personalities display correct message types
  • Works in TypeScript, JavaScript, Python, Go, Rust, Java, C#
  • Performance: no noticeable lag during typing
  • Manual testing in various themes/layouts

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.

1 participant