MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / useLocator

Function useLocator

packages/debugger/src/locator/index.ts:190–200  ·  view source on GitHub ↗

* User function to enable user locator features. Such as element hover and go to source. * * Can bu used only once. * * @param options LocatorOptions for the locator.

(options: locator.LocatorOptions)

Source from the content-addressed store, hash-verified

188 * @param options {@link LocatorOptions} for the locator.
189 */
190 function useLocator(options: locator.LocatorOptions): void {
191 s.runWithOwner(owner, () => {
192 if (locatorUsed) return warn('useLocator can be called only once.')
193 locatorUsed = true
194 if (options.targetIDE) target_ide = options.targetIDE
195 if (options.key !== false) {
196 const isHoldingKey = createKeyHold(options.key ?? 'Alt', {preventDefault: true})
197 setEnabledByPressingSignal(() => isHoldingKey)
198 }
199 })
200 }
201
202 // Enable the locator when the options were passed by the vite plugin
203 let locator_options = SolidAPI.get_locator_options()

Callers 1

createLocatorFunction · 0.70

Calls 1

warnFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…