The frontend uses Druid for the GUI of Lapce. Druid is a data first GUI framework. And all the state and logic are in
lapce-datasub crate, e.g., file buffers, editor tabs, cursor, etc. The UI widgets tree, layout, and rendering logic are in
lapce-uisub crate, including all the UI related stuff, e.g., keyboard and mouse events, file dialogs, context menus etc.
lapce-proxysub crate provides the interface between the frontend, and the file system, plugins and lsp servers, so Lapce talks to files, plugins, lsp servers through the proxy. The reason for that is to provide the ability for remote development. In remote development mode, the
lapce-proxybinary runs in the remote box, so that it can read files in the remote box, and the plugins and lsp servers can run in the remote box to utilise the power of the remote box.
Here is the flow of a typical file editing process. When you open a file in the GUI,
lapce-proxywhich reads the file from local disk and responds with the content of the file.
lapce-datastores the file content locally. When
lapce-uireceives a keyboard event, it modifies the file content in
lapce-data, and only sends the change of that edit to
lapce-proxyreceives the change, and applies the change locally which make the file content in sync. When you save the file in the GUI,
lapce-datasends the file save request to
lapce-proxysaves the file to the local disk.