Code InsightsCode Insights is a lightweight VS Code extension that helps you understand what common Python library functions actually do, directly inside the editor. Instead of switching to documentation, it provides inline explanations, behavioral notes, guided examples, and structured insights through hover tooltips and a side panel. This extension focuses on learning and correctness, not execution. In ActionHover InsightsQuick, contextual explanations appear directly when hovering over a supported function call.
Learn More SidebarDeeper, structured information is available in a persistent side panel.
What Problem Does This Solve?Many bugs, especially for learners, come from misunderstandings such as:
Official documentation often explains what a function does, but not always how it behaves in practice. Code Insights makes these behaviors visible at the point of use. Features (v0.4.0)Smarter Hover DetectionHover insights are shown only for supported function calls, not for strings, comments, or unrelated variable names. The extension resolves functions based on import context instead of simple word matching. NumPy Import AwarenessSupports common NumPy usage patterns, including:
This makes hovers more accurate and predictable. Method Call DetectionCode Insights understands method calls on inferred objects, such as:
The extension infers receiver type using simple assignment patterns such as Ambiguous cases are intentionally ignored to avoid misleading information. Python Built-in Insightsv0.4.0 expands beyond NumPy with curated insights for common Python behavior traps:
This helps explain the difference between returning a new value and mutating an existing object. Learn More SidebarClick Learn More to open a side panel with:
Guided Test TabThe Test tab now shows a static guided example for supported functions. Each guided test can include:
Code Insights does not run the code. The Test tab is designed to help you understand the behavior safely before trying it yourself. Ask AIThe Ask AI tab can explain the currently selected function using your configured AI provider. v0.4.0 supports:
Ask AI includes:
The extension reads API keys and model choices from Multiple keys can be provided as comma-separated fallbacks. If one key fails or hits a limit, Code Insights tries the next key. Example
To use Gemini instead:
InstallationInstall directly from the VS Code Marketplace by searching for Code Insights. Currently Supported FunctionsThis version focuses on a small, carefully curated set of NumPy and Python APIs:
Each function includes:
The data is defined using a structured JSON schema, making it easy to extend. How It Works
This keeps the extension fast, predictable, and safe to use in any project. LimitationsCode Insights is still an early-stage project. By design:
The extension aims to explain behavior, not replace documentation or debugging tools. Planned ImprovementsFuture versions may include:
These features are intentionally not part of v0.4.0. Project & BrandingCode Insights is developed under Lenex. Website: https://lenex.dev Project Links
StatusVersion: v0.4.0 Stage: Early development (guided static insights, learning + correctness focused) This release introduces Python built-in insights, broader resolver coverage, the guided Test tab, persistent local Ask AI chats for OpenAI/Gemini, and fixes packaged installs so bundled insight data is available from the Marketplace version. LicenseMIT License |

