Overview
When a procedure is declared in a MAP or a CLASS interface, the implementation body doesn't exist yet. The extension already knows the full signature, parameter types, return type, CLASS hierarchy, and surrounding scope. This is ideal context for AI-powered stub generation — producing a skeleton implementation that the developer can fill in.
Example
Given a MAP declaration:
KanbanProcess_Kanban PROCEDURE(KanbanWrapperClass pKanban)
Generate:
ThisWindow.KanbanProcess_Kanban PROCEDURE(KanbanWrapperClass pKanban)
CODE
! TODO: Implement KanbanProcess_Kanban
RETURN
Or for a CLASS with an interface, generate all required method stubs at once.
Why the Clarion Extension Is Well-Positioned
The LSP already has everything needed as AI context:
- Full procedure signature (parameters, return type, attributes like PROC, VIRTUAL, DERIVED)
- CLASS hierarchy — knows which interface methods are required
- Surrounding scope — knows what variables/types are in play
DocumentStructure scope tree — knows where the implementation section should go
SolutionManager — knows the full project structure
This makes AI generation significantly more accurate than generic Copilot completions, which have no Clarion-specific knowledge.
Use Cases
- MAP procedure stub — declare in MAP, generate implementation body in the CODE section
- CLASS interface stub — declare a CLASS that implements an interface, generate all required method stubs at once
- Signature-driven generation — infer likely body from procedure name + parameter types + return type
Implementation Approaches
These are not mutually exclusive:
- VS Code Chat Participant (
@clarion) — user asks @clarion generate stubs for ThisWindow and the participant uses LSP knowledge to produce them
- VS Code Language Model Tool — extension registers a
clarion_generateStub tool that Copilot can call during inline completions
- Code Action — a lightbulb/quick-fix on a MAP declaration that offers "Generate implementation stub"
The Code Action approach is the most discoverable and requires no separate AI integration — it could use the VS Code LM API (vscode.lm.selectChatModels) to call the model with the signature as context.
Relationship to Other Issues
Overview
When a procedure is declared in a MAP or a CLASS interface, the implementation body doesn't exist yet. The extension already knows the full signature, parameter types, return type, CLASS hierarchy, and surrounding scope. This is ideal context for AI-powered stub generation — producing a skeleton implementation that the developer can fill in.
Example
Given a MAP declaration:
Generate:
Or for a CLASS with an interface, generate all required method stubs at once.
Why the Clarion Extension Is Well-Positioned
The LSP already has everything needed as AI context:
DocumentStructurescope tree — knows where the implementation section should goSolutionManager— knows the full project structureThis makes AI generation significantly more accurate than generic Copilot completions, which have no Clarion-specific knowledge.
Use Cases
Implementation Approaches
These are not mutually exclusive:
@clarion) — user asks@clarion generate stubs for ThisWindowand the participant uses LSP knowledge to produce themclarion_generateStubtool that Copilot can call during inline completionsThe Code Action approach is the most discoverable and requires no separate AI integration — it could use the VS Code LM API (
vscode.lm.selectChatModels) to call the model with the signature as context.Relationship to Other Issues
MemberLocatorService,SymbolFinderService)