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

Error in Diagram Synthesis #166

Closed
jjrev opened this issue Jan 24, 2024 · 3 comments
Closed

Error in Diagram Synthesis #166

jjrev opened this issue Jan 24, 2024 · 3 comments

Comments

@jjrev
Copy link

jjrev commented Jan 24, 2024

On a Windows 11 system with JDK 17 installed, I see the following error in VSCode when trying to display the diagram for *.lf source files:

An exception occurred during diagram synthesis\
java.nio.file.InvalidPathException: Illegal character [:] in path at index 4: \\\c:\Users\xxxxxxxx\Development\lingua-franca\test\C\src\Deadline.lf
\
    at java.base/sun.nio.fs.WindowsPathParser.nextSlash(WindowsPathParser.java:212)
\
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:111)
\
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
\
    at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
\
    at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
\
    at java.base/java.nio.file.Path.of(Path.java:147)
\
    at org.lflang.generator.CodeMap$Correspondence.tag(CodeMap.java:144)
\
    at org.lflang.ast.ASTUtils.toText(ASTUtils.java:693)
\
    at org.lflang.generator.ReactionInstance.<init>(ReactionInstance.java:70)
\
    at org.lflang.generator.ReactorInstance.createReactionInstances(ReactorInstance.java:758)
\
    at org.lflang.generator.ReactorInstance.<init>(ReactorInstance.java:902)
\
    at org.lflang.generator.ReactorInstance.<init>(ReactorInstance.java:882)
\
    at org.lflang.generator.ReactorInstance.<init>(ReactorInstance.java:105)
\
    at org.lflang.diagram.synthesis.LinguaFrancaSynthesis.transform(LinguaFrancaSynthesis.java:322)
\
    at org.lflang.diagram.synthesis.LinguaFrancaSynthesis.transform(LinguaFrancaSynthesis.java:144)
\
    at de.cau.cs.kieler.klighd.syntheses.AbstractDiagramSynthesis.transform(AbstractDiagramSynthesis.java:220)
\
    at de.cau.cs.kieler.klighd.syntheses.ReinitializingDiagramSynthesisProxy.transform(ReinitializingDiagramSynthesisProxy.java:289)
\
    at de.cau.cs.kieler.klighd.ViewContext.update(ViewContext.java:454)
\
    at de.cau.cs.kieler.klighd.ViewContext.update(ViewContext.java:389)
\
    at de.cau.cs.kieler.klighd.ViewContext.update(ViewContext.java:346)
\
    at de.cau.cs.kieler.klighd.lsp.KGraphDiagramUpdater.lambda$6(KGraphDiagramUpdater.java:267)
\
    at de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer.lambda$1(AbstractLanguageServer.java:117)
\
    at de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer.configureAndRun(AbstractLanguageServer.java:96)
\
    at org.lflang.diagram.lsp.LanguageDiagramServer.start(LanguageDiagramServer.java:111)
\
    at org.lflang.diagram.lsp.LanguageDiagramServer.main(LanguageDiagramServer.java:107)

Google searches indicate there is something improper with how the Path is handled. I suspect the triple backslash in the beginning of the Path is where things are going awry but not sure where that prefix is coming from.

@NiklasRentzCAU
Copy link
Member

As the relevant parts of the stack trace point to the LF Synthesis and some internal LF generator code I would like to ask @a-sr if he knows anything about this. In Windows 10 we never heard about such a problem, but I will try to reproduce this on a Windows 11 machine soon when I have access to one.
Does this happen for any model or just a specific one?

@jjrev
Copy link
Author

jjrev commented Jan 24, 2024

It happens for all the models I've tried (multiple *.lf files for C and Python languages).

@a-sr
Copy link
Member

a-sr commented Jan 25, 2024

It looks like a problem with the ASTUtils, which is used in both the code generation and the diagram synthesis. Yet, sometimes the methods are not written with both contexts in mind, causing errors in the diagram generation (e.g. lf-lang/lingua-franca#1930).

@jjrev Could you please open an issue in the LF repo for this problem.

I will close this issue since it is not related to klighd-vscode.

@a-sr a-sr closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants