# deaglegross/sharpcoachplugin architecture

> Architecture diagram of the GitHub repository deaglegross/sharpcoachplugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deaglegross/sharpcoachplugin
- Repository: https://github.com/deaglegross/sharpcoachplugin

## Overview

Based on our analysis of the file tree and the README, this project is a JetBrains plugin—namely, the “SharpCoachPlugin” for Rider and ReSharper. Its purpose is to provide features to “generate Mapping code from type A to type B,” among possibly other enhancements to C# development in the JetBrains ecosystem. The solution is multi-faceted as it uses both .NET (C#) and Kotlin code depending on the target IDE (ReSharper and Rider, respectively).

##### Project type and purpose
- This is a JetBrains IDE plugin built to improve C# development.
- It supports two platforms: one for ReSharper (typically .NET-based) and one for Rider (using Kotlin). The README clearly emphasizes plugin compatibility and versioning strategies for various Rider builds.
- The project also contains sample projects (“plugin_sample_projects”) and protocol definitions (in the “protocol” folder) that underline how plugin functionalities are exposed or tested.

##### File structure
- Notice top-level directories like “src/dotnet” for all the .NET code including core components, UI, tests, and “src/rider” for the rider-specific Kotlin parts.
- The “src/dotnet/ReSharperPlugin.SharpCoachPlugin.Core” contains detailed architectural layers such as:
– Builders (e.g., MappingCodeBuilder.cs)
– Components (e.g., MappingResultsStorage.cs)
– Helpers and TypeHelpers (for business logic on type mapping)
– Providers (both for C# element information and specific functionality)
– Models for mapping operation results and type definitions
- There is a separate “src/dotnet/ReSharperPlugin.SharpCoachPlugin.Ui” for the plugin’s UI pages and tool windows.
- The integration of Kotlin code under “src/rider” (i.e. plugin.xml configuration in resources and Kotlin actions/options) shows the Rider-specific implementation.
- Apart from the main code, you have supporting materials such as tests (under “src/dotnet/ReSharperPlugin.SharpCoachPlugin.Tests”), sample projects, build scripts (build.gradle, gradlew, publishing scripts), Gradle wrapper, and configuration files.

##### README for additional insights
- The README highlights build/publish commands, versioning strategies, and supported build numbers/ProductVersions. This indicates modularity and multi-branch versioning.
- It also directs attention to the “Mapping” feature documentation, hinting at detailed internal mapping logic that should be separately visualized.

##### Final advice
- Every major folder or module (i.e., Core, UI, Tests, Rider, Protocol, and Build tools) is represented.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Components
    subgraph "UI Components"
        UI_RS["UI - ReSharper (.NET)"]:::ui
        UI_Rider["UI - Rider (Kotlin)"]:::ui
        
        subgraph "ReSharper UI Details"
            UI_RS_Page["CoachSharpOptionsPage.cs"]:::ui
            UI_RS_Tool["MapModelsLogsToolWindowUI.cs"]:::ui
        end
        
        subgraph "Rider UI Details"
            UI_Rider_Action["MapModelsAction.kt"]:::ui
            UI_Rider_Opt["CoachSharpOptionsPage.kt"]:::ui
            UI_Rider_Conf["plugin.xml"]:::ui
        end
    end

    %% Core Components
    subgraph "Core Components"
        Core_Main["Plugin Core (Business Logic)"]:::core
        subgraph "Core Subcomponents"
            Core_Builder["MappingCodeBuilder.cs"]:::core
            Core_Component["MappingResultsStorage.cs"]:::core
            Core_Processor["ClassesMappingProcessor.cs"]:::core
            Core_Provider["CaretProvider.cs"]:::core
        end
    end

    %% Supporting Components
    subgraph "Supporting Components"
        Tests["Tests Suite"]:::test
        Samples["Sample Projects"]:::sample
        Protocol["Protocol/Kotlin Integration"]:::protocol
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        Build_Script["build.gradle & Publishing Scripts"]:::build
        Gradle_Wrapper["Gradle Wrapper (gradlew etc.)"]:::build
    end

    %% Final Deployment Artifact
    Deployment["Plugin Deployment Artifact"]:::build

    %% Connections: UI to Core
    UI_RS -->|"triggers"| Core_Main
    UI_Rider -->|"triggers"| Core_Main
    UI_RS_Page -->|"part of"| UI_RS
    UI_RS_Tool -->|"part of"| UI_RS
    UI_Rider_Action -->|"part of"| UI_Rider
    UI_Rider_Opt -->|"part of"| UI_Rider
    UI_Rider_Conf -->|"configures"| UI_Rider

    %% Connections: Core Subcomponents
    Core_Main -->|"utilizes"| Core_Builder
    Core_Main -->|"utilizes"| Core_Component
    Core_Main -->|"utilizes"| Core_Processor
    Core_Main -->|"utilizes"| Core_Provider

    %% Connections: Core to Supporting Components
    Core_Main -->|"process results"| Tests
    Core_Main -->|"demonstrated by"| Samples
    Core_Main -->|"defines protocol for"| Protocol

    %% Connections: Build & Deployment Flow
    Core_Main -->|"build input"| Build_Script
    Tests -->|"verification"| Build_Script
    Samples -->|"integration"| Build_Script
    Protocol -->|"integration"| Build_Script
    Build_Script --> Deployment
    Gradle_Wrapper --> Deployment

    %% Styles and Classes
    classDef core fill:#F9E79F,stroke:#D4AC0D,stroke-width:2px;
    classDef ui fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef test fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef build fill:#ABEBC6,stroke:#27AE60,stroke-width:2px;
    classDef sample fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef protocol fill:#FAD7A0,stroke:#D68910,stroke-width:2px;

    %% Click Events
    click Core_Main "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Core"
    click UI_RS "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Ui"
    click UI_RS_Page "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Ui/Pages/CoachSharpOptionsPage.cs"
    click UI_RS_Tool "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Ui/ToolWindows/MapModelsLogsToolWindowUI.cs"
    click UI_Rider "https://github.com/deaglegross/sharpcoachplugin/tree/main/src/rider/main/kotlin/com/jetbrains/rider/plugins/coachsharp"
    click UI_Rider_Action "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/rider/main/kotlin/com/jetbrains/rider/plugins/coachsharp/actions/MapModelsAction.kt"
    click UI_Rider_Opt "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/rider/main/kotlin/com/jetbrains/rider/plugins/coachsharp/options/CoachSharpOptionsPage.kt"
    click UI_Rider_Conf "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/rider/main/resources/META-INF/plugin.xml"
    click Core_Builder "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Core/Builders/MappingCodeBuilder.cs"
    click Core_Component "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Core/Components/MappingResultsStorage.cs"
    click Core_Processor "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Core/Processors/ClassesMappingProcessor.cs"
    click Core_Provider "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Core/Providers/CaretProvider.cs"
    click Tests "https://github.com/deaglegross/sharpcoachplugin/blob/main/src/dotnet/ReSharperPlugin.SharpCoachPlugin.Tests"
    click Samples "https://github.com/deaglegross/sharpcoachplugin/tree/main/plugin_sample_projects/mapping"
    click Protocol "https://github.com/deaglegross/sharpcoachplugin/blob/main/protocol/src/main/kotlin/model/rider/SharpCoachPluginModel.kt"
    click Build_Script "https://github.com/deaglegross/sharpcoachplugin/blob/main/build.gradle"
    click Gradle_Wrapper "https://github.com/deaglegross/sharpcoachplugin/tree/main/gradlew"
```
