Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 bugs in the SequenceDiagram JS plugin #182

Open
muzilijekyll opened this issue Nov 14, 2024 · 4 comments
Open

2 bugs in the SequenceDiagram JS plugin #182

muzilijekyll opened this issue Nov 14, 2024 · 4 comments
Assignees
Labels

Comments

@muzilijekyll
Copy link

Describe the bug

  1. When I open a saved .sdt file, the plugin shows "Open success! Method source not found, the navigation is disabled.".

  2. When the js file name ends with .old.js, the plugin displays the file name as "old".

    截屏2024-11-14 13 01 21

Plugin & IDE info:

  • Plugin Version : SequenceDiagram Core 4.0.3, SequenceDiagram JS 4.0.3
  • IDE Name & Version : IntelliJ IDEA 2024.2.4 (Ultimate Edition)
  • Language : javascript (Flow JS)
@Vanco Vanco self-assigned this Nov 15, 2024
@Vanco
Copy link
Owner

Vanco commented Nov 15, 2024

  1. When I open a saved .sdt file, the plugin shows "Open success! Method source not found, the navigation is disabled.".

A: When open a saved .sdt file, SequenceDiagram Core (plugin) try to find the root function in project source file. when it found null, (not foud), the messge "Open success! Method source not found, the navigation is disabled." are shows. this means, you can open and display the diagram, but no navigation function will work. That is how it's designed.

the opening file is designed for two scenarios:

  1. if the .sdt file opened when it orign js file exist in the current project. it will be found and opened with full navigation features.
  2. otherwise, the .sdt file's orign js file does not include in the project. e.g. it generate by others. It will opened with limited fuctions.
  1. When the js file name ends with .old.js, the plugin displays the file name as "old".

A: If the filename include "." in it. it will display last part in the whole name. same as class qualifiedName. This may change in next release.

@muzilijekyll
Copy link
Author

  1. if the .sdt file opened when it orign js file exist in the current project. it will be found and opened with full navigation features.

I'm sure it orign js file exist in the current project.

This problem is very easy to reproduce. Create a Vite project in IDEA with the following contents.

src/main.ts

import {a} from "./a"

function main() {
    a()
}

src/a.ts

import {b} from "./b"

export function a() {
    b()
}

src/b.ts

import {c} from "./c"

export function b() {
    c()
}

src/c.ts

export function c() {

}

Right-click on the function main, select SequenceDiagram, and save the .sdt file to the current project.

Open it.

@Vanco
Copy link
Owner

Vanco commented Nov 15, 2024

Nice and detailed example! it will help a lot. Thanks.

@Vanco Vanco added the bug label Nov 15, 2024
@Vanco
Copy link
Owner

Vanco commented Nov 16, 2024

I test for your example. the result is fine.

Open success! The call link may out of date. Regenerate to fix navigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants