-
Notifications
You must be signed in to change notification settings - Fork 417
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
IntelliJ plugin #747
Comments
I'd like to take a look at this. But from what I understand, IntelliJ plugins have to be developed in Java? What's the preferred way of interacting with d2lang from a different language? |
It'll have to be calling the executable, I'm pretty sure. Google shows some results for calling Go from Java, but I suspect it'll be a lot of work. |
|
|
I meant something like implementing the language server protocol (LSP): https://microsoft.github.io/language-server-protocol/. From what I understand it uses JSON-RPC for communicating locally between a language server (d2) and a client (e.g. VSCode, IntelliJ, Confluence or whatever). |
yeah we have a long-standing task to kick off that project (#104). Not prioritized currently though. From what I understand (and it's not much, regarding this topic), an LSP is just adding additional features though right? Being able to syntax highlight, autoformat, display compiler errors on line numbers, these would compose a very usable plugin and don't benefit from an LSP |
Ah my bad, I've never done anything with LSP myself. But the possibility still stands, some sort of diagram server protocol that uses a similar protocol to compile diagrams maybe? Too complicated? |
i think the one place structured data would be helpful is for compilation errors: which line is the error at? Currently, https://play.d2lang.com just parses the strings: https://github.com/terrastruct/d2-playground/blob/master/src/js/modules/editor.js#L302 It'd be annoying to implement for all languages that want to integrate with it for sure, but, not too bad as you can see from the code, so I'd say it's acceptable for now until LSP project is underway. |
I'm really late to this but yes, Java annoyingly. A few plugins eg: tfsec and trivy just use the command line operator to render it. Easiest way imo is to make use of the inbuilt intellij browser and just render what ever there. Happy to test and provide feedback, sadly I know no programming languages :( |
Is there a roadmap or progress update available for this issue? While Visual Studio Code has a D2 extension, there doesn't seem to be a plugin for D2 in the JetBrains plugin market. |
There is not. Just limited bandwidth and so much to do still for D2. The VSCode extension took a lot of effort, and even then, it would've fallen behind in maintenance if it weren't for someone in the community helping out. |
The D2 for IntelliJ Platform based IDEs will be available in 1-2 weeks. The D2 IntelliJ plugin will primarily focus on the editor features, and not on the preview (that is handled by D2 studio). However, a preview is provided through an embedded browser (JBCEF) for a server created by D2 Disclaimer: I am acting as an open-source developer, not on behalf of JetBrains :) The preview support for D2 files, as part of the Writerside plugin, is already completed. A new version of the Writerside plugin will be released around January 15th. |
Could you please assist me in finding the official and free-to-use D2 logo assets? In particular, I need a plugin logo icon that like the one available here: https://github.com/terrastruct/d2-vscode/blob/master/d2-icon.png but in SVG format instead of PNG. |
Oh good point will put up a page for design assets. Ty. |
The D2 plugin for IntelliJ is available in the marketplace. LightDark (yes, we should instruct D2 to use a dark theme :)Known issues:
|
Hey,
Fond of this project, was wondering if you have in your project road map to develop a plugin for IntelliJ?
-b
The text was updated successfully, but these errors were encountered: