You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(compile-errors): add support for compile error collection and retrieval
- Add Log and LogContainer structs for compile error deserialization
- Implement GetCompileErrors message type and handling
- Add client methods to request compile errors
- Update protocol documentation with new message type details
Copy file name to clipboardExpand all lines: docs/UnityPackageMessagingProtocol.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,7 @@ All available message types:
78
78
|`Offline`| 103 | Notifies clients that this package is offline and can not receive messages | Empty string |
79
79
|`IsPlaying`| 104 | Notification of current play mode state | "true" (in play mode) / "false" (in edit mode) |
80
80
|`CompilationStarted`| 105 | Notification that compilation has started | Empty string |
81
+
|`GetCompileErrors`| 106 | Request/response for compile error information | Empty string (request) / JSON serialized LogContainer (response) |
81
82
82
83
Note:
83
84
- Message value greater than or equal to 100 means it does not exist in the official package but was added in this package.
@@ -129,6 +130,51 @@ Detailed value formats for some of the types:
129
130
-**Compilation Lifecycle**: This message is sent at the beginning of the compilation process, before any assembly compilation starts
130
131
-**Relationship to CompilationFinished**: This message pairs with `CompilationFinished` (Value: 100) to provide complete compilation lifecycle notifications
131
132
133
+
#### GetCompileErrors (Value: 106)
134
+
-**Format**:
135
+
- Request: Empty string
136
+
- Response: JSON serialized LogContainer object
137
+
-**Description**: Requests the collected compile errors that occurred during Unity's compilation process. Unity collects compile errors within a 1-second window after compilation finishes.
138
+
139
+
-**C# Structure**:
140
+
141
+
```csharp
142
+
[Serializable]
143
+
publicclassLogContainer
144
+
{
145
+
/// <summary>
146
+
/// Array of log entries.
147
+
/// </summary>
148
+
publicLog[] Logs { get; set; }
149
+
}
150
+
151
+
[Serializable]
152
+
publicclassLog
153
+
{
154
+
/// <summary>
155
+
/// The complete log message as logged by Unity.
156
+
/// </summary>
157
+
publicstringMessage;
158
+
159
+
/// <summary>
160
+
/// The stack trace associated with the log entry, if available.
161
+
/// </summary>
162
+
publicstringStackTrace;
163
+
164
+
/// <summary>
165
+
/// The timestamp when the log entry was captured as Unix timestamp (milliseconds since epoch).
166
+
/// </summary>
167
+
publiclongTimestamp;
168
+
}
169
+
```
170
+
171
+
-**Behavior**:
172
+
-**Collection Window**: Compile errors are collected for 1 second after compilation finishes
173
+
-**Error Filtering**: Only log messages containing "error CS" are collected
174
+
-**Automatic Clearing**: Previous compile errors are cleared when compilation starts
175
+
-**Response Format**: Returns JSON with LogContainer containing array of Log objects
176
+
-**Usage**: Clients can request this to get structured compile error information for IDE integration, error highlighting, and debugging assistance.
177
+
132
178
#### RetrieveTestList (Value: 23)
133
179
-**Format**: Test mode string ("EditMode" or "PlayMode")
0 commit comments