MCPcopy Index your code
hub / github.com/Vanco/SequencePlugin

github.com/Vanco/SequencePlugin @v2.2.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.6 ↗ · + Follow
1,179 symbols 2,774 edges 120 files 106 documented · 9% updated 13mo agov3.0.0-alpha.1 · 2022-11-15★ 69626 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GitHub release JetBrains Plugins

SequenceDiagram

SequenceDiagram for IntelliJ IDEA https://vanco.github.io/SequencePlugin.

with this plugin, you can + generate Simple Sequence Diagram. + Navigate the code by click the diagram shape. + Delete Class from diagram. + Export the diagram as image(SVG, JPEG, PNG, TIFF). + Export the diagram as PlantUML, Mermaid format file. + Exclude classes from diagram by Settings > Tools > Sequence Diagram + Smart Interface(experimental) + Lambda Expression(experimental) + Kotlin Support(Experimental, No code navigation)

Experimental features

The experimental features created by myself, which is not part of UML standard. Use this feature in your own risk.

UAST support

UAST (Unified Abstract Syntax Tree) is an abstraction layer on the PSI of different programming languages targeting the JVM (Java Virtual Machine). It provides a unified API for working with common language elements like classes and method declarations, literal values, and control flow operators.

Which languages are supported? - Java: full support - Kotlin: full support - Scala: beta, but full support - Groovy: declarations only, method bodies not supported

Try to use UAST api to generate SequenceDiagram.

Smart Interface

Find the implementation of the interface smartly. e.g.

public interface Fruit {
    int eat();
}

public class Apple implements Fruit {
    @Override
    public int eat() {
        return 5;
    }
}

Apple implemented the Fruit interface. When we generate sequence diagram for the eatFruit method:

public class People {

    private Fruit fruit = new Apple();

    public void eatFruit() {
        fruit.eat();
    }
}

I draw dummy implementation call in dash line.

Smart Interface

For the interface or abstract class, if there is only one implementation found, it will draw in diagram automatically. More than one implementation, you need to choose one to draw. this is an option in settings.

Lambda Expression

No standard for the lambda expression in the sequence diagram yet. So I create mine. e.g.

public interface Service<Int, String> {

    String invoke(Int a);
}

I need draw the sequence diagram for hello method:

public class Lambda {

    public Service<Integer, String> hello() {
        return a -> {
            Fruit fruit = new Apple();
            fruit.eat();
            return "I'm good!";
        };
    }
}

I draw a dummy () -> self call in diagram.

Lambda Expression

Kotlin support

The Kotlin language support are in very early stage. - [x] Support generate topLevel function - [x] Support generate PrimaryConstructor and SecondaryConstructor - [x] Support generate Default Constructor Class - [x] Support generate JavaCall deeply - [ ] Support generate lambda argument - [ ] Support generate function with expression body - [x] Support generate class initializer - [ ] Code navigation

How to use

SequenceDiagram can generate sequence diagram from JAVA and Kotlin File.

When installed, where to find it?

Since v2.1.0, the UI has improved a lot. now you can easily find it everywhere :) 1. In navigation toolbar, A new ICON Sequence Diagram ...{:height="24px" width="24px"} added. 2. In Tools menu. Tools > Sequence Diagram 3. ~~In Project view popup up menu. Sequence Diagram ...~~ 4. In Editor popup up menu. Sequence Diagram 5. ~~In IntentionAction tips.Generate sequence diagram~~(removed, not stable) 6. Shortcut Alt S for windows, Option S for macOS 7. ~~Structure popup up menu Sequence Diagram~~

Please try to experience it and find what happen.

Have fun!

Version History

Current Version

GitHub release

versions history: Changelog

Acknowledgement

Name history

  • SequencePlugin Maintained by Kentaur(Kesh Sibilev, ksibilve@yahoo.com) until 2011
  • SequencePluginReload Maintained by Vanhg(Evan Fan, fanhuagang@gmail.com) 2011 - 2015
  • SequenceDiagram Maintained by Vanco(Evan Fan, fanhuagang@gmail.com) since 2016 new{:height="32px" width="32px"}

Why change name?

Since 2011, I found a solution of NPE of original SequencePlugin, so I write email to Kentaur with my solution, He said he was not coding anymore. Instead, he sent me the code. I fix the NPE issue and publish to plugin repository with new name SequencePluginReload.

In 2015, the IntelliJ change the login system, and I lost my account, cannot continue to publish new version to the repository.

In 2016, I change the Name again to SequenceDiagram and host the source code on github. Now it is open source.

Thanks Kentaur for the great work on the original source.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 1,010
Class 148
Interface 14
Function 7

Languages

Java98%
Kotlin2%

Modules by API surface

src/main/java/vanstudio/sequence/ui/PlasticTabbedPaneUI.java155 symbols
src/main/java/vanstudio/sequence/SequencePanel.java66 symbols
src/main/java/vanstudio/sequence/diagram/Display.java41 symbols
src/main/java/vanstudio/sequence/config/SequenceSettingsComponent.java39 symbols
src/main/java/vanstudio/sequence/ui/MyButtonlessScrollBarUI.java38 symbols
src/main/java/vanstudio/sequence/diagram/Parser.java36 symbols
src/main/java/vanstudio/sequence/diagram/DisplayObject.java36 symbols
src/main/java/vanstudio/sequence/generator/SequenceGenerator.java29 symbols
src/main/java/vanstudio/sequence/util/MyPsiUtil.java27 symbols
src/main/java/vanstudio/sequence/diagram/DisplayLink.java27 symbols
src/main/java/vanstudio/sequence/ext/kotlin/KtSequenceGenerator.java24 symbols
src/main/java/vanstudio/sequence/diagram/MethodInfo.java20 symbols

For agents

$ claude mcp add SequencePlugin \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page