Skip to main content Sixth’s code commands bring AI assistance directly into your editor, letting you interact with your code without leaving your workflow. With a simple right-click, you can add code to Sixth, and through the lightbulb menu, you can fix errors, get explanations, or improve your code.
Available Code Commands
When you interact with code in your editor, you can access Sixth commands in two ways:
When you right-click on selected code, you’ll see:
Add to Sixth
The “Add to Sixth” command sends your selected code to the Sixth chat panel. This is perfect for:
Asking questions about specific code snippets
Requesting improvements or optimizations
Getting explanations of complex logic
When you use this command, Sixth automatically includes:
The file path (as a file mention)
The selected code with proper formatting
The programming language for accurate syntax highlighting
When you see a lightbulb icon in your editor, click it to access these Sixth commands:
Fix with Sixth
The “Fix with Sixth” command appears in the lightbulb menu when your code has errors or warnings. This command:
Captures the selected code
Identifies the errors or warnings from VSCode’s diagnostics
Sends both to Sixth with a request to fix the issues
Provides a solution that addresses the specific problems
This is incredibly useful for quickly resolving syntax errors, linter warnings, or type issues without having to manually describe the problem.
Explain with Sixth
The “Explain with Sixth” command helps you understand complex code. When you select code and use this command from the lightbulb menu, Sixth:
Analyzes the selected code
Provides a clear explanation of what the code does
Breaks down complex logic into understandable parts
Highlights important patterns or techniques used
Improve with Sixth
The “Improve with Sixth” command helps you enhance your code. When you select code and use this command from the lightbulb menu, Sixth:
Analyzes the selected code for potential improvements
Suggests optimizations, refactorings, or better practices
Explains the reasoning behind the suggested changes
Provides improved code that maintains the original functionality
How to Use Code Commands
Using Sixth’s code commands is simple:
For Right-Click Commands:
Select the code you want to work with
Right-click to open the context menu
Choose “Add to Sixth”
View the result in the Sixth chat panel
For Lightbulb Menu Commands:
Select the code you want to work with
Look for the lightbulb icon that appears in the editor gutter
Click the lightbulb to see available actions
Choose the appropriate Sixth command (Fix, Explain, or Improve)
View the result in the Sixth chat panel
After using any command, you can:
Ask follow-up questions
Request modifications to the solution
Apply the changes back to your code
How It Works Under the Hood
When you use a code command, here’s what happens behind the scenes:
Code Selection : The extension captures your selected code and its context
Metadata Collection : Sixth gathers important metadata:
File path and name
Programming language
Any associated diagnostics (errors/warnings)
Surrounding code context when relevant
Command Processing :
For “Add to Sixth,” the code is formatted and sent to the chat panel
For “Fix with Sixth,” the code and diagnostics are analyzed and a fix is generated
For “Explain with Sixth,” the code is analyzed to provide a clear explanation
For “Improve with Sixth,” the code is analyzed for potential optimizations and improvements
Integration with Chat : The results appear in the Sixth chat panel, where you can:
See the AI’s response
Ask follow-up questions
Apply suggested changes
This seamless integration between your editor and Sixth’s AI capabilities makes it easy to get assistance without disrupting your coding flow.
Tips for Effective Use
Select complete logical units : When possible, select entire functions, classes, or modules to give Sixth complete context
Include imports : For language-specific help, include relevant imports so Sixth understands dependencies
Combine with @ mentions : For complex issues, use code commands along with file or problem mentions for more context
Use keyboard shortcuts : Speed up your workflow by assigning keyboard shortcuts to common code commands
Next time you’re struggling with a piece of code, try using Sixth’s code commands instead of switching to a separate chat interface. You’ll be amazed at how much more efficient your workflow becomes when AI assistance is integrated directly into your editor.