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-import — editor_session/2 now imports the module's own functions at session creation time.
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. Typingchangesetshows no completions; after evaluating anything (Do It),changeset/2appears.Cause
The module coder uses
GtBridge.Analysis.editor_session/2to 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 viaGtElixirCoderModel >> wrapSource:withSelf:which prependsimport Module.Fix
When the snippet's self object is set (
LeElixirSnippetViewModel >> inspectorSelfObject:), trigger aneditor_sessioncall 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-import—editor_session/2now imports the module's own functions at session creation time.