This extension surpasses Copilot by delivering precise, type-aware suggestions through deep Abstract Syntax Tree (AST) analysis, explicit type extraction, and recursive examination of relevant types and headers. This ensures contextually accurate and customizable code completions, tailored to your specific project and codebase.
Run the following command.
code --install-extension llmcompletion-0.1.0.vsix
Open Visual Studio Code and check that the extension is properly loaded.
Navigate to credentials.json and input your API key.
Press Cmd + Shift + P (macOS) or Ctrl + Shift + P (Windows/Linux).
Type reset API key
and select the command to reset your key.
Press Cmd + Shift + P (macOS) or Ctrl + Shift + P (Windows/Linux).
Type Preferences: Open Keyboard Shortcuts and select it.
Search for extension.fetchCompletion
.
Double-click the command and set your preferred key combination.
-
Hole Information Definition: A placeholder in the code, typically denoted as _(), _, or ??, marking incomplete parts of the code. Purpose: Using language servers to analyze the AST, the specific node containing the hole is identified, along with its enclosing statement and type annotation. Use: Facilitates type inference and ensures accurate code completion.
-
Relevant Types Definition: All types related to the hole, including its components and subcomponents. Purpose: Recursively extracts types down to primitive types, storing them in a type map. Use: Provides a comprehensive type context for code completion.
-
Relevant Headers Definition: Headers with types consistent with those derived from the hole. Purpose: Uses type normalization to identify headers that match the hole’s type. Use: Supplies relevant code snippets to enhance the accuracy and contextual relevance of completions.