MCPcopy Create free account
hub / github.com/chhoumann/quickadd / executeWithFocusedProperty

Method executeWithFocusedProperty

src/choiceExecutor.ts:162–180  ·  view source on GitHub ↗
(
		choice: IChoice,
		focusedProperty: FrontmatterPropertyTarget | null,
		triggerContext?: QuickAddTriggerContext | null,
	)

Source from the content-addressed store, hash-verified

160 }
161
162 async executeWithFocusedProperty(
163 choice: IChoice,
164 focusedProperty: FrontmatterPropertyTarget | null,
165 triggerContext?: QuickAddTriggerContext | null,
166 ): Promise<void> {
167 const previousFocusedOverride = this.focusedPropertyOverride;
168 const previousTriggerOverride = this.triggerContextOverride;
169 this.focusedPropertyOverride = focusedProperty;
170 // `triggerContext` is `undefined` only when the caller didn't capture one;
171 // leave the override unset so the executor reads it live. A captured value
172 // (including `null` for "no active note at trigger time") IS injected.
173 this.triggerContextOverride = triggerContext;
174 try {
175 await this.execute(choice);
176 } finally {
177 this.focusedPropertyOverride = previousFocusedOverride;
178 this.triggerContextOverride = previousTriggerOverride;
179 }
180 }
181
182 /**
183 * Executes a Template or Capture choice and returns a structured

Callers

nothing calls this directly

Calls 1

executeMethod · 0.95

Tested by

no test coverage detected