Skip to content

coreywaldon/synapse-plugin

Repository files navigation

Synapse Navigator

IntelliJ plugin that provides traceability tooling for the SynapseLib architecture library.

Navigate between producers and consumers, visualize interceptor chains, and catch unconnected channels at a glance.

Features

Gutter Navigation

Clickable gutter icons appear next to every SynapseLib call site. Click an icon to see all connected counterparts and interceptors in a popup, then jump directly to any target.

Channel Producer Consumer
State Broadcast<T> ListenFor<T>
Reaction Trigger<A> ReactTo<A>
Request Request<Impulse, Need> @SynapseProvider

Interceptors (Intercept<T>) also receive gutter icons showing their affected targets, direction, and priority.

A Type Declaration marker appears on data classes and classes used as channel types, summarizing all connected hooks at a glance.

Interceptor Tool Window

A bottom panel (View > Tool Windows > SynapseLib) with three tabs:

  • Type Map — Lists all SynapseLib types with hook counts per type. Expand to see broadcasts, listeners, triggers, reactors, requesters, providers, and interceptors.
  • Flow Map — Shows the full wiring of each channel: broadcasters to listeners, triggers to reactors, requesters to providers (with return types).
  • Interceptors — Groups all interceptors by type argument, showing kind, channel, direction, and priority.

All tabs support search filtering and double-click navigation. A status bar displays total hook and file counts.

Mermaid Export

Click Export as Mermaid in the tool window to copy a topology diagram to the clipboard. The diagram uses subgraphs for Sources, Consumers, Coordinators, and Providers, with channel-specific edge styles (solid for State, dotted for Reaction, double for Request). Unconnected nodes are marked with a warning.

Inspections and Quick Fixes

An Unconnected SynapseLib channel inspection (enabled by default, warning level) highlights:

  • Broadcast<T> with no ListenFor<T> listeners
  • ListenFor<T> with no Broadcast<T> sources
  • Trigger<A> with no ReactTo<A> reactors
  • ReactTo<A> with no Trigger<A> sources
  • Request with no matching @SynapseProvider
  • @SynapseProvider with no Request calls

A Generate Counterpart quick fix inserts a TODO stub for the missing half of the channel.

Find Usages

Standard Find Usages (Ctrl+Click) is extended for types used as SynapseLib channel arguments. Results include all Broadcast, ListenFor, Trigger, ReactTo, Request, @SynapseProvider, and Intercept call sites for that type, alongside normal code references.

Code Completion

Inside type argument brackets (e.g. ListenFor<|>), the plugin offers prioritized suggestions:

  1. Counterpart types (bold) — types that already have a matching producer or consumer, with detail like "2 listeners in TaskList, Dialogs"
  2. Same-channel types — other types used in the same function group
  3. All known SynapseLib types

Quick Documentation

Hover or press Ctrl+Q on a SynapseLib function name or type argument to see:

  • Channel type and role (producer, consumer, requester, interceptor)
  • Connection stats: broadcaster/listener counts, trigger/reactor counts, provider return types
  • Interceptor list with direction, priority, and location

Inlay Hints

Inline annotations appear after SynapseLib calls showing counterpart counts:

Broadcast<TaskUpdated>(data)  3 listeners
ListenFor<TaskUpdated> { }    2 sources
Trigger<SortChanged>(event)   1 reactor
Request<FetchTasks, List>     TaskListProvider → List<Task>
Intercept<Any>(...)           12 targets (3↑ 4↓ 1↕)

Unconnected calls show a warning: ⚠ no listeners.

Incremental Auto-Refresh

After an initial Build Map scan, the cache tracks file changes and triggers incremental rescans after a configurable debounce. Scanning is scoped to modules with SynapseLib on the classpath.

Settings

Settings > Tools > SynapseLib provides:

  • Function name aliases — add comma-separated aliases for each SynapseLib function (Broadcast, ListenFor, Trigger, ReactTo, Request, Intercept) to support custom wrapper names
  • Staleness debounce (ms) — delay before marking the cache out-of-date (default 500ms)
  • Auto-refresh on file changes — toggle automatic incremental scanning

Compatibility

  • IntelliJ IDEA 2024.2 – 2025.3 (builds 242–253.*)
  • Requires the Kotlin plugin (bundled)
  • JVM toolchain: 17

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages