Analyzing and Documenting Code with Codeium Chat Context | Alpha | PandaiTech

Analyzing and Documenting Code with Codeium Chat Context

Use Codeium's 'Chat Context' and 'Refactor' features to understand existing code and automatically generate comments.

Learning Timeline
Key Insights

The Advantage of 'Context' Over ChatGPT

Unlike standard ChatGPT, Codeium reads your entire project. You don't need to manually copy-paste code; simply 'Pin' files in the Context tab and the AI will understand the relationships between different files.

Tips for Beginners

Use the 'Verbously comment' feature if you're just starting to learn programming. The AI will explain technical terms (such as what a string or module import means) in detail directly within your code file.

AI Model Info

Codeium uses the Llama 3.1 70b model for free for individual users, which is comparable to other paid models for code comprehension tasks.
Prompts

Finding Information in Code

Target: Codeium Chat
where's the API key for the summarizer?

Adding Code Documentation

Target: Codeium Refactor
add comments to these lines
Step by Step

Using Chat Context for Project Analysis

  1. Open Visual Studio Code and access the Codeium panel in the sidebar.
  2. Click on the 'Context' tab to see the files currently being read by the AI.
  3. Ensure relevant project files are 'Pin'-ned to the context area so the AI understands the overall application structure without needing any copy-pasting.
  4. Click back on the 'Chat' tab to start your session.
  5. Enter a specific question about your code (e.g., finding the location of a variable or API key) into the chat box.
  6. Press 'Enter' and Codeium will use the Llama 3.1 70b model to analyze the entire project and provide an accurate answer.

Automatically Understanding and Documenting Code

  1. Highlight or select the code block you want to analyze in the editor.
  2. Right-click the selected code to open the context menu.
  3. Select 'Codeium: Explain' to get a deep explanation of each line's function in the Chat panel.
  4. To add documentation, right-click the selected code again and choose 'Codeium: Refactor'.
  5. Select 'Add comments' or 'Verbously comment' from the list of provided options.
  6. Wait for Codeium to generate code comments that explain the program logic in plain English.
  7. Review the AI-suggested changes and click 'Accept' or 'Apply' to update your code file.

More from AI-Powered Coding & App Development

View All