Add comprehensive agentic coding documentation
- Add 6 MCP server documentation pages (bc-code-intelligence, al-dependency, azure-devops, serena, al-objid, clockify) - Add AI Coding Agents documentation (GitHub Copilot, Claude, Cursor) - Add Getting Started section (what is agentic coding, setup, prompting, best practices, limitations, glossary) - Add Getting More section (code review, documentation, telemetry examples) - Add Community Resources placeholders (articles, videos, tools) - Update Tools section to focus on MCP servers instead of VSCode extensions
This commit is contained in:
parent
3254d9b7e8
commit
4db38ba4d3
28 changed files with 8152 additions and 0 deletions
217
content/docs/agentic-coding/CommunityResources/Agents/_index.md
Normal file
217
content/docs/agentic-coding/CommunityResources/Agents/_index.md
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
---
|
||||
title: "AI Coding Agents"
|
||||
linkTitle: "Agents"
|
||||
weight: 5
|
||||
description: >
|
||||
Learn about different AI coding agents and how to use them for AL development
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
AI coding agents are intelligent assistants that help you write, review, and improve AL code for Business Central. This section explains the different types of agents available and how to choose the right one for your needs.
|
||||
|
||||
## What are AI Coding Agents?
|
||||
|
||||
AI coding agents are more than simple autocomplete tools. They can:
|
||||
- Understand natural language instructions
|
||||
- Generate complete code implementations
|
||||
- Explain existing code
|
||||
- Refactor and improve code quality
|
||||
- Help debug issues
|
||||
- Provide learning and guidance
|
||||
|
||||
## Available Agents
|
||||
|
||||
Explore detailed information about each AI coding agent:
|
||||
|
||||
### [GitHub Copilot](github-copilot-agent)
|
||||
Microsoft's AI pair programmer integrated into VS Code.
|
||||
|
||||
**Best For**:
|
||||
- Inline code completion as you type
|
||||
- Quick code generation
|
||||
- Learning AL patterns
|
||||
- Teams already using GitHub
|
||||
|
||||
**Key Features**: Real-time suggestions, multi-file context, AL-aware completions
|
||||
|
||||
---
|
||||
|
||||
### [GitHub Copilot Chat](github-copilot-chat-agent)
|
||||
Conversational AI assistant from GitHub with deep VS Code integration.
|
||||
|
||||
**Best For**:
|
||||
- Interactive code discussions
|
||||
- Code explanations and learning
|
||||
- Debugging assistance
|
||||
- Complex refactoring tasks
|
||||
|
||||
**Key Features**: Natural language chat, context-aware responses, inline chat
|
||||
|
||||
---
|
||||
|
||||
### [Claude (via API or Claude.ai)](claude-agent)
|
||||
Anthropic's AI assistant with strong reasoning capabilities.
|
||||
|
||||
**Best For**:
|
||||
- Complex problem solving
|
||||
- Detailed code analysis
|
||||
- Architecture discussions
|
||||
- Large codebase understanding
|
||||
|
||||
**Key Features**: Long context window, strong analytical abilities, helpful explanations
|
||||
|
||||
---
|
||||
|
||||
### [Cursor](cursor-agent)
|
||||
AI-first code editor built on VS Code with integrated AI assistance.
|
||||
|
||||
**Best For**:
|
||||
- All-in-one AI coding environment
|
||||
- Teams wanting deep AI integration
|
||||
- Multi-model AI access
|
||||
- Codebase-wide AI context
|
||||
|
||||
**Key Features**: Multiple AI models, composer mode, codebase indexing, chat + autocomplete
|
||||
|
||||
---
|
||||
|
||||
## Comparison Matrix
|
||||
|
||||
| Feature | GitHub Copilot | Copilot Chat | Claude | Cursor |
|
||||
|---------|---------------|--------------|---------|---------|
|
||||
| **Inline Completion** | ✓✓✓ Excellent | Limited | N/A | ✓✓✓ Excellent |
|
||||
| **Chat Interface** | N/A | ✓✓✓ Excellent | ✓✓✓ Excellent | ✓✓✓ Excellent |
|
||||
| **AL Awareness** | ✓✓ Good | ✓✓ Good | ✓ Basic | ✓✓ Good |
|
||||
| **Code Explanation** | Limited | ✓✓✓ Excellent | ✓✓✓ Excellent | ✓✓✓ Excellent |
|
||||
| **VS Code Integration** | ✓✓✓ Native | ✓✓✓ Native | ✗ Web/API | ✓✓✓ Fork |
|
||||
| **Context Window** | Medium | Medium | ✓✓✓ Very Large | Large |
|
||||
| **Multi-file Editing** | Limited | Limited | Manual | ✓✓✓ Excellent |
|
||||
| **Pricing** | $10-19/mo | Included | Free/Pro | $20/mo |
|
||||
| **Team Features** | ✓✓ Good | ✓✓ Good | Limited | ✓ Basic |
|
||||
|
||||
**Legend**: ✓✓✓ Excellent | ✓✓ Good | ✓ Basic | Limited | ✗ Not Available | N/A Not Applicable
|
||||
|
||||
## Choosing the Right Agent
|
||||
|
||||
### For Individual Developers
|
||||
|
||||
**Just Starting with AI?**
|
||||
→ Start with [GitHub Copilot](github-copilot-agent) + [Copilot Chat](github-copilot-chat-agent)
|
||||
- Easy setup
|
||||
- Great VS Code integration
|
||||
- Good AL support
|
||||
- One subscription for both
|
||||
|
||||
**Want Maximum AI Power?**
|
||||
→ Try [Cursor](cursor-agent)
|
||||
- Multiple AI models
|
||||
- Strong codebase understanding
|
||||
- All-in-one solution
|
||||
- Advanced features
|
||||
|
||||
**Need Deep Analysis?**
|
||||
→ Use [Claude](claude-agent) for complex tasks
|
||||
- Long context for large codebases
|
||||
- Excellent reasoning
|
||||
- Detailed explanations
|
||||
- Free tier available
|
||||
|
||||
### For Teams
|
||||
|
||||
**Microsoft/GitHub Ecosystem?**
|
||||
→ GitHub Copilot for Business
|
||||
- Centralized management
|
||||
- License management
|
||||
- Organization policies
|
||||
- Familiar tools
|
||||
|
||||
**Maximum Flexibility?**
|
||||
→ Cursor for Teams
|
||||
- Multiple AI models
|
||||
- Strong collaboration
|
||||
- Advanced features
|
||||
- Modern interface
|
||||
|
||||
**Hybrid Approach?**
|
||||
→ Combine tools:
|
||||
- GitHub Copilot for daily coding
|
||||
- Claude for complex analysis
|
||||
- Cursor for specific projects
|
||||
|
||||
## Using Multiple Agents
|
||||
|
||||
Many developers use multiple agents for different tasks:
|
||||
|
||||
**Daily Coding**: GitHub Copilot (inline suggestions)
|
||||
**Learning & Debugging**: Copilot Chat or Cursor Chat
|
||||
**Complex Problems**: Claude (detailed analysis)
|
||||
**Refactoring**: Cursor (multi-file editing)
|
||||
|
||||
**Example Workflow**:
|
||||
1. Write code with GitHub Copilot inline suggestions
|
||||
2. Ask Copilot Chat to explain complex BC patterns
|
||||
3. Use Claude for architecture review of large features
|
||||
4. Use Cursor for complex multi-file refactoring
|
||||
|
||||
## Getting Started
|
||||
|
||||
### New to AI Coding?
|
||||
|
||||
1. **Start Simple**: [GitHub Copilot](github-copilot-agent)
|
||||
2. **Learn the Basics**: [Effective Prompting](../../getting-started/effective-prompting)
|
||||
3. **Try Examples**: [Getting More](../../getting-more)
|
||||
4. **Explore Others**: Try Claude or Cursor for comparison
|
||||
|
||||
### Already Using AI?
|
||||
|
||||
**Expand Your Toolkit**:
|
||||
- If using Copilot → Try Cursor for advanced features
|
||||
- If using Claude → Add Copilot for inline completion
|
||||
- If using Cursor → Use Claude for deep analysis
|
||||
|
||||
## Common Questions
|
||||
|
||||
### Can I use multiple agents?
|
||||
Yes! Many developers use different agents for different tasks. They complement each other well.
|
||||
|
||||
### Which is best for AL development?
|
||||
GitHub Copilot has the most AL-specific training, but all agents can be effective with good prompting.
|
||||
|
||||
### Are these expensive?
|
||||
Most are $10-20/month for individual use. GitHub Copilot offers free access for students and open source maintainers.
|
||||
|
||||
### Do I need internet?
|
||||
Yes, all current AI agents require internet connectivity to function.
|
||||
|
||||
### Will AI replace AL developers?
|
||||
No. AI agents are tools to augment your capabilities, not replace your expertise and decision-making.
|
||||
|
||||
## Privacy & Security
|
||||
|
||||
All agents send code to external services. Consider:
|
||||
- Review your organization's AI usage policy
|
||||
- Don't include sensitive data in code
|
||||
- Use business/enterprise plans for better controls
|
||||
- Understand each tool's data handling policies
|
||||
|
||||
See individual agent pages for specific privacy information.
|
||||
|
||||
## Learning Path
|
||||
|
||||
1. **Read agent pages** to understand capabilities
|
||||
2. **Choose one** to start with
|
||||
3. **Follow setup** instructions
|
||||
4. **Practice** with examples from [Getting More](../../getting-more)
|
||||
5. **Experiment** with others as needed
|
||||
|
||||
## Resources
|
||||
|
||||
- [Setup Guide](../../getting-started/setup) - Environment configuration
|
||||
- [Effective Prompting](../../getting-started/effective-prompting) - Get better results
|
||||
- [Best Practices](../../getting-started/best-practices) - Use AI effectively
|
||||
- [Limitations](../../getting-started/limitations) - Understand constraints
|
||||
|
||||
---
|
||||
|
||||
**Questions?** Join the discussion at [GitHub Discussions](https://github.com/microsoft/alguidelines/discussions)
|
||||
|
|
@ -0,0 +1,757 @@
|
|||
---
|
||||
title: "Claude Agent"
|
||||
linkTitle: "Claude"
|
||||
weight: 3
|
||||
description: >
|
||||
Anthropic's AI assistant with strong reasoning and large context window for AL development
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Claude is Anthropic's AI assistant known for its strong reasoning capabilities, long context window, and helpful, detailed responses. While not specifically designed for coding, it excels at code analysis, architecture discussions, and complex problem-solving for AL development.
|
||||
|
||||
**Developer**: Anthropic
|
||||
**Type**: Conversational AI Assistant
|
||||
**Primary Use**: Code analysis, learning, complex problem-solving
|
||||
**Integration**: Web interface (Claude.ai) or API
|
||||
|
||||
## What is Claude?
|
||||
|
||||
Claude is a general-purpose AI assistant that:
|
||||
- Provides detailed, thoughtful analysis
|
||||
- Handles very large amounts of code
|
||||
- Reasons through complex problems
|
||||
- Explains concepts clearly
|
||||
- Generates well-structured code
|
||||
- Maintains context across long conversations
|
||||
|
||||
### Access Methods
|
||||
|
||||
**Claude.ai (Web)**:
|
||||
- Free tier available
|
||||
- Pro tier ($20/month) for more usage
|
||||
- Upload files directly
|
||||
- Conversation interface
|
||||
- No IDE integration
|
||||
|
||||
**Claude API**:
|
||||
- Programmatic access
|
||||
- Can be integrated into tools
|
||||
- Pay-per-use pricing
|
||||
- Requires development
|
||||
|
||||
**Note**: Unlike Copilot/Cursor, Claude doesn't have native VS Code integration.
|
||||
|
||||
## Key Capabilities for AL Development
|
||||
|
||||
### Exceptional Context Window
|
||||
|
||||
**Claude 3.5 Sonnet**: ~200K tokens
|
||||
- Can analyze entire AL projects
|
||||
- Process multiple large files simultaneously
|
||||
- Maintain context across long conversations
|
||||
- Reference earlier parts of discussion
|
||||
|
||||
**Practical Use**:
|
||||
```
|
||||
You can paste:
|
||||
- Multiple complete AL files
|
||||
- Entire codeunit implementations
|
||||
- Full table structures
|
||||
- Large amounts of documentation
|
||||
|
||||
Claude maintains context and can reference any part.
|
||||
```
|
||||
|
||||
### Strong Analytical Abilities
|
||||
|
||||
**Code Analysis**:
|
||||
- Deep understanding of code structure
|
||||
- Identifies patterns and anti-patterns
|
||||
- Suggests architectural improvements
|
||||
- Explains complex logic clearly
|
||||
|
||||
**Problem Solving**:
|
||||
- Reasons through complex scenarios
|
||||
- Considers multiple approaches
|
||||
- Explains trade-offs
|
||||
- Provides detailed rationale
|
||||
|
||||
**Learning & Teaching**:
|
||||
- Patient, clear explanations
|
||||
- Step-by-step breakdowns
|
||||
- Answers follow-up questions
|
||||
- Adapts to your knowledge level
|
||||
|
||||
## Strengths for AL Development
|
||||
|
||||
### ✓ Exceptional At
|
||||
|
||||
**Large Codebase Analysis**:
|
||||
```
|
||||
Paste your entire project:
|
||||
- All codeunits
|
||||
- Table structures
|
||||
- Page definitions
|
||||
- Integration logic
|
||||
|
||||
Ask: "Review this AL project for architectural improvements"
|
||||
|
||||
Claude can analyze it all and provide comprehensive feedback.
|
||||
```
|
||||
|
||||
**Architecture & Design**:
|
||||
```
|
||||
Questions like:
|
||||
- "Should I use events or direct calls for this integration?"
|
||||
- "How should I structure this multi-tenant extension?"
|
||||
- "What's the best way to handle this complex business logic?"
|
||||
|
||||
Claude provides thoughtful, reasoned analysis.
|
||||
```
|
||||
|
||||
**Complex Problem Solving**:
|
||||
```
|
||||
Describe complex scenarios:
|
||||
- Multi-step business processes
|
||||
- Integration challenges
|
||||
- Performance optimization
|
||||
- Refactoring strategies
|
||||
|
||||
Claude reasons through options and trade-offs.
|
||||
```
|
||||
|
||||
**Learning & Understanding**:
|
||||
```
|
||||
Questions like:
|
||||
- "Explain Business Central's posting architecture"
|
||||
- "How does AL's event system work?"
|
||||
- "What are the differences between these BC patterns?"
|
||||
|
||||
Claude provides detailed, educational responses.
|
||||
```
|
||||
|
||||
### ⚠ Limitations
|
||||
|
||||
**No IDE Integration**:
|
||||
- Manual copy-paste workflow
|
||||
- No inline suggestions
|
||||
- No automatic context
|
||||
- More context switching
|
||||
|
||||
**AL-Specific Training**:
|
||||
- Not specifically trained on AL
|
||||
- May not know latest BC features
|
||||
- Might suggest non-AL patterns
|
||||
- Requires clear AL context
|
||||
|
||||
**Real-Time Coding**:
|
||||
- Not designed for quick completions
|
||||
- Better for analysis than generation
|
||||
- Slower workflow than Copilot
|
||||
- Best for thoughtful tasks
|
||||
|
||||
## Practical AL Examples
|
||||
|
||||
### Architecture Review
|
||||
|
||||
**You** (paste entire project):
|
||||
```
|
||||
I'm building a customer loyalty system for Business Central.
|
||||
Here are my main files:
|
||||
|
||||
[Paste 5-10 AL files totaling thousands of lines]
|
||||
|
||||
Review the architecture and suggest improvements.
|
||||
```
|
||||
|
||||
**Claude Responds**:
|
||||
```
|
||||
I've analyzed your loyalty system implementation. Here's my review:
|
||||
|
||||
Overall Architecture:
|
||||
Your implementation follows a good separation of concerns with:
|
||||
- Setup tables (Loyalty Tier, Loyalty Rules)
|
||||
- Transaction table (Loyalty Points Entry)
|
||||
- Processing codeunits (Points Calculator, Tier Evaluator)
|
||||
- Integration through event subscribers
|
||||
|
||||
Strengths:
|
||||
1. Good use of events for extensibility
|
||||
2. Clear separation between setup and transactions
|
||||
3. Proper use of temporary tables for calculations
|
||||
|
||||
Areas for Improvement:
|
||||
|
||||
1. Performance Optimization (Table 50101 "Loyalty Points Entry"):
|
||||
- Current implementation recalculates totals on every query
|
||||
- Recommendation: Add a "Total Points" field on Customer table
|
||||
- Use events to update when points are added/removed
|
||||
- Reduces database load significantly
|
||||
|
||||
2. Transaction Handling (Codeunit 50100):
|
||||
Lines 45-67 process points without transaction wrapping.
|
||||
This could lead to partial updates if an error occurs.
|
||||
|
||||
Suggested pattern:
|
||||
procedure AwardPoints(...)
|
||||
begin
|
||||
// Wrap in Codeunit.Run for transaction
|
||||
if not AwardPointsInternal(...) then
|
||||
Error(GetLastErrorText());
|
||||
end;
|
||||
|
||||
procedure AwardPointsInternal(...): Boolean
|
||||
begin
|
||||
// Processing logic here
|
||||
end;
|
||||
|
||||
3. Testing Considerations:
|
||||
- No test codeunits provided
|
||||
- Critical calculation logic in Points Calculator should have unit tests
|
||||
- Recommendation: Create test codeunit with scenarios for:
|
||||
* Points calculation accuracy
|
||||
* Tier upgrades/downgrades
|
||||
* Edge cases (negative points, expired points)
|
||||
|
||||
4. Telemetry (Missing):
|
||||
Consider adding Application Insights telemetry for:
|
||||
- Points awarded/redeemed
|
||||
- Tier changes
|
||||
- Calculation performance
|
||||
- Error conditions
|
||||
|
||||
5. API Exposure:
|
||||
For mobile/web integration, consider:
|
||||
- API page for customer's current points balance
|
||||
- API page for points history
|
||||
- OData for reporting
|
||||
|
||||
Would you like me to elaborate on any of these points or show
|
||||
specific code examples for the improvements?
|
||||
```
|
||||
|
||||
### Complex AL Pattern Explanation
|
||||
|
||||
**You**:
|
||||
```
|
||||
I found this code in standard BC. Can you explain in detail how
|
||||
this posting pattern works and why it's structured this way?
|
||||
|
||||
[Paste complex BC posting code]
|
||||
```
|
||||
|
||||
**Claude Explains**:
|
||||
```
|
||||
This is Business Central's standard document posting pattern.
|
||||
Let me break it down step by step:
|
||||
|
||||
Structure Overview:
|
||||
1. OnRun trigger (lines 10-15): Entry point
|
||||
2. Main posting procedure (lines 20-150): Orchestration
|
||||
3. Helper procedures (lines 155+): Specific tasks
|
||||
4. Integration events: Extensibility points
|
||||
|
||||
Detailed Explanation:
|
||||
|
||||
Phase 1: Pre-Posting Validation (lines 22-35)
|
||||
--------------------------------------------
|
||||
The code first validates the document is ready to post:
|
||||
|
||||
OnRun()
|
||||
begin
|
||||
CheckDocumentIsReadyToPost(SalesHeader);
|
||||
end;
|
||||
|
||||
This separation ensures:
|
||||
- Validation logic is reusable
|
||||
- Errors caught before any changes
|
||||
- Can be tested independently
|
||||
|
||||
Key validations:
|
||||
- Document not already posted
|
||||
- Required fields populated
|
||||
- Valid line items exist
|
||||
- Customer not blocked
|
||||
|
||||
Phase 2: Table Locking (lines 40-45)
|
||||
------------------------------------
|
||||
SalesHeader.LockTable();
|
||||
SalesLine.LockTable();
|
||||
|
||||
Critical for multi-user scenarios:
|
||||
- Prevents concurrent modifications
|
||||
- Ensures data consistency
|
||||
- Follows database transaction best practices
|
||||
|
||||
This must happen INSIDE the implicit transaction
|
||||
(started by OnRun trigger).
|
||||
|
||||
Phase 3: Integration Events "Before" (lines 50-55)
|
||||
-------------------------------------------------
|
||||
OnBeforePostSalesDocument(SalesHeader, PostingResult);
|
||||
|
||||
Allows extensions to:
|
||||
- Add additional validation
|
||||
- Modify posting parameters
|
||||
- Log custom data
|
||||
- Integrate with external systems
|
||||
|
||||
Extensions subscribe to these events to add functionality
|
||||
without modifying base code.
|
||||
|
||||
Phase 4: Core Posting Logic (lines 60-120)
|
||||
------------------------------------------
|
||||
The actual posting work:
|
||||
|
||||
PostSalesLines(SalesHeader); // Create ledger entries
|
||||
PostCustomerLedger(SalesHeader); // Update customer balance
|
||||
UpdateInventory(SalesHeader); // Adjust inventory
|
||||
CreatePostedDocument(SalesHeader);// Archive posted doc
|
||||
|
||||
Each step is a separate procedure because:
|
||||
- Clarity and maintainability
|
||||
- Reusability
|
||||
- Easier testing
|
||||
- Clear transaction boundaries
|
||||
|
||||
Phase 5: Integration Events "After" (lines 125-130)
|
||||
--------------------------------------------------
|
||||
OnAfterPostSalesDocument(SalesHeader, PostingResult);
|
||||
|
||||
Allows extensions to:
|
||||
- Trigger follow-up actions
|
||||
- Send notifications
|
||||
- Update related data
|
||||
- Log completion
|
||||
|
||||
Phase 6: Cleanup (lines 135-145)
|
||||
--------------------------------
|
||||
DeleteAfterPosting(SalesHeader);
|
||||
Commit;
|
||||
|
||||
- Removes unposted document
|
||||
- Commits transaction
|
||||
- Frees locks
|
||||
|
||||
Why This Pattern?
|
||||
|
||||
1. Reliability:
|
||||
- Explicit transaction boundaries
|
||||
- Proper locking prevents conflicts
|
||||
- Validation before any changes
|
||||
|
||||
2. Extensibility:
|
||||
- Events at every critical point
|
||||
- Extensions can hook in without modification
|
||||
- Standard pattern across all posting routines
|
||||
|
||||
3. Maintainability:
|
||||
- Clear, linear flow
|
||||
- Each procedure has single responsibility
|
||||
- Easy to understand and debug
|
||||
|
||||
4. Performance:
|
||||
- Table locks minimize deadlocks
|
||||
- Efficient batch processing
|
||||
- Single transaction reduces overhead
|
||||
|
||||
5. Error Handling:
|
||||
- OnRun trigger provides implicit error handling
|
||||
- Transaction rolled back on error
|
||||
- Clean state maintained
|
||||
|
||||
This is the gold standard for BC posting routines. When creating
|
||||
your own posting logic, follow this same pattern for:
|
||||
- Custom documents
|
||||
- Batch processing
|
||||
- Any transactional operations
|
||||
|
||||
Would you like me to explain any specific part in more detail,
|
||||
or show how to implement this pattern for a custom document?
|
||||
```
|
||||
|
||||
### Migration Strategy
|
||||
|
||||
**You**:
|
||||
```
|
||||
We have 50,000 lines of NAV 2018 C/AL code to migrate to BC AL.
|
||||
What's the best strategy?
|
||||
|
||||
[Include examples of your NAV code]
|
||||
```
|
||||
|
||||
**Claude Provides**:
|
||||
```
|
||||
Migrating 50K lines of C/AL to AL is substantial. Here's a strategic approach:
|
||||
|
||||
Phase 1: Assessment & Planning (Week 1-2)
|
||||
-----------------------------------------
|
||||
|
||||
1. Code Analysis:
|
||||
- Categorize by object type
|
||||
- Identify custom vs modified standard objects
|
||||
- Map dependencies
|
||||
- Find external integrations
|
||||
|
||||
2. Risk Assessment:
|
||||
HIGH RISK (manual migration priority):
|
||||
- Heavy .NET interop
|
||||
- Automation/OCX controls
|
||||
- Client-side code
|
||||
- File system access
|
||||
|
||||
MEDIUM RISK (tool + manual):
|
||||
- Standard modifications
|
||||
- Reports
|
||||
- Complex business logic
|
||||
|
||||
LOW RISK (mostly automated):
|
||||
- Simple tables
|
||||
- Basic pages
|
||||
- Straightforward codeunits
|
||||
|
||||
3. Tool Selection:
|
||||
- AL Object Designer for conversion
|
||||
- txt2al for initial conversion
|
||||
- Manual for complex cases
|
||||
|
||||
Phase 2: Automated Conversion (Week 3-4)
|
||||
----------------------------------------
|
||||
|
||||
1. Run automated tools on LOW/MEDIUM risk code
|
||||
2. Fix compilation errors
|
||||
3. Address obvious issues
|
||||
4. Don't spend time on perfect conversion yet
|
||||
|
||||
Phase 3: Manual Review & Refactoring (Week 5-12)
|
||||
-----------------------------------------------
|
||||
|
||||
Priority order:
|
||||
1. Core business logic (highest value)
|
||||
2. Integration points (highest risk)
|
||||
3. Reports (user-facing)
|
||||
4. Supporting code (lower priority)
|
||||
|
||||
For each module:
|
||||
a) Understand business purpose
|
||||
b) Review automated conversion
|
||||
c) Refactor to AL patterns
|
||||
d) Add error handling
|
||||
e) Add telemetry
|
||||
f) Create tests
|
||||
|
||||
Phase 4: Testing (Week 13-16)
|
||||
-----------------------------
|
||||
|
||||
Comprehensive testing:
|
||||
- Unit tests for calculations
|
||||
- Integration tests for workflows
|
||||
- User acceptance testing
|
||||
- Performance testing
|
||||
- Migration testing (data)
|
||||
|
||||
Phase 5: Incremental Deployment (Week 17+)
|
||||
------------------------------------------
|
||||
|
||||
Consider:
|
||||
- Parallel run period
|
||||
- Module-by-module rollout
|
||||
- Rollback procedures
|
||||
- User training
|
||||
|
||||
Specific Code Migration Tips:
|
||||
|
||||
1. C/AL Automation → AL:
|
||||
Your NAV code uses Word automation.
|
||||
Replace with:
|
||||
- BC Word Report Layouts (preferred)
|
||||
- External API calls if complex
|
||||
- Azure Functions for processing
|
||||
|
||||
2. Client-Side Code → AL:
|
||||
NAV Page code that ran on client.
|
||||
Move to:
|
||||
- Page triggers (server-side)
|
||||
- Page extensions
|
||||
- Control add-ins (if really needed)
|
||||
|
||||
3. Record.SETCURRENTKEY → AL:
|
||||
NAV: Rec.SETCURRENTKEY(Date, Amount);
|
||||
AL: Rec.SetCurrentKey(Date, Amount);
|
||||
|
||||
Note: Case-sensitive in AL!
|
||||
|
||||
4. Reports:
|
||||
NAV RDLC reports need:
|
||||
- AL report object
|
||||
- Updated dataset
|
||||
- Layout regeneration
|
||||
|
||||
Consider: RDL → Word layout migration
|
||||
|
||||
5. .NET Interop:
|
||||
NAV: DotNet variables
|
||||
AL: Check if:
|
||||
- Available in AL
|
||||
- Use BC API instead
|
||||
- Create Azure Function if needed
|
||||
|
||||
AI-Assisted Migration Strategy:
|
||||
|
||||
Use AI tools effectively:
|
||||
1. GitHub Copilot:
|
||||
- Quick syntax fixes
|
||||
- Pattern replacement
|
||||
- Boilerplate generation
|
||||
|
||||
2. Claude (me!):
|
||||
- Complex logic understanding
|
||||
- Architecture decisions
|
||||
- Refactoring strategies
|
||||
|
||||
3. Manual effort:
|
||||
- Business logic validation
|
||||
- Testing
|
||||
- Critical decisions
|
||||
|
||||
Realistic Timeline:
|
||||
- Simple migration: 4-6 months
|
||||
- Complex migration: 6-12 months
|
||||
- Very complex: 12-18 months
|
||||
|
||||
Budget for:
|
||||
- 30% automated conversion
|
||||
- 40% manual refactoring
|
||||
- 30% testing and validation
|
||||
|
||||
Would you like me to:
|
||||
1. Review specific NAV code samples?
|
||||
2. Elaborate on any phase?
|
||||
3. Discuss specific technical challenges?
|
||||
4. Create a detailed project plan template?
|
||||
```
|
||||
|
||||
## How to Use Claude Effectively
|
||||
|
||||
### Workflow
|
||||
|
||||
**1. Preparation**:
|
||||
- Gather all relevant AL code
|
||||
- Prepare specific questions
|
||||
- Include context and requirements
|
||||
|
||||
**2. Interaction**:
|
||||
- Paste code into Claude.ai
|
||||
- Ask clear, specific questions
|
||||
- Provide examples of what you want
|
||||
|
||||
**3. Iterate**:
|
||||
- Ask follow-up questions
|
||||
- Clarify unclear points
|
||||
- Request alternatives
|
||||
- Explore trade-offs
|
||||
|
||||
**4. Implementation**:
|
||||
- Copy suggested code
|
||||
- Adapt to your project
|
||||
- Test thoroughly
|
||||
- Refine as needed
|
||||
|
||||
### Best Practices
|
||||
|
||||
**Provide Full Context**:
|
||||
```
|
||||
Good:
|
||||
"I'm building an AL extension for BC v22 that integrates with Shopify.
|
||||
Here's my current implementation: [paste code]
|
||||
I need to handle rate limiting from the Shopify API.
|
||||
Show me the best AL pattern for this."
|
||||
|
||||
vs.
|
||||
|
||||
Poor:
|
||||
"How do I handle rate limiting?"
|
||||
```
|
||||
|
||||
**Ask Specific Questions**:
|
||||
```
|
||||
Good:
|
||||
"Review this AL posting codeunit for performance issues,
|
||||
specifically focusing on database operations."
|
||||
|
||||
vs.
|
||||
|
||||
Poor:
|
||||
"Is this good?"
|
||||
```
|
||||
|
||||
**Use for Complex Tasks**:
|
||||
- Architecture decisions
|
||||
- Code review of large modules
|
||||
- Learning complex concepts
|
||||
- Debugging intricate issues
|
||||
|
||||
## How It Differs from Other Agents
|
||||
|
||||
### vs. GitHub Copilot
|
||||
|
||||
**Claude**:
|
||||
- ✓ Much larger context window
|
||||
- ✓ Better at analysis and reasoning
|
||||
- ✓ More detailed explanations
|
||||
- ✗ No IDE integration
|
||||
- ✗ No inline suggestions
|
||||
- ✗ Manual workflow
|
||||
|
||||
**GitHub Copilot**:
|
||||
- ✓ IDE integration
|
||||
- ✓ Real-time suggestions
|
||||
- ✓ Fast workflow
|
||||
- ✗ Limited context
|
||||
- ✗ Less analytical
|
||||
|
||||
**Use Both**: Copilot for daily coding, Claude for deep analysis
|
||||
|
||||
### vs. Cursor
|
||||
|
||||
**Claude**:
|
||||
- ✓ Larger context window
|
||||
- ✓ Better analytical depth
|
||||
- ✓ More thoughtful responses
|
||||
- ✗ No IDE integration
|
||||
- ✗ Manual copy-paste
|
||||
|
||||
**Cursor**:
|
||||
- ✓ IDE integration
|
||||
- ✓ Multiple AI models (including Claude!)
|
||||
- ✓ Direct code editing
|
||||
- ✗ Smaller context per interaction
|
||||
- ✗ Different editor
|
||||
|
||||
**Note**: Cursor can use Claude as its AI model, giving you Claude's capabilities with IDE integration!
|
||||
|
||||
## Access & Pricing
|
||||
|
||||
### Claude.ai (Web)
|
||||
|
||||
**Free Tier**:
|
||||
- Limited messages per day
|
||||
- Claude 3.5 Sonnet access
|
||||
- Good for occasional use
|
||||
- No payment required
|
||||
|
||||
**Pro Tier** ($20/month):
|
||||
- 5x more usage
|
||||
- Priority access
|
||||
- Claude 3 Opus (most capable model)
|
||||
- Early feature access
|
||||
|
||||
### Claude API
|
||||
|
||||
**Pay-per-use**:
|
||||
- Billed by tokens
|
||||
- Integration into tools
|
||||
- Programmatic access
|
||||
- See Anthropic pricing page
|
||||
|
||||
**Link**: [Claude.ai](https://claude.ai) | [Anthropic Pricing](https://www.anthropic.com/pricing)
|
||||
|
||||
## Privacy & Security
|
||||
|
||||
### What Gets Sent
|
||||
- Your messages and questions
|
||||
- Code you paste
|
||||
- Files you upload
|
||||
- Conversation history
|
||||
|
||||
### Data Usage
|
||||
- Not used for training (as of current policy)
|
||||
- Processed for improving responses
|
||||
- Retained per Anthropic's policy
|
||||
- Review privacy policy for details
|
||||
|
||||
### Best Practices
|
||||
- Don't paste sensitive data
|
||||
- Avoid customer information
|
||||
- Review organization policies
|
||||
- Use sanitized code examples
|
||||
|
||||
## When to Use Claude
|
||||
|
||||
### ✓ Ideal For
|
||||
|
||||
- **Large code reviews**: Paste entire projects
|
||||
- **Architecture discussions**: Complex design decisions
|
||||
- **Learning**: Detailed explanations of AL/BC concepts
|
||||
- **Problem solving**: Complex scenarios with many variables
|
||||
- **Migration planning**: NAV to BC conversions
|
||||
- **Refactoring strategies**: Large-scale code improvements
|
||||
- **API design**: Thoughtful API architecture
|
||||
|
||||
### ⚠ Consider Alternatives
|
||||
|
||||
- **Quick completions** → GitHub Copilot
|
||||
- **IDE integration** → Copilot or Cursor
|
||||
- **Real-time coding** → Copilot or Cursor
|
||||
- **Multi-file editing** → Cursor
|
||||
|
||||
## Complementary Tools
|
||||
|
||||
**Use With**:
|
||||
- GitHub Copilot for daily coding
|
||||
- VS Code for development
|
||||
- AL analyzers for code quality
|
||||
- Version control for safety
|
||||
|
||||
**Workflow Example**:
|
||||
1. Code with Copilot in VS Code
|
||||
2. Review architecture with Claude
|
||||
3. Implement improvements in VS Code
|
||||
4. Test and validate
|
||||
|
||||
## Tips for AL Development
|
||||
|
||||
**Provide AL Context**:
|
||||
```
|
||||
"I'm working in AL for Business Central version 22.
|
||||
[Your question]"
|
||||
```
|
||||
|
||||
**Reference BC Concepts**:
|
||||
```
|
||||
"Using BC's standard posting pattern..."
|
||||
"Following BC event subscriber patterns..."
|
||||
```
|
||||
|
||||
**Ask for Alternatives**:
|
||||
```
|
||||
"Show me 3 different approaches to this problem,
|
||||
with pros and cons of each."
|
||||
```
|
||||
|
||||
**Request Explanations**:
|
||||
```
|
||||
"Explain this like I'm familiar with C# but new to AL"
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
### Official
|
||||
- [Claude.ai](https://claude.ai)
|
||||
- [Anthropic Documentation](https://docs.anthropic.com)
|
||||
- [API Documentation](https://docs.anthropic.com/claude/reference)
|
||||
|
||||
### AL Guidelines
|
||||
- [Effective Prompting](../../getting-started/effective-prompting)
|
||||
- [Best Practices](../../getting-started/best-practices)
|
||||
- [Code Review Examples](../../getting-more/code-review)
|
||||
|
||||
---
|
||||
|
||||
**Next Steps**:
|
||||
- Try [Claude.ai](https://claude.ai) for free
|
||||
- Compare with [other AI agents](./)
|
||||
- Use alongside [GitHub Copilot](github-copilot-agent)
|
||||
|
||||
**Questions?** Join [GitHub Discussions](https://github.com/microsoft/alguidelines/discussions)
|
||||
|
|
@ -0,0 +1,675 @@
|
|||
---
|
||||
title: "Cursor Agent"
|
||||
linkTitle: "Cursor"
|
||||
weight: 4
|
||||
description: >
|
||||
AI-first code editor with integrated AI assistance and multi-file editing for AL development
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Cursor is an AI-first code editor built on VS Code that integrates AI deeply into every aspect of development. It provides inline suggestions, chat assistance, and advanced features like Composer mode for multi-file editing, making it a powerful tool for AL development.
|
||||
|
||||
**Developer**: Anysphere Inc.
|
||||
**Type**: AI-Integrated Code Editor
|
||||
**Primary Use**: Complete AI-assisted development environment
|
||||
**Integration**: Native (is a code editor)
|
||||
|
||||
## What is Cursor?
|
||||
|
||||
Cursor is a fork of Visual Studio Code with integrated AI capabilities:
|
||||
- Native AI code completion (like Copilot)
|
||||
- Built-in AI chat (like Copilot Chat)
|
||||
- Composer mode for multi-file editing
|
||||
- Codebase indexing for better context
|
||||
- Multiple AI model support
|
||||
- All VS Code extensions work
|
||||
|
||||
### Key Differentiator
|
||||
|
||||
Unlike tools that add AI to VS Code, Cursor **is** an AI-first editor built from the ground up with AI integration.
|
||||
|
||||
**Think of it as**: VS Code + GitHub Copilot + Advanced AI Features + Better Context Understanding
|
||||
|
||||
## Key Features
|
||||
|
||||
### 1. Tab Completion (Like Copilot)
|
||||
|
||||
Real-time AI suggestions as you type:
|
||||
```al
|
||||
// Type a comment
|
||||
/// Validate customer credit limit
|
||||
|
||||
// Cursor suggests complete procedure
|
||||
procedure ValidateCreditLimit(CustomerNo: Code[20]): Boolean
|
||||
var
|
||||
Customer: Record Customer;
|
||||
begin
|
||||
// Full implementation suggested
|
||||
end;
|
||||
```
|
||||
|
||||
**Plus**:
|
||||
- Faster than Copilot
|
||||
- Better context awareness
|
||||
- Multiple AI models available
|
||||
|
||||
### 2. Chat Interface (Like Copilot Chat)
|
||||
|
||||
Built-in AI chat in the sidebar:
|
||||
- Ask questions about code
|
||||
- Get explanations
|
||||
- Request code generation
|
||||
- Debug issues
|
||||
|
||||
**Plus**:
|
||||
- Can use multiple AI models (GPT-4, Claude, etc.)
|
||||
- Better codebase understanding
|
||||
- More context awareness
|
||||
|
||||
### 3. Cmd+K (Inline Chat)
|
||||
|
||||
Quick inline AI assistance:
|
||||
- Press `Cmd+K` (Mac) or `Ctrl+K` (Windows)
|
||||
- Ask questions or request changes
|
||||
- AI suggests edits inline
|
||||
- Accept, reject, or modify
|
||||
|
||||
**Example**:
|
||||
```al
|
||||
// Select code, press Cmd+K, type:
|
||||
"Add error handling and telemetry"
|
||||
|
||||
// Cursor shows diff with changes
|
||||
// Accept to apply
|
||||
```
|
||||
|
||||
### 4. Composer Mode ⭐
|
||||
|
||||
**Most Powerful Feature**: Multi-file editing with AI
|
||||
|
||||
- Create/edit multiple files simultaneously
|
||||
- AI understands file relationships
|
||||
- Generates complete features
|
||||
- Handles complex refactoring
|
||||
|
||||
**Example**:
|
||||
```
|
||||
Press Cmd+I (Composer)
|
||||
Type: "Add a loyalty points system with table, page, and codeunit"
|
||||
|
||||
Cursor creates:
|
||||
- Table 50100 "Loyalty Points Entry"
|
||||
- Page 50100 "Loyalty Points List"
|
||||
- Page 50101 "Loyalty Points Card"
|
||||
- Codeunit 50100 "Loyalty Points Manager"
|
||||
|
||||
All properly connected and following AL patterns
|
||||
```
|
||||
|
||||
### 5. Codebase Indexing
|
||||
|
||||
Cursor indexes your entire workspace:
|
||||
- AI understands your project structure
|
||||
- References existing code
|
||||
- Follows your patterns
|
||||
- Suggests consistent code
|
||||
|
||||
**Benefit for AL**:
|
||||
- Knows your table structures
|
||||
- Understands your naming conventions
|
||||
- Follows your coding patterns
|
||||
- References your existing codeunits
|
||||
|
||||
### 6. Multiple AI Models
|
||||
|
||||
Choose your AI model:
|
||||
- GPT-4 (OpenAI)
|
||||
- GPT-4 Turbo
|
||||
- Claude 3.5 Sonnet (Anthropic)
|
||||
- Claude 3 Opus
|
||||
- (More being added)
|
||||
|
||||
**Why it matters**:
|
||||
- Different models have different strengths
|
||||
- Switch based on task
|
||||
- Try multiple for comparison
|
||||
- Use best for each scenario
|
||||
|
||||
## Strengths for AL Development
|
||||
|
||||
### ✓ Exceptional At
|
||||
|
||||
**Multi-File Projects**:
|
||||
```
|
||||
Composer: "Create a complete order processing module with:
|
||||
- Order Header and Line tables
|
||||
- Card and List pages
|
||||
- Processing codeunit
|
||||
- Validation codeunit
|
||||
- Test codeunit
|
||||
Follow AL best practices"
|
||||
|
||||
Cursor creates all files properly structured and connected.
|
||||
```
|
||||
|
||||
**Large Refactoring**:
|
||||
```
|
||||
"Refactor this project to:
|
||||
- Add telemetry to all procedures
|
||||
- Standardize error handling
|
||||
- Add XML documentation
|
||||
- Update to use new AL patterns"
|
||||
|
||||
Cursor makes changes across all relevant files.
|
||||
```
|
||||
|
||||
**Project Generation**:
|
||||
```
|
||||
"Create a BC extension for customer surveys with:
|
||||
- Setup tables
|
||||
- Survey and response tables
|
||||
- Pages for all tables
|
||||
- Email sending logic
|
||||
- API for mobile access"
|
||||
|
||||
Cursor scaffolds entire extension.
|
||||
```
|
||||
|
||||
**Codebase Understanding**:
|
||||
- Knows your entire project
|
||||
- References existing patterns
|
||||
- Follows your conventions
|
||||
- Suggests consistent code
|
||||
|
||||
### ⚠ Consider Limitations
|
||||
|
||||
**Learning Curve**:
|
||||
- Different from VS Code workflow
|
||||
- New shortcuts to learn
|
||||
- Composer mode takes practice
|
||||
- More features to understand
|
||||
|
||||
**Cost**:
|
||||
- $20/month (more than Copilot's $10)
|
||||
- No free tier for individuals
|
||||
- Worth it for heavy AI use
|
||||
|
||||
**AL-Specific Training**:
|
||||
- Not specifically trained on AL
|
||||
- Requires good AL context
|
||||
- May need explicit AL patterns
|
||||
- Works best with symbols downloaded
|
||||
|
||||
## Practical AL Examples
|
||||
|
||||
### Composer Mode: Complete Feature
|
||||
|
||||
**Command** (in Composer, `Cmd+I`):
|
||||
```
|
||||
Create a complete customer discount management system:
|
||||
|
||||
Tables:
|
||||
- Discount Group Setup (code, description, percentage)
|
||||
- Customer Discount Assignment (customer no, discount group)
|
||||
|
||||
Pages:
|
||||
- List and Card pages for each table
|
||||
|
||||
Codeunit:
|
||||
- Calculate discount based on customer's group
|
||||
- Apply discount to sales lines
|
||||
- Event subscribers for sales line validation
|
||||
|
||||
Include:
|
||||
- Proper AL naming conventions
|
||||
- XML documentation
|
||||
- Error handling
|
||||
- Data classification
|
||||
```
|
||||
|
||||
**Cursor Creates** (all files):
|
||||
|
||||
```
|
||||
Created Files:
|
||||
✓ Tables/DiscountGroupSetup.Table.al
|
||||
✓ Tables/CustomerDiscountAssignment.Table.al
|
||||
✓ Pages/DiscountGroupSetupList.Page.al
|
||||
✓ Pages/DiscountGroupSetupCard.Page.al
|
||||
✓ Pages/CustomerDiscountAssignmentList.Page.al
|
||||
✓ Codeunits/DiscountManager.Codeunit.al
|
||||
|
||||
All files properly structured with:
|
||||
- AL best practices
|
||||
- XML documentation
|
||||
- Event subscribers
|
||||
- Error handling
|
||||
```
|
||||
|
||||
### Chat: Code Review
|
||||
|
||||
**You** (in Chat):
|
||||
```
|
||||
Review this codeunit for performance and best practices:
|
||||
|
||||
[Paste codeunit]
|
||||
|
||||
Specifically check:
|
||||
- Database operations
|
||||
- AL patterns
|
||||
- Error handling
|
||||
- Code analyzers compliance
|
||||
```
|
||||
|
||||
**Cursor Analyzes**:
|
||||
```
|
||||
Found several issues:
|
||||
|
||||
1. Performance Issue (Lines 45-52):
|
||||
Multiple FindSet without SetLoadFields
|
||||
|
||||
Current:
|
||||
SalesLine.SetRange("Document No.", OrderNo);
|
||||
if SalesLine.FindSet() then
|
||||
|
||||
Recommended:
|
||||
SalesLine.SetRange("Document No.", OrderNo);
|
||||
SalesLine.SetLoadFields(Quantity, "Unit Price", Amount);
|
||||
if SalesLine.FindSet() then
|
||||
|
||||
2. Missing Error Handling (Lines 67-70):
|
||||
No try-catch for posting operation
|
||||
|
||||
[Shows specific improvements]
|
||||
|
||||
3. CodeCop Violations:
|
||||
- Procedure names don't follow AL naming
|
||||
- Missing XML documentation
|
||||
|
||||
[Lists specific fixes needed]
|
||||
|
||||
Would you like me to apply these fixes?
|
||||
```
|
||||
|
||||
### Inline Edit (Cmd+K)
|
||||
|
||||
**Select procedure, press Cmd+K**:
|
||||
```
|
||||
"Add Application Insights telemetry to track execution time and parameters"
|
||||
```
|
||||
|
||||
**Cursor Shows Diff**:
|
||||
```al
|
||||
- procedure ProcessOrder(OrderNo: Code[20])
|
||||
+ procedure ProcessOrder(OrderNo: Code[20])
|
||||
var
|
||||
SalesHeader: Record "Sales Header";
|
||||
+ Telemetry: Codeunit Telemetry;
|
||||
+ CustomDimensions: Dictionary of [Text, Text];
|
||||
+ StartTime: DateTime;
|
||||
begin
|
||||
+ StartTime := CurrentDateTime;
|
||||
+ CustomDimensions.Add('OrderNo', OrderNo);
|
||||
+
|
||||
+ Telemetry.LogMessage('ORDER-001', 'Processing order started',
|
||||
+ Verbosity::Normal, DataClassification::SystemMetadata,
|
||||
+ TelemetryScope::ExtensionPublisher, CustomDimensions);
|
||||
+
|
||||
// Existing code...
|
||||
+
|
||||
+ CustomDimensions.Add('Duration', Format(CurrentDateTime - StartTime));
|
||||
+ Telemetry.LogMessage('ORDER-002', 'Processing order completed',
|
||||
+ Verbosity::Normal, DataClassification::SystemMetadata,
|
||||
+ TelemetryScope::ExtensionPublisher, CustomDimensions);
|
||||
end;
|
||||
```
|
||||
|
||||
Accept with `Cmd+Enter`, reject with `Cmd+Backspace`
|
||||
|
||||
### Codebase Chat
|
||||
|
||||
**You**:
|
||||
```
|
||||
@codebase How is customer validation currently implemented in this project?
|
||||
```
|
||||
|
||||
**Cursor** (searches entire project):
|
||||
```
|
||||
Found customer validation in 3 places:
|
||||
|
||||
1. Codeunit 50100 "Customer Validator" (Lines 23-45):
|
||||
- Main validation logic
|
||||
- Checks blocked status
|
||||
- Validates credit limit
|
||||
|
||||
2. Table Extension 50100 "Customer Extension" (Lines 15-20):
|
||||
- OnValidate trigger for custom field
|
||||
|
||||
3. Event Subscriber in Codeunit 50105 (Lines 67-80):
|
||||
- Subscribes to Customer OnAfterValidate
|
||||
- Adds additional custom validation
|
||||
|
||||
Recommendation: Consolidate validation logic into single codeunit
|
||||
for better maintainability.
|
||||
|
||||
[Shows code snippets from each location]
|
||||
```
|
||||
|
||||
## How It Differs from Other Agents
|
||||
|
||||
### vs. GitHub Copilot
|
||||
|
||||
**Cursor**:
|
||||
- ✓ Multiple AI models (including GPT-4)
|
||||
- ✓ Composer mode (multi-file editing)
|
||||
- ✓ Better codebase understanding
|
||||
- ✓ More advanced features
|
||||
- ✗ Higher cost ($20 vs $10)
|
||||
- ✗ Different editor (learning curve)
|
||||
|
||||
**Copilot**:
|
||||
- ✓ Lower cost
|
||||
- ✓ Standard VS Code
|
||||
- ✓ Familiar workflow
|
||||
- ✗ Single AI model
|
||||
- ✗ No composer mode
|
||||
- ✗ Less context awareness
|
||||
|
||||
### vs. Claude
|
||||
|
||||
**Cursor**:
|
||||
- ✓ IDE integration
|
||||
- ✓ Multi-file editing
|
||||
- ✓ Direct code application
|
||||
- ✓ Can use Claude as AI model!
|
||||
- ✗ Smaller context per interaction
|
||||
|
||||
**Claude**:
|
||||
- ✓ Larger context window
|
||||
- ✓ Better for analysis
|
||||
- ✓ Web interface
|
||||
- ✗ No IDE integration
|
||||
- ✗ Manual copy-paste
|
||||
|
||||
**Note**: Cursor can use Claude as its AI model, giving you best of both!
|
||||
|
||||
### vs. VS Code + Extensions
|
||||
|
||||
**Cursor**:
|
||||
- ✓ Native AI integration
|
||||
- ✓ Optimized for AI workflow
|
||||
- ✓ Advanced features
|
||||
- ✓ All VS Code extensions work
|
||||
- ✗ Different app (not VS Code)
|
||||
- ✗ Subscription required
|
||||
|
||||
**VS Code + Copilot**:
|
||||
- ✓ Standard VS Code
|
||||
- ✓ Familiar environment
|
||||
- ✓ Established workflow
|
||||
- ✗ Less AI integration
|
||||
- ✗ Fewer AI features
|
||||
|
||||
## Setup & Configuration
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Download Cursor**
|
||||
- Visit [cursor.sh](https://cursor.sh)
|
||||
- Download for your OS
|
||||
- Install application
|
||||
|
||||
2. **Sign Up**
|
||||
- Create account
|
||||
- Choose subscription plan
|
||||
- Verify email
|
||||
|
||||
3. **Configure AL Development**
|
||||
- Install AL Language extension
|
||||
- Import VS Code settings (optional)
|
||||
- Download BC symbols
|
||||
- Open your AL project
|
||||
|
||||
### Migrating from VS Code
|
||||
|
||||
**Import Settings**:
|
||||
```
|
||||
Cursor > Settings > Import Settings from VS Code
|
||||
```
|
||||
|
||||
**Your Extensions**:
|
||||
- All VS Code extensions work
|
||||
- Install AL Language
|
||||
- Install AL Object Designer
|
||||
- Install other AL tools
|
||||
|
||||
**Keyboard Shortcuts**:
|
||||
- Most VS Code shortcuts work
|
||||
- Learn Cursor-specific shortcuts:
|
||||
- `Cmd+K`: Inline edit
|
||||
- `Cmd+L`: Chat
|
||||
- `Cmd+I`: Composer
|
||||
|
||||
### Optimizing for AL
|
||||
|
||||
**Workspace Setup**:
|
||||
- Keep `app.json` well-configured
|
||||
- Download symbols first
|
||||
- Organize files clearly
|
||||
- Use descriptive naming
|
||||
|
||||
**AI Model Selection**:
|
||||
- GPT-4 for general coding
|
||||
- Claude for analysis
|
||||
- Experiment to find preference
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Using Composer Mode
|
||||
|
||||
**Clear Instructions**:
|
||||
```
|
||||
Good:
|
||||
"Create AL customer loyalty system with:
|
||||
- Tier setup table (code, name, min points, discount %)
|
||||
- Customer points table (customer no, points, tier code)
|
||||
- List and card pages for both
|
||||
- Codeunit to calculate and assign tiers
|
||||
- Event subscriber to update on purchase
|
||||
Follow AL naming conventions and add XML docs"
|
||||
|
||||
Poor:
|
||||
"Make a loyalty system"
|
||||
```
|
||||
|
||||
**Iterative Development**:
|
||||
1. Start with basic structure
|
||||
2. Review generated files
|
||||
3. Ask for refinements
|
||||
4. Add features incrementally
|
||||
|
||||
### Using Chat Effectively
|
||||
|
||||
**Reference Files**:
|
||||
```
|
||||
@filename.al What does this procedure do?
|
||||
@codebase How is posting handled in this project?
|
||||
```
|
||||
|
||||
**Specific Questions**:
|
||||
```
|
||||
"Review CustomerProcessor.codeunit.al for:
|
||||
- Performance issues
|
||||
- AL best practices
|
||||
- Missing error handling"
|
||||
```
|
||||
|
||||
### Using Inline Edit
|
||||
|
||||
**Targeted Changes**:
|
||||
- Select specific code
|
||||
- Request specific improvements
|
||||
- Review diff carefully
|
||||
- Accept or modify
|
||||
|
||||
## Pricing
|
||||
|
||||
**Pro Plan**: $20/month
|
||||
- Unlimited AI completions
|
||||
- Unlimited chat
|
||||
- Composer mode
|
||||
- All AI models
|
||||
- Priority support
|
||||
|
||||
**Business Plan**: Custom pricing
|
||||
- Team features
|
||||
- Organization management
|
||||
- Usage analytics
|
||||
- Enhanced security
|
||||
|
||||
**Free Trial**: 14 days (typically)
|
||||
|
||||
**Link**: [Cursor Pricing](https://cursor.sh/pricing)
|
||||
|
||||
## Privacy & Security
|
||||
|
||||
### What Gets Sent
|
||||
- Code you're working on
|
||||
- Files in your workspace
|
||||
- Chat messages
|
||||
- User interactions
|
||||
|
||||
### Privacy Controls
|
||||
- Can disable AI features
|
||||
- Control what's indexed
|
||||
- Configure model usage
|
||||
- Review privacy settings
|
||||
|
||||
### Best Practices
|
||||
- Don't include sensitive data
|
||||
- Review organization policies
|
||||
- Use privacy mode when needed
|
||||
- Understand data handling
|
||||
|
||||
## When to Use Cursor
|
||||
|
||||
### ✓ Ideal For
|
||||
|
||||
- **New Projects**: Build from scratch with AI
|
||||
- **Large Refactoring**: Multi-file changes
|
||||
- **Learning**: Explore AL patterns
|
||||
- **Rapid Development**: Build features quickly
|
||||
- **Experimentation**: Try different approaches
|
||||
- **Team Development**: Consistent patterns
|
||||
|
||||
### ⚠ Consider Alternatives
|
||||
|
||||
- **Quick edits** → GitHub Copilot faster
|
||||
- **Just need VS Code** → Stick with Copilot
|
||||
- **Budget constrained** → Copilot cheaper
|
||||
- **Prefer standard tools** → VS Code + Copilot
|
||||
|
||||
## Practical Workflows
|
||||
|
||||
### Starting New Extension
|
||||
|
||||
1. **Composer Mode**: Generate project structure
|
||||
2. **Chat**: Refine and improve
|
||||
3. **Inline Edit**: Add features
|
||||
4. **Tab**: Complete code quickly
|
||||
|
||||
### Refactoring Existing Code
|
||||
|
||||
1. **Chat**: "Analyze this project for improvements"
|
||||
2. **Review**: Understand suggestions
|
||||
3. **Composer**: Apply multi-file changes
|
||||
4. **Inline**: Fix specific issues
|
||||
|
||||
### Learning AL Patterns
|
||||
|
||||
1. **Generate example** with Composer
|
||||
2. **Ask Chat** to explain
|
||||
3. **Experiment** with variations
|
||||
4. **Apply** to real project
|
||||
|
||||
## Complementary Tools
|
||||
|
||||
**Use With**:
|
||||
- AL Language extension (required)
|
||||
- AL analyzers for quality
|
||||
- Git for version control
|
||||
- BC symbols for context
|
||||
|
||||
**Workflow**:
|
||||
1. Cursor for development
|
||||
2. AL analyzers for validation
|
||||
3. Git for safety
|
||||
4. Claude (via Cursor) for analysis
|
||||
|
||||
## Tips for AL Development
|
||||
|
||||
**Provide AL Context**:
|
||||
```
|
||||
"Generate AL code for Business Central v22..."
|
||||
"Follow AL naming conventions..."
|
||||
"Use BC standard posting patterns..."
|
||||
```
|
||||
|
||||
**Use Codebase Context**:
|
||||
```
|
||||
@codebase Reference existing table structures
|
||||
@CustomerTable.al Follow this naming pattern
|
||||
```
|
||||
|
||||
**Leverage Models**:
|
||||
- GPT-4 for code generation
|
||||
- Claude for analysis
|
||||
- Try both for comparison
|
||||
|
||||
**Iterate**:
|
||||
- Generate basic structure
|
||||
- Review and refine
|
||||
- Add complexity gradually
|
||||
- Test thoroughly
|
||||
|
||||
## Resources
|
||||
|
||||
### Official
|
||||
- [Cursor Website](https://cursor.sh)
|
||||
- [Cursor Documentation](https://docs.cursor.sh)
|
||||
- [Community Discord](https://discord.gg/cursor)
|
||||
|
||||
### AL Guidelines
|
||||
- [Effective Prompting](../../getting-started/effective-prompting)
|
||||
- [Best Practices](../../getting-started/best-practices)
|
||||
- [Getting More Examples](../../getting-more)
|
||||
|
||||
## Learning Cursor
|
||||
|
||||
### Start Simple
|
||||
1. Try tab completion (like Copilot)
|
||||
2. Use chat for questions
|
||||
3. Experiment with Cmd+K
|
||||
4. Practice Composer on small tasks
|
||||
|
||||
### Progress to Advanced
|
||||
1. Multi-file projects with Composer
|
||||
2. Codebase-wide refactoring
|
||||
3. Multiple AI model usage
|
||||
4. Advanced keyboard shortcuts
|
||||
|
||||
### Master Features
|
||||
1. Understand when to use each mode
|
||||
2. Optimize prompts for better results
|
||||
3. Integrate into daily workflow
|
||||
4. Share patterns with team
|
||||
|
||||
---
|
||||
|
||||
**Next Steps**:
|
||||
- Download [Cursor](https://cursor.sh)
|
||||
- Try free trial
|
||||
- Compare with [other AI agents](./)
|
||||
- Use alongside your existing tools
|
||||
|
||||
**Questions?** Join [GitHub Discussions](https://github.com/microsoft/alguidelines/discussions)
|
||||
|
|
@ -0,0 +1,552 @@
|
|||
---
|
||||
title: "GitHub Copilot Agent"
|
||||
linkTitle: "GitHub Copilot"
|
||||
weight: 1
|
||||
description: >
|
||||
Microsoft's AI pair programmer for real-time code completion and suggestions
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
GitHub Copilot is Microsoft's AI-powered coding assistant that provides real-time code suggestions directly in your editor. It's trained on billions of lines of public code and integrates seamlessly with Visual Studio Code.
|
||||
|
||||
**Developer**: GitHub (Microsoft)
|
||||
**Type**: AI Code Completion Agent
|
||||
**Primary Use**: Inline code suggestions as you type
|
||||
**Integration**: Native VS Code extension
|
||||
|
||||
## What is GitHub Copilot?
|
||||
|
||||
GitHub Copilot acts as an AI pair programmer that:
|
||||
- Suggests code completions in real-time
|
||||
- Generates entire functions from comments
|
||||
- Provides multiple suggestion alternatives
|
||||
- Understands context from your codebase
|
||||
- Learns patterns specific to AL and Business Central
|
||||
|
||||
### How It Works
|
||||
|
||||
1. **You write**: A comment or start typing code
|
||||
2. **Copilot analyzes**: Your code, open files, and context
|
||||
3. **Copilot suggests**: Code completion in gray text
|
||||
4. **You decide**: Accept (Tab), reject (Esc), or modify
|
||||
|
||||
**Example**:
|
||||
```al
|
||||
// Type this comment:
|
||||
/// Calculate total sales for customer including tax
|
||||
|
||||
// Copilot suggests (press Tab to accept):
|
||||
procedure CalculateTotalSalesWithTax(CustomerNo: Code[20]): Decimal
|
||||
var
|
||||
SalesLine: Record "Sales Line";
|
||||
TotalAmount: Decimal;
|
||||
begin
|
||||
SalesLine.SetRange("Sell-to Customer No.", CustomerNo);
|
||||
SalesLine.SetRange(Type, SalesLine.Type::Item);
|
||||
if SalesLine.FindSet() then
|
||||
repeat
|
||||
TotalAmount += SalesLine."Amount Including VAT";
|
||||
until SalesLine.Next() = 0;
|
||||
exit(TotalAmount);
|
||||
end;
|
||||
```
|
||||
|
||||
## Key Capabilities
|
||||
|
||||
### For AL Development
|
||||
|
||||
**Understands AL Syntax**:
|
||||
- Recognizes AL keywords and patterns
|
||||
- Knows Business Central object types
|
||||
- Suggests BC-appropriate code structures
|
||||
- Follows AL naming conventions
|
||||
|
||||
**Business Central Awareness**:
|
||||
- Familiar with BC table structures
|
||||
- Knows common BC APIs
|
||||
- Suggests standard BC patterns
|
||||
- Understands event subscriber patterns
|
||||
|
||||
**Context-Aware**:
|
||||
- Reads your open AL files
|
||||
- Understands project structure
|
||||
- References your existing code
|
||||
- Adapts to your coding style
|
||||
|
||||
### Code Generation Capabilities
|
||||
|
||||
**From Comments**:
|
||||
```al
|
||||
/// Create a page extension for Customer Card that adds loyalty points field
|
||||
|
||||
// Generates complete page extension structure
|
||||
```
|
||||
|
||||
**From Partial Code**:
|
||||
```al
|
||||
procedure ValidateCustomer
|
||||
// Continue typing... Copilot completes with parameters, logic
|
||||
```
|
||||
|
||||
**From Patterns**:
|
||||
```al
|
||||
[EventSubscriber(
|
||||
// Copilot suggests common event patterns
|
||||
```
|
||||
|
||||
**Test Code**:
|
||||
```al
|
||||
[Test]
|
||||
procedure TestCustomerValidation
|
||||
// Generates test structure with Given-When-Then
|
||||
```
|
||||
|
||||
## Strengths for AL Development
|
||||
|
||||
### ✓ Excellent At
|
||||
|
||||
**Boilerplate Code**:
|
||||
- Table and field definitions
|
||||
- Page layouts
|
||||
- Standard procedures
|
||||
- Variable declarations
|
||||
|
||||
**Common Patterns**:
|
||||
- CRUD operations
|
||||
- Validation logic
|
||||
- Event subscribers
|
||||
- API pages
|
||||
|
||||
**Code Structure**:
|
||||
- Procedure signatures
|
||||
- If-then-else logic
|
||||
- Loop structures
|
||||
- Error handling templates
|
||||
|
||||
**Quick Edits**:
|
||||
- Adding fields
|
||||
- Extending objects
|
||||
- Creating similar code
|
||||
- Repetitive tasks
|
||||
|
||||
### ⚠ Use With Care
|
||||
|
||||
**Complex Business Logic**:
|
||||
- May not understand specific requirements
|
||||
- Review carefully for correctness
|
||||
- Validate against business rules
|
||||
|
||||
**Performance-Critical Code**:
|
||||
- Check for efficient database queries
|
||||
- Verify optimal AL patterns
|
||||
- Profile if needed
|
||||
|
||||
**Security-Sensitive Code**:
|
||||
- Review authentication logic
|
||||
- Validate input handling
|
||||
- Check authorization patterns
|
||||
|
||||
## How It Differs from Other Agents
|
||||
|
||||
### vs. GitHub Copilot Chat
|
||||
**Copilot (Inline)**:
|
||||
- ✓ Better for code completion
|
||||
- ✓ Faster for quick edits
|
||||
- ✓ Non-intrusive workflow
|
||||
- ✗ Limited explanation ability
|
||||
- ✗ Can't answer questions
|
||||
|
||||
**Copilot Chat**:
|
||||
- ✓ Better for explanations
|
||||
- ✓ Can answer questions
|
||||
- ✓ Helps with debugging
|
||||
- ✗ Slower for quick completions
|
||||
- ✗ More context switching
|
||||
|
||||
**Best Practice**: Use both together
|
||||
|
||||
### vs. Claude
|
||||
**GitHub Copilot**:
|
||||
- ✓ Faster inline suggestions
|
||||
- ✓ Better VS Code integration
|
||||
- ✓ No context switching
|
||||
- ✗ Smaller context window
|
||||
- ✗ No deep analysis
|
||||
|
||||
**Claude**:
|
||||
- ✓ Larger context window
|
||||
- ✓ Better for complex analysis
|
||||
- ✓ Strong reasoning
|
||||
- ✗ No inline completions
|
||||
- ✗ Manual copy-paste workflow
|
||||
|
||||
**Best Practice**: Copilot for coding, Claude for analysis
|
||||
|
||||
### vs. Cursor
|
||||
**GitHub Copilot**:
|
||||
- ✓ Works in standard VS Code
|
||||
- ✓ Familiar environment
|
||||
- ✓ Just code completion
|
||||
- ✗ Single AI model
|
||||
- ✗ Limited multi-file edits
|
||||
|
||||
**Cursor**:
|
||||
- ✓ Multiple AI models
|
||||
- ✓ Advanced features (Composer)
|
||||
- ✓ Better multi-file editing
|
||||
- ✗ Different editor
|
||||
- ✗ Learning curve
|
||||
|
||||
**Best Practice**: Copilot for standard workflow, Cursor for advanced needs
|
||||
|
||||
## Practical AL Examples
|
||||
|
||||
### Creating Tables
|
||||
|
||||
**Input** (comment):
|
||||
```al
|
||||
/// Customer loyalty tier table with tier name, min points, and discount percentage
|
||||
```
|
||||
|
||||
**Copilot Generates**:
|
||||
```al
|
||||
table 50100 "Customer Loyalty Tier"
|
||||
{
|
||||
DataClassification = CustomerContent;
|
||||
|
||||
fields
|
||||
{
|
||||
field(1; "Code"; Code[20])
|
||||
{
|
||||
Caption = 'Code';
|
||||
}
|
||||
field(2; "Tier Name"; Text[50])
|
||||
{
|
||||
Caption = 'Tier Name';
|
||||
}
|
||||
field(10; "Minimum Points"; Integer)
|
||||
{
|
||||
Caption = 'Minimum Points';
|
||||
MinValue = 0;
|
||||
}
|
||||
field(20; "Discount Percentage"; Decimal)
|
||||
{
|
||||
Caption = 'Discount Percentage';
|
||||
MinValue = 0;
|
||||
MaxValue = 100;
|
||||
DecimalPlaces = 0 : 2;
|
||||
}
|
||||
}
|
||||
|
||||
keys
|
||||
{
|
||||
key(PK; "Code")
|
||||
{
|
||||
Clustered = true;
|
||||
}
|
||||
key(Points; "Minimum Points")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Event Subscribers
|
||||
|
||||
**Input** (partial code):
|
||||
```al
|
||||
[EventSubscriber(ObjectType::Table, Database::Customer, 'OnAfterValidateEvent', 'Credit Limit (LCY)', false, false)]
|
||||
```
|
||||
|
||||
**Copilot Completes**:
|
||||
```al
|
||||
local procedure OnAfterValidateCreditLimit(var Rec: Record Customer; var xRec: Record Customer; CurrFieldNo: Integer)
|
||||
begin
|
||||
// Add your implementation
|
||||
if Rec."Credit Limit (LCY)" > 100000 then
|
||||
if not Confirm('Credit limit exceeds 100,000. Continue?') then
|
||||
Error('');
|
||||
end;
|
||||
```
|
||||
|
||||
### API Pages
|
||||
|
||||
**Input**:
|
||||
```al
|
||||
/// API v2.0 page for items exposing no, description, unit price, inventory
|
||||
```
|
||||
|
||||
**Copilot Generates**:
|
||||
```al
|
||||
page 50100 "Item API"
|
||||
{
|
||||
APIVersion = 'v2.0';
|
||||
APIPublisher = 'yourcompany';
|
||||
APIGroup = 'inventory';
|
||||
EntityCaption = 'Item';
|
||||
EntitySetCaption = 'Items';
|
||||
PageType = API;
|
||||
SourceTable = Item;
|
||||
DelayedInsert = true;
|
||||
ODataKeyFields = SystemId;
|
||||
|
||||
layout
|
||||
{
|
||||
area(Content)
|
||||
{
|
||||
repeater(GroupName)
|
||||
{
|
||||
field(id; Rec.SystemId)
|
||||
{
|
||||
Caption = 'Id';
|
||||
Editable = false;
|
||||
}
|
||||
field(number; Rec."No.")
|
||||
{
|
||||
Caption = 'No.';
|
||||
}
|
||||
field(description; Rec.Description)
|
||||
{
|
||||
Caption = 'Description';
|
||||
}
|
||||
field(unitPrice; Rec."Unit Price")
|
||||
{
|
||||
Caption = 'Unit Price';
|
||||
}
|
||||
field(inventory; Rec.Inventory)
|
||||
{
|
||||
Caption = 'Inventory';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Test Code
|
||||
|
||||
**Input**:
|
||||
```al
|
||||
[Test]
|
||||
procedure TestCustomerCreditLimitValidation
|
||||
```
|
||||
|
||||
**Copilot Suggests**:
|
||||
```al
|
||||
[Test]
|
||||
procedure TestCustomerCreditLimitValidation()
|
||||
var
|
||||
Customer: Record Customer;
|
||||
LibrarySales: Codeunit "Library - Sales";
|
||||
begin
|
||||
// [GIVEN] A customer with credit limit set
|
||||
Customer.Init();
|
||||
Customer."No." := LibrarySales.CreateCustomerNo();
|
||||
Customer."Credit Limit (LCY)" := 50000;
|
||||
Customer.Insert();
|
||||
|
||||
// [WHEN] Credit limit is exceeded
|
||||
Customer.Validate("Credit Limit (LCY)", 150000);
|
||||
|
||||
// [THEN] Appropriate validation occurs
|
||||
// Add assertions here
|
||||
end;
|
||||
```
|
||||
|
||||
## Setup & Configuration
|
||||
|
||||
### Installation
|
||||
|
||||
See the detailed [GitHub Copilot Tool Page](../Tools/github-copilot) for complete installation instructions.
|
||||
|
||||
**Quick Start**:
|
||||
1. Install GitHub Copilot extension in VS Code
|
||||
2. Sign in with GitHub account
|
||||
3. Verify subscription is active
|
||||
4. Start coding in AL files
|
||||
|
||||
### Optimizing for AL
|
||||
|
||||
**VS Code Settings**:
|
||||
```json
|
||||
{
|
||||
"github.copilot.enable": {
|
||||
"*": true,
|
||||
"al": true
|
||||
},
|
||||
"editor.inlineSuggest.enabled": true,
|
||||
"editor.quickSuggestions": {
|
||||
"other": true,
|
||||
"comments": true,
|
||||
"strings": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Project Setup**:
|
||||
- Keep `app.json` well-configured
|
||||
- Download BC symbols
|
||||
- Use descriptive file names
|
||||
- Maintain good code organization
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Getting Quality Suggestions
|
||||
|
||||
**Write Clear Comments**:
|
||||
```al
|
||||
❌ // calc total
|
||||
✅ /// Calculate the total sales amount for a customer including tax and discounts
|
||||
```
|
||||
|
||||
**Use Meaningful Names**:
|
||||
```al
|
||||
❌ procedure Calc(x: Code[20]): Decimal
|
||||
✅ procedure CalculateCustomerTotalSales(CustomerNo: Code[20]): Decimal
|
||||
```
|
||||
|
||||
**Provide Context**:
|
||||
- Keep related files open
|
||||
- Use consistent naming
|
||||
- Follow AL conventions
|
||||
- Add XML documentation
|
||||
|
||||
### Review Checklist
|
||||
|
||||
Before accepting Copilot suggestions:
|
||||
|
||||
- [ ] Does it match my requirements?
|
||||
- [ ] Is the AL syntax correct?
|
||||
- [ ] Are BC APIs used properly?
|
||||
- [ ] Is it performant?
|
||||
- [ ] Does it follow best practices?
|
||||
- [ ] Is error handling appropriate?
|
||||
- [ ] Are data types correct?
|
||||
|
||||
### Workflow Integration
|
||||
|
||||
**Effective Use**:
|
||||
1. Write descriptive comment or start typing
|
||||
2. Review Copilot's suggestion
|
||||
3. Accept if good, modify if needed
|
||||
4. Test the generated code
|
||||
5. Refine as necessary
|
||||
|
||||
**Don't**:
|
||||
- Blindly accept every suggestion
|
||||
- Skip testing generated code
|
||||
- Ignore code analysis warnings
|
||||
- Use without understanding
|
||||
|
||||
## Pricing
|
||||
|
||||
**Individual**:
|
||||
- $10/month or $100/year
|
||||
- Free for verified students
|
||||
- Free for open source maintainers
|
||||
|
||||
**Business**:
|
||||
- $19/user/month
|
||||
- Organization management
|
||||
- Policy controls
|
||||
- Usage insights
|
||||
|
||||
**Free Trial**: Usually 30 days available
|
||||
|
||||
**Link**: [GitHub Copilot Pricing](https://github.com/features/copilot)
|
||||
|
||||
## Privacy & Security
|
||||
|
||||
### What Gets Sent
|
||||
- Code snippets from your editor
|
||||
- File names and structure
|
||||
- Code you're working on
|
||||
- Acceptance/rejection of suggestions
|
||||
|
||||
### What You Control
|
||||
- Enable/disable globally
|
||||
- Disable for specific files/repos
|
||||
- Block suggestions from public code
|
||||
- Telemetry settings
|
||||
|
||||
### Best Practices
|
||||
- Don't commit secrets to code
|
||||
- Review organization policies
|
||||
- Use Business plan for enterprise control
|
||||
- Understand data retention policies
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**No Suggestions Appearing**:
|
||||
- Check extension is enabled
|
||||
- Verify subscription is active
|
||||
- Ensure AL files are recognized
|
||||
- Reload VS Code window
|
||||
|
||||
**Poor Quality Suggestions**:
|
||||
- Download BC symbols
|
||||
- Add more context (comments, related files)
|
||||
- Use descriptive names
|
||||
- Open related AL files
|
||||
|
||||
**Slow Performance**:
|
||||
- Close unnecessary files
|
||||
- Check internet connection
|
||||
- Reduce workspace size
|
||||
- Update VS Code
|
||||
|
||||
## Learning Resources
|
||||
|
||||
### Official Resources
|
||||
- [GitHub Copilot Documentation](https://docs.github.com/copilot)
|
||||
- [VS Code Extension Page](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot)
|
||||
- [Getting Started Guide](https://docs.github.com/copilot/getting-started-with-github-copilot)
|
||||
|
||||
### AL Guidelines Resources
|
||||
- [Setup Guide](../../getting-started/setup)
|
||||
- [Effective Prompting](../../getting-started/effective-prompting)
|
||||
- [Best Practices](../../getting-started/best-practices)
|
||||
- [Code Review Examples](../../getting-more/code-review)
|
||||
|
||||
## When to Use GitHub Copilot
|
||||
|
||||
### ✓ Ideal For
|
||||
|
||||
- Daily AL development
|
||||
- Quick code generation
|
||||
- Learning AL patterns
|
||||
- Reducing boilerplate
|
||||
- Standard BC implementations
|
||||
- Exploring APIs
|
||||
|
||||
### ⚠ Consider Alternatives
|
||||
|
||||
- **Complex analysis** → Use Claude or Copilot Chat
|
||||
- **Multi-file refactoring** → Use Cursor
|
||||
- **Learning deep concepts** → Use Copilot Chat or Claude
|
||||
- **Architecture decisions** → Human expertise required
|
||||
|
||||
## Complementary Tools
|
||||
|
||||
**Use With**:
|
||||
- [GitHub Copilot Chat](github-copilot-chat-agent) - For explanations and debugging
|
||||
- [AL Language Extension](../Tools/al-language) - For AL support
|
||||
- [AL Code Analyzers](../Tools/al-codecop) - For quality checks
|
||||
|
||||
**Workflow**:
|
||||
1. Copilot generates code
|
||||
2. AL analyzers check quality
|
||||
3. Copilot Chat explains complex parts
|
||||
4. You review and test
|
||||
|
||||
---
|
||||
|
||||
**Next Steps**:
|
||||
- Install and try [GitHub Copilot](../Tools/github-copilot)
|
||||
- Learn about [Copilot Chat](github-copilot-chat-agent) for complementary features
|
||||
- Compare with other [AI Agents](./)
|
||||
|
||||
**Questions?** Join [GitHub Discussions](https://github.com/microsoft/alguidelines/discussions)
|
||||
|
|
@ -0,0 +1,627 @@
|
|||
---
|
||||
title: "GitHub Copilot Chat Agent"
|
||||
linkTitle: "Copilot Chat"
|
||||
weight: 2
|
||||
description: >
|
||||
Conversational AI assistant for code explanations, debugging, and interactive development
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
GitHub Copilot Chat is a conversational AI assistant integrated into Visual Studio Code that allows you to ask questions, get explanations, and receive guidance through natural language interaction.
|
||||
|
||||
**Developer**: GitHub (Microsoft)
|
||||
**Type**: Conversational AI Agent
|
||||
**Primary Use**: Interactive code assistance, explanations, and debugging
|
||||
**Integration**: Native VS Code extension
|
||||
|
||||
## What is GitHub Copilot Chat?
|
||||
|
||||
GitHub Copilot Chat provides an interactive AI assistant that:
|
||||
- Answers questions about code and AL development
|
||||
- Explains complex code segments
|
||||
- Helps debug issues
|
||||
- Suggests refactoring approaches
|
||||
- Provides learning and guidance
|
||||
- Generates code based on detailed requirements
|
||||
|
||||
### How It Works
|
||||
|
||||
1. **You ask**: Questions in natural language via chat panel or inline
|
||||
2. **Chat analyzes**: Your code, context, and question
|
||||
3. **Chat responds**: With explanations, code, or suggestions
|
||||
4. **You interact**: Ask follow-ups, refine, or apply suggestions
|
||||
|
||||
**Example Interaction**:
|
||||
```
|
||||
You: Explain how this procedure validates customer credit limits
|
||||
|
||||
Chat: This procedure validates customer credit limits by:
|
||||
1. Retrieving the customer record
|
||||
2. Calculating current outstanding amount
|
||||
3. Comparing against credit limit
|
||||
4. Raising an error if exceeded
|
||||
|
||||
The validation ensures customers cannot exceed their credit limits
|
||||
before creating new sales orders...
|
||||
```
|
||||
|
||||
## Key Capabilities
|
||||
|
||||
### For AL Development
|
||||
|
||||
**Code Explanation**:
|
||||
- Describes what AL code does
|
||||
- Explains Business Central concepts
|
||||
- Breaks down complex procedures
|
||||
- Clarifies AL syntax and patterns
|
||||
|
||||
**Interactive Learning**:
|
||||
- Teaches AL patterns
|
||||
- Explains BC APIs
|
||||
- Provides examples
|
||||
- Answers "how do I..." questions
|
||||
|
||||
**Debugging Assistance**:
|
||||
- Helps diagnose errors
|
||||
- Suggests fixes
|
||||
- Explains error messages
|
||||
- Proposes debugging strategies
|
||||
|
||||
**Code Generation**:
|
||||
- Creates code from detailed descriptions
|
||||
- Generates test cases
|
||||
- Produces documentation
|
||||
- Builds complex structures
|
||||
|
||||
## How to Use Copilot Chat
|
||||
|
||||
### Chat Panel
|
||||
|
||||
**Open Chat**:
|
||||
- Press `Ctrl+Shift+I` (Windows/Linux)
|
||||
- Press `Cmd+Shift+I` (Mac)
|
||||
- Click chat icon in sidebar
|
||||
|
||||
**Chat Interface**:
|
||||
```
|
||||
┌─────────────────────────────┐
|
||||
│ GitHub Copilot Chat │
|
||||
├─────────────────────────────┤
|
||||
│ Your conversation history │
|
||||
│ │
|
||||
│ You: How do I... │
|
||||
│ Copilot: You can... │
|
||||
│ │
|
||||
├─────────────────────────────┤
|
||||
│ Type your question... [>]│
|
||||
└─────────────────────────────┘
|
||||
```
|
||||
|
||||
### Inline Chat
|
||||
|
||||
**Open Inline**:
|
||||
- Press `Ctrl+I` in editor
|
||||
- Chat appears next to your code
|
||||
- Ask quick questions
|
||||
- Get instant suggestions
|
||||
|
||||
**Use Cases**:
|
||||
- Quick refactoring
|
||||
- Explain selected code
|
||||
- Fix errors in place
|
||||
- Generate code snippets
|
||||
|
||||
### Slash Commands
|
||||
|
||||
Quick access to common tasks:
|
||||
|
||||
| Command | Purpose | Example |
|
||||
|---------|---------|---------|
|
||||
| `/explain` | Explain selected code | `/explain this validation logic` |
|
||||
| `/fix` | Suggest fixes | `/fix the error in this procedure` |
|
||||
| `/tests` | Generate tests | `/tests for this codeunit` |
|
||||
| `/help` | Show commands | `/help` |
|
||||
| `/clear` | Clear chat | `/clear` |
|
||||
|
||||
## Strengths for AL Development
|
||||
|
||||
### ✓ Excellent At
|
||||
|
||||
**Learning & Understanding**:
|
||||
- Explaining AL concepts
|
||||
- Teaching BC patterns
|
||||
- Clarifying syntax
|
||||
- Answering "why" questions
|
||||
|
||||
**Debugging Help**:
|
||||
- Diagnosing errors
|
||||
- Suggesting fixes
|
||||
- Explaining error messages
|
||||
- Proposing test cases
|
||||
|
||||
**Code Exploration**:
|
||||
- Understanding legacy code
|
||||
- Identifying patterns
|
||||
- Finding issues
|
||||
- Suggesting improvements
|
||||
|
||||
**Documentation**:
|
||||
- Generating XML comments
|
||||
- Creating README files
|
||||
- Writing user guides
|
||||
- Explaining features
|
||||
|
||||
### ⚠ Use With Care
|
||||
|
||||
**Generated Code**:
|
||||
- Always review for correctness
|
||||
- Verify BC compatibility
|
||||
- Test thoroughly
|
||||
- Adapt to your standards
|
||||
|
||||
**Complex Business Logic**:
|
||||
- May not understand specific requirements
|
||||
- Review carefully
|
||||
- Validate against rules
|
||||
|
||||
**Performance Advice**:
|
||||
- General suggestions may not fit your scenario
|
||||
- Profile and test
|
||||
- Verify with BC best practices
|
||||
|
||||
## AL-Specific Examples
|
||||
|
||||
### Code Explanation
|
||||
|
||||
**You**:
|
||||
```
|
||||
Explain this procedure and when I should use it
|
||||
|
||||
[Select and paste this code]:
|
||||
procedure CheckCreditLimit(var SalesHeader: Record "Sales Header")
|
||||
var
|
||||
Customer: Record Customer;
|
||||
OutstandingAmount: Decimal;
|
||||
begin
|
||||
Customer.Get(SalesHeader."Sell-to Customer No.");
|
||||
Customer.CalcFields("Balance (LCY)");
|
||||
OutstandingAmount := Customer."Balance (LCY)" + SalesHeader."Amount Including VAT";
|
||||
|
||||
if OutstandingAmount > Customer."Credit Limit (LCY)" then
|
||||
Error('Customer %1 would exceed credit limit. Outstanding: %2, Limit: %3',
|
||||
Customer."No.", OutstandingAmount, Customer."Credit Limit (LCY)");
|
||||
end;
|
||||
```
|
||||
|
||||
**Chat Explains**:
|
||||
```
|
||||
This procedure validates customer credit limits before allowing sales orders:
|
||||
|
||||
Purpose:
|
||||
- Prevents customers from exceeding their credit limits
|
||||
- Calculates total outstanding amount (existing balance + new order)
|
||||
- Raises an error if limit would be exceeded
|
||||
|
||||
When to use:
|
||||
- Before posting sales orders
|
||||
- In OnValidate triggers for sales headers
|
||||
- As part of order validation workflow
|
||||
|
||||
Key points:
|
||||
- Uses CalcFields to get current customer balance
|
||||
- Adds new order amount to existing balance
|
||||
- Compares total against credit limit
|
||||
- Provides clear error message with details
|
||||
|
||||
Best practice considerations:
|
||||
- Consider making error message translatable
|
||||
- Might want to allow override with permission
|
||||
- Could log credit limit violations for reporting
|
||||
```
|
||||
|
||||
### Generating Complex Code
|
||||
|
||||
**You**:
|
||||
```
|
||||
Create a codeunit that processes sales orders in batch.
|
||||
|
||||
Requirements:
|
||||
- Accept list of sales order numbers
|
||||
- Validate each order (check credit, inventory)
|
||||
- Post valid orders
|
||||
- Collect and return errors for failed orders
|
||||
- Log to telemetry
|
||||
- Show progress dialog
|
||||
|
||||
Use proper error handling and AL best practices.
|
||||
```
|
||||
|
||||
**Chat Generates**:
|
||||
```al
|
||||
codeunit 50100 "Batch Sales Order Processor"
|
||||
{
|
||||
/// <summary>
|
||||
/// Processes multiple sales orders in batch with validation and error handling
|
||||
/// </summary>
|
||||
procedure ProcessOrders(OrderNumbers: List of [Code[20]]): List of [Text]
|
||||
var
|
||||
SalesHeader: Record "Sales Header";
|
||||
Errors: List of [Text];
|
||||
Dialog: Dialog;
|
||||
Counter: Integer;
|
||||
TotalCount: Integer;
|
||||
begin
|
||||
TotalCount := OrderNumbers.Count;
|
||||
Dialog.Open('Processing orders...\Order #1######### of #2#########');
|
||||
|
||||
foreach OrderNo in OrderNumbers do begin
|
||||
Counter += 1;
|
||||
Dialog.Update(1, Counter);
|
||||
Dialog.Update(2, TotalCount);
|
||||
|
||||
if not ProcessSingleOrder(OrderNo, Errors) then
|
||||
LogProcessingError(OrderNo, Errors);
|
||||
end;
|
||||
|
||||
Dialog.Close();
|
||||
LogBatchCompletion(TotalCount, Counter - Errors.Count, Errors.Count);
|
||||
exit(Errors);
|
||||
end;
|
||||
|
||||
local procedure ProcessSingleOrder(OrderNo: Code[20]; var Errors: List of [Text]): Boolean
|
||||
var
|
||||
SalesHeader: Record "Sales Header";
|
||||
SalesPost: Codeunit "Sales-Post";
|
||||
begin
|
||||
if not SalesHeader.Get(SalesHeader."Document Type"::Order, OrderNo) then begin
|
||||
Errors.Add(StrSubstNo('Order %1 not found', OrderNo));
|
||||
exit(false);
|
||||
end;
|
||||
|
||||
if not ValidateOrder(SalesHeader, Errors) then
|
||||
exit(false);
|
||||
|
||||
if not SalesPost.Run(SalesHeader) then begin
|
||||
Errors.Add(StrSubstNo('Order %1: %2', OrderNo, GetLastErrorText()));
|
||||
exit(false);
|
||||
end;
|
||||
|
||||
exit(true);
|
||||
end;
|
||||
|
||||
// Additional helper procedures...
|
||||
end;
|
||||
```
|
||||
|
||||
### Debugging Assistance
|
||||
|
||||
**You**:
|
||||
```
|
||||
I'm getting error "The field Customer No. must have a value"
|
||||
when trying to post a sales order. Here's my code:
|
||||
|
||||
[Paste problematic code]
|
||||
|
||||
What's wrong?
|
||||
```
|
||||
|
||||
**Chat Analyzes**:
|
||||
```
|
||||
The error occurs because the Customer No. field is empty when posting.
|
||||
|
||||
Looking at your code, the issue is on line 15:
|
||||
SalesHeader."Sell-to Customer No." := '';
|
||||
|
||||
This explicitly sets the customer number to empty before posting.
|
||||
|
||||
Likely causes:
|
||||
1. Customer lookup/validation failed earlier
|
||||
2. Field being cleared unintentionally
|
||||
3. Missing validation before assignment
|
||||
|
||||
Recommended fixes:
|
||||
|
||||
1. Remove the line setting it to empty
|
||||
2. Add validation:
|
||||
if Customer.Get(CustomerNo) then
|
||||
SalesHeader.Validate("Sell-to Customer No.", CustomerNo)
|
||||
else
|
||||
Error('Customer %1 does not exist', CustomerNo);
|
||||
|
||||
3. Add defensive check before posting:
|
||||
if SalesHeader."Sell-to Customer No." = '' then
|
||||
Error('Customer must be specified before posting');
|
||||
|
||||
Would you like me to show the corrected version of your code?
|
||||
```
|
||||
|
||||
### Learning AL Patterns
|
||||
|
||||
**You**:
|
||||
```
|
||||
What's the standard AL pattern for implementing a document posting routine?
|
||||
```
|
||||
|
||||
**Chat Explains**:
|
||||
```
|
||||
Standard AL document posting routines follow this pattern:
|
||||
|
||||
1. Structure:
|
||||
- Main posting codeunit
|
||||
- Optional posting preview codeunit
|
||||
- Optional batch posting codeunit
|
||||
|
||||
2. Main Posting Codeunit Pattern:
|
||||
|
||||
codeunit 50100 "Document-Post"
|
||||
{
|
||||
TableNo = "Your Document Header";
|
||||
|
||||
trigger OnRun()
|
||||
begin
|
||||
PostDocument(Rec);
|
||||
end;
|
||||
|
||||
procedure PostDocument(var DocHeader: Record "Your Document Header")
|
||||
var
|
||||
DocLine: Record "Your Document Line";
|
||||
begin
|
||||
// 1. Pre-posting checks
|
||||
CheckDocumentIsReadyToPost(DocHeader);
|
||||
|
||||
// 2. Run events (OnBeforePost)
|
||||
OnBeforePostDocument(DocHeader);
|
||||
|
||||
// 3. Lock tables
|
||||
DocHeader.LockTable();
|
||||
|
||||
// 4. Post with transaction
|
||||
PostDocumentLines(DocHeader);
|
||||
FinalizePosting(DocHeader);
|
||||
|
||||
// 5. Run events (OnAfterPost)
|
||||
OnAfterPostDocument(DocHeader);
|
||||
end;
|
||||
|
||||
// Additional procedures...
|
||||
|
||||
// Events for extensibility
|
||||
[IntegrationEvent(false, false)]
|
||||
local procedure OnBeforePostDocument(var DocHeader: Record "Your Document Header")
|
||||
begin
|
||||
end;
|
||||
}
|
||||
|
||||
Key principles:
|
||||
- Use transactions (implicit in OnRun trigger)
|
||||
- Lock records being modified
|
||||
- Provide integration events
|
||||
- Validate before posting
|
||||
- Handle errors gracefully
|
||||
- Use Codeunit.Run for error handling
|
||||
|
||||
Would you like examples of specific parts?
|
||||
```
|
||||
|
||||
## How It Differs from Other Agents
|
||||
|
||||
### vs. GitHub Copilot (Inline)
|
||||
|
||||
**Copilot Chat**:
|
||||
- ✓ Better for explanations
|
||||
- ✓ Can answer questions
|
||||
- ✓ Helps with debugging
|
||||
- ✓ Teaches concepts
|
||||
- ✗ Slower for quick edits
|
||||
|
||||
**Copilot (Inline)**:
|
||||
- ✓ Faster completions
|
||||
- ✓ Less disruptive
|
||||
- ✓ Great for quick coding
|
||||
- ✗ No explanations
|
||||
- ✗ Can't answer questions
|
||||
|
||||
**Use Together**: Inline for coding, Chat for understanding
|
||||
|
||||
### vs. Claude
|
||||
|
||||
**Copilot Chat**:
|
||||
- ✓ Native VS Code integration
|
||||
- ✓ Automatic code context
|
||||
- ✓ No copy-paste needed
|
||||
- ✗ Smaller context window
|
||||
- ✗ Less analytical depth
|
||||
|
||||
**Claude**:
|
||||
- ✓ Larger context window
|
||||
- ✓ Deeper analysis
|
||||
- ✓ Better reasoning
|
||||
- ✗ Manual workflow
|
||||
- ✗ No editor integration
|
||||
|
||||
**Use Cases**: Chat for daily work, Claude for deep analysis
|
||||
|
||||
### vs. Cursor
|
||||
|
||||
**Copilot Chat**:
|
||||
- ✓ Standard VS Code
|
||||
- ✓ Familiar environment
|
||||
- ✓ Single purpose
|
||||
- ✗ One AI model
|
||||
- ✗ Limited features
|
||||
|
||||
**Cursor**:
|
||||
- ✓ Multiple AI models
|
||||
- ✓ Composer mode
|
||||
- ✓ Advanced features
|
||||
- ✗ Different editor
|
||||
- ✗ Higher learning curve
|
||||
|
||||
**Use Cases**: Chat for standard workflow, Cursor for advanced needs
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Asking Good Questions
|
||||
|
||||
**Be Specific**:
|
||||
```
|
||||
❌ "Explain this"
|
||||
✅ "Explain how this procedure handles inventory updates
|
||||
and why it uses a transaction"
|
||||
```
|
||||
|
||||
**Provide Context**:
|
||||
```
|
||||
❌ "How do I validate?"
|
||||
✅ "How do I validate customer credit limits in AL before
|
||||
posting a sales order? Show me the BC standard pattern."
|
||||
```
|
||||
|
||||
**Break Down Complex Questions**:
|
||||
```
|
||||
Instead of:
|
||||
"Build complete order management system"
|
||||
|
||||
Try:
|
||||
1. "Show me pattern for order validation"
|
||||
2. "Now add posting logic"
|
||||
3. "Add error handling"
|
||||
4. "Add telemetry"
|
||||
```
|
||||
|
||||
### Using Responses Effectively
|
||||
|
||||
**Review Code**:
|
||||
- Understand what it does
|
||||
- Verify BC compatibility
|
||||
- Check best practices
|
||||
- Test thoroughly
|
||||
|
||||
**Learn from Explanations**:
|
||||
- Read thoroughly
|
||||
- Try examples yourself
|
||||
- Ask follow-up questions
|
||||
- Apply to your own code
|
||||
|
||||
**Iterate**:
|
||||
- Start with basic request
|
||||
- Refine based on response
|
||||
- Add requirements gradually
|
||||
- Build understanding
|
||||
|
||||
## Setup & Configuration
|
||||
|
||||
### Installation
|
||||
|
||||
See [GitHub Copilot Chat Tool Page](../Tools/github-copilot-chat) for detailed setup.
|
||||
|
||||
**Quick Start**:
|
||||
1. Install GitHub Copilot Chat extension
|
||||
2. Verify Copilot subscription
|
||||
3. Open chat panel (`Ctrl+Shift+I`)
|
||||
4. Start asking questions
|
||||
|
||||
### Optimizing for AL
|
||||
|
||||
**Provide Context**:
|
||||
- Keep relevant AL files open
|
||||
- Reference BC objects specifically
|
||||
- Mention AL version when relevant
|
||||
- Include app.json configuration
|
||||
|
||||
## Pricing
|
||||
|
||||
**Included with GitHub Copilot**:
|
||||
- Individual: $10/month or $100/year
|
||||
- Business: $19/user/month
|
||||
- Free for students and OSS maintainers
|
||||
|
||||
No separate charge - comes with Copilot subscription.
|
||||
|
||||
## Privacy & Security
|
||||
|
||||
### What Gets Sent
|
||||
- Your chat messages
|
||||
- Selected code snippets
|
||||
- Context from open files
|
||||
- Workspace information (limited)
|
||||
|
||||
### Best Practices
|
||||
- Don't paste sensitive data
|
||||
- Avoid customer information
|
||||
- Review organization policies
|
||||
- Use business plan for enterprise controls
|
||||
|
||||
## When to Use Copilot Chat
|
||||
|
||||
### ✓ Ideal For
|
||||
|
||||
- Learning AL and BC concepts
|
||||
- Understanding existing code
|
||||
- Debugging issues
|
||||
- Getting explanations
|
||||
- Generating complex code
|
||||
- Exploring patterns
|
||||
- Documentation creation
|
||||
|
||||
### ⚠ Consider Alternatives
|
||||
|
||||
- **Quick completions** → Use GitHub Copilot (inline)
|
||||
- **Very large context** → Use Claude
|
||||
- **Multi-file refactoring** → Use Cursor
|
||||
- **Critical decisions** → Consult humans
|
||||
|
||||
## Practical Workflow
|
||||
|
||||
**Daily Development**:
|
||||
1. Write code with Copilot inline suggestions
|
||||
2. Use Chat to explain complex parts
|
||||
3. Ask Chat for debugging help when stuck
|
||||
4. Generate tests with Chat
|
||||
5. Create documentation with Chat
|
||||
|
||||
**Learning**:
|
||||
1. Ask Chat about AL patterns
|
||||
2. Request examples
|
||||
3. Get explanations of BC concepts
|
||||
4. Explore APIs and features
|
||||
|
||||
**Code Review**:
|
||||
1. Select code section
|
||||
2. Ask Chat to review
|
||||
3. Get suggestions for improvements
|
||||
4. Learn better patterns
|
||||
|
||||
## Resources
|
||||
|
||||
### Official Documentation
|
||||
- [Copilot Chat Docs](https://docs.github.com/copilot/github-copilot-chat)
|
||||
- [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat)
|
||||
|
||||
### AL Guidelines Resources
|
||||
- [Effective Prompting](../../getting-started/effective-prompting)
|
||||
- [Best Practices](../../getting-started/best-practices)
|
||||
- [Getting More Examples](../../getting-more)
|
||||
|
||||
## Complementary Tools
|
||||
|
||||
**Use With**:
|
||||
- [GitHub Copilot](github-copilot-agent) - For inline completions
|
||||
- [AL Language Extension](../Tools/al-language) - For AL support
|
||||
- [AL Code Analyzers](../Tools/al-codecop) - For quality
|
||||
|
||||
**Workflow**:
|
||||
1. Copilot generates code quickly
|
||||
2. Chat explains what it does
|
||||
3. You understand and refine
|
||||
4. Analyzers validate quality
|
||||
|
||||
---
|
||||
|
||||
**Next Steps**:
|
||||
- Install [GitHub Copilot Chat](../Tools/github-copilot-chat)
|
||||
- Try with [GitHub Copilot](github-copilot-agent)
|
||||
- Compare with other [AI Agents](./)
|
||||
|
||||
**Questions?** Join [GitHub Discussions](https://github.com/microsoft/alguidelines/discussions)
|
||||
Loading…
Add table
Add a link
Reference in a new issue