Code-GUI bidirectional editing via LSP
51–60 of 71 posts
Re: Code-GUI bidirectional editing via LSP
#52Hey nice - this stuff is so much fun to me. I've worked a number of experiments like this too, especially related to live coding. Love seeing it in the wild. I built a small project where you can live-code Love2D. The running program updates in real time (no saving needed) and see all values update in real-time, via LSP. https://github.com/jasonjmcghee/livelove And also added the same kind of interactivity like a num…
This looks like it could be a great way to get my feet wet - I don’t do well with math and physics programming, but I used to make things in Flash back in the day that were similar to the particles demo and being able to quickly change things and see the updates makes it a lot easier for me to grok. Thanks for sharing!
Re: Code-GUI bidirectional editing via LSP
#53Earlier quoted context omitted.
I don't think they change programs very often, and only very rarely in the middle of a project.
I think this maybe why! Of course it’s great for vendor lock-in. But given how many companies need to work with diverse suppliers, there must be a whole bunch of re-creating models happening. There is no chance that everybody is using the same CAD tool
[1] https://en.wikipedia.org/wiki/Airbus_A380#Production_and_del...
Re: Code-GUI bidirectional editing via LSP
#54For Slint [ https://slint.dev ], a (native) GUI Toolkit, I've also developed a LSP server that do live preview and editing. You can try it online at https://slintpad.com : if you click on the toolbar button to enable the right panel, you can edit the properties from the UI, and this is all done through the LSP and can be integrated in any editor that supports it.
cool! how does this work? e.g. how do you know which UI element matches which text element, do you track it while rendering? How do you propagate changes in the UI? do you update the text and then re-render the whole UI?
Every time the users do some change in the code, the editor sends the document and we re-render the preview.
I use the textDocument/documentHighlight request to know when elements are being selected from the code so I can highlight them in the preview.
When selecting an element in the preview UI, my LSP server sends a window/showDocument to position the cursor at the right location. And if the user changes property or do change in the file, we do a workspace/applyEdit command with the changes.
Btw, the code is there: https://github.com/slint-ui/slint/tree/master/tools/lsp
Re: Code-GUI bidirectional editing via LSP
#55Hey nice - this stuff is so much fun to me. I've worked a number of experiments like this too, especially related to live coding. Love seeing it in the wild. I built a small project where you can live-code Love2D. The running program updates in real time (no saving needed) and see all values update in real-time, via LSP. https://github.com/jasonjmcghee/livelove And also added the same kind of interactivity like a num…
Isn't autocad lisp powered?
Re: Code-GUI bidirectional editing via LSP
#56See https://new.rt.ht for bidi i⇄o sync demos! The PDF ones are especially fun! The whole playground is built for bidi sync!
Wait, what is this?! It's really cool
Re: Code-GUI bidirectional editing via LSP
#57Re: Code-GUI bidirectional editing via LSP
#58Re: Code-GUI bidirectional editing via LSP
#59Reminds me of the excitement I got on seeing https://www.youtube.com/watch?v=4tyTgyzUJqM . I still get excited about trying something like this again pretty much every time I see it. Have yet to really get any traction on anything. :( A lot of folks had fun watching Minecraft built using a live code session, if I recall.
Re: Code-GUI bidirectional editing via LSP
#60Reminds me of the excitement I got on seeing https://www.youtube.com/watch?v=4tyTgyzUJqM . I still get excited about trying something like this again pretty much every time I see it. Have yet to really get any traction on anything. :( A lot of folks had fun watching Minecraft built using a live code session, if I recall.
Hot reload in Java is still a crucial part of my workflow for modding Minecraft, but it doesn't have the other direction where an action in the game could alter the code