Open madushajg opened 8 months ago
The current implementation of the LS supports this API, and specifically for files with a *.bal
extension, we are also monitoring changes to the file, covering text edits. For the rest of the file types, we are only considering creation and deletion.
As of now, we are only using this API to publish diagnostics to the LS client upon changes to the file. We can refine this API to provide responses to the diagrams as well, once we know precisely the expected response structure.
Great! For the diagrams, providing the document URI, file event type, and the changed location is sufficient
We have already implemented a Publisher-Subscriber (pub-sub) event synchronisation framework within the Ballerina Language Server. This framework enables a group of observers to monitor events related to the Language Server).
For detailed information on the design and implementation of this framework, please refer to the following documents:
As an example, we have developed a Publisher for project updates (such as didChange, etc.) named ProjectUpdateEventPublisher, which can be found here.
Additionally, an Observer named PublishDiagnosticSubscriber has been created to subscribe to events emitted by the ProjectUpdateEventPublisher. You can find the implementation of PublishDiagnosticSubscriber here.
We believe that the existing functionality provided by this framework fulfils the above mentioned requirements.
Description
There is a requirement to listen on bal file changes (done via VSCode editor or file system write), so that diagrams can rerender by being responsive. It seems this can be achieved by adding support for didChangeWatchedFiles[1] notification in ballerina lang server.
[1] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeWatchedFiles