1. A developer highlights a JavaScript function in VS Code that is throwing an unexpected TypeError at runtime. They want GitHub Copilot to diagnose and rewrite the function to fix the error. Which inline chat command is most appropriate?
- A. /explain
- B. /tests
- C. /fix✓ Correct
- D. /doc
Explanation
/fix is specifically designed to analyze highlighted code with an error and propose a corrected version — it is the correct command for diagnosing and rewriting buggy code. /explain describes what code does but does not rewrite it. /tests generates unit tests for the selected code, which would not directly repair the TypeError. /doc generates documentation comments and does not address runtime errors.