Skip to content

Lepiter snippet completions don't include module imports until first eval #37

Description

@mariari

Problem

The Lepiter snippet at the bottom of the inspector (pre-bound to self) doesn't have module imports loaded for completions until after the first evaluation. Typing changeset shows no completions; after evaluating anything (Do It), changeset/2 appears.

Cause

The module coder uses GtBridge.Analysis.editor_session/2 to preload imports into the eval session env. The Lepiter snippet uses a different session that starts with an empty env. Imports are only added at eval time via GtElixirCoderModel >> wrapSource:withSelf: which prepends import Module.

Fix

When the snippet's self object is set (LeElixirSnippetViewModel >> inspectorSelfObject:), trigger an editor_session call for the self object's module to preload the session env. This requires knowing the session ID at self-object-set time, which touches the Lepiter snippet lifecycle.

Related

Fixed for module coders in mariari/editor-session-self-importeditor_session/2 now imports the module's own functions at session creation time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions