Package com.vaadin.copilot
Class CompilationStatusChecker
java.lang.Object
com.vaadin.copilot.CompilationStatusChecker
- All Implemented Interfaces:
Consumer<IDEHeartbeatResponse>
A consumer that listens to IDE heartbeat responses to detect and react to
changes in compilation status.
If the compilation status changes (i.e., from no errors to errors or vice versa), it sends a message to the developer tools interface indicating the new status and optionally includes the list of files with compilation errors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA simple record to represent a file path and its corresponding file name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IDEHeartbeatResponse ideHeartbeatResponse) Accepts anIDEHeartbeatResponseand checks for changes in compilation error status.voidsubscribe(com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Subscribes this checker to the IDE heartbeat scheduler to start receiving compilation status updates if not subscribed.
-
Constructor Details
-
CompilationStatusChecker
public CompilationStatusChecker()
-
-
Method Details
-
subscribe
public void subscribe(com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Subscribes this checker to the IDE heartbeat scheduler to start receiving compilation status updates if not subscribed. Also, updatesDevToolsInterfacereference so it stays up-to-date This method is synchronized to ensure thread safety.- Parameters:
devToolsInterface- the interface to use for sending updates
-
accept
Accepts anIDEHeartbeatResponseand checks for changes in compilation error status. If a change is detected, sends a notification with the new status and the list of files with errors (if available).- Specified by:
acceptin interfaceConsumer<IDEHeartbeatResponse>- Parameters:
ideHeartbeatResponse- the heartbeat response containing compilation status
-