How keyboardsamurai/source-clipboard-export-intellij-plugin works
Project type and purpose
• This is an IntelliJ IDEA plugin, “Export Source to Clipboard,” written in Kotlin.
• Purpose: let users select files or folders in the IDE, then package source code (respecting .gitignore and size limits), fold stack traces, estimate token counts, and copy the result to the clipboard for AI‐assisted workflows or sharing.
File structure
• Top level
· build.gradle.kts, gradle wrapper, settings.gradle.kts → Kotlin/Gradle build setup
· src/main/resources/META-INF/plugin.xml → registers extension points & actions with IntelliJ
• src/main/kotlin/com/keyboardsamurais/intellij/plugin/sourceclipboardexport
· actions/ → IntelliJ Action classes (DumpFolderContentsAction, FoldAndCopyStackTraceAction, ToggleFiltersAction)
· config/ → Settings UI and persistent storage (SourceClipboardExportConfigurable, SourceClipboardExportSettings, UI controls)
· core/ → Business logic (SourceExporter, RepositorySummary, StackTraceFolder) and .gitignore parsing (GitignoreParser, HierarchicalGitignoreParser)
· util/ → Helpers for constants, file I/O, notifications, string ops
• src/test mirrors the structure with unit tests for core and util modules.
README insights
• Plugin integrates via right-click context menu and Settings → Tools
• Core features: smart directory traversal, gitignore‐aware filtering, token count estimation, stack-trace folding, user notifications
• Emphasizes seamless IntelliJ integration (notifications, clipboard API, settings dialog)
Final pointers
• Be exhaustive but avoid clutter: group classes logically.
• Extension points, service dependencies, and I/O boundaries.