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
Copy file name to clipboardExpand all lines: docs/UnityPackageMessagingProtocol.md
+29-5Lines changed: 29 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,13 +72,13 @@ All available message types:
72
72
|`RetrieveTestList`| 23 | Request to retrieve list of available tests | Test mode string ("EditMode" or "PlayMode") |
73
73
|`ExecuteTests`| 24 | Request to execute specific tests | TestMode, TestMode:AssemblyName.dll, or TestMode:FullTestName / Response is empty string|
74
74
|`ShowUsage`| 25 | Show usage information | JSON serialized FileUsage object |
75
-
|`CompilationFinished`| 100 | Notification that compilation has finished | Empty string |
75
+
|`CompilationFinished`| 100 | Notification that compilation has finished | Empty string (automatically followed by GetCompileErrors message) |
76
76
|`PackageName`| 101 | Request/response for package name | Empty string (request) / Package name string (response) |
77
77
|`Online`| 102 | Notifies clients that this package is online and ready to receive messages | Empty string |
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
+
|`GetCompileErrors`| 106 |Auto-sent after CompilationFinished, or manual request/response for compile error information | Empty string (request) / JSON serialized LogContainer (response) |
82
82
83
83
Note:
84
84
- Message value greater than or equal to 100 means it does not exist in the official package but was added in this package.
@@ -130,11 +130,26 @@ Detailed value formats for some of the types:
130
130
-**Compilation Lifecycle**: This message is sent at the beginning of the compilation process, before any assembly compilation starts
131
131
-**Relationship to CompilationFinished**: This message pairs with `CompilationFinished` (Value: 100) to provide complete compilation lifecycle notifications
132
132
133
+
#### CompilationFinished (Value: 100)
134
+
-**Format**: Empty string
135
+
-**Description**: Notification sent when Unity's compilation pipeline finishes compiling assemblies. This message is broadcast to all connected clients when the compilation process completes.
136
+
-**Automatic Behavior**:
137
+
-**GetCompileErrors Auto-Send**: Immediately after broadcasting this message, a `GetCompileErrors` message (Value: 106) is automatically sent to all connected clients with the collected compile errors from the compilation session
138
+
-**Error Collection**: Compile errors are collected during the compilation process and automatically provided without requiring a separate request
139
+
-**Manual Requests**: `GetCompileErrors` can still be requested manually
140
+
-**Important Notes**:
141
+
-**Compilation Lifecycle**: This message is sent at the end of the compilation process, after all assembly compilation finishes
142
+
-**Relationship to CompilationStarted**: This message pairs with `CompilationStarted` (Value: 105) to provide complete compilation lifecycle notifications
143
+
-**Client Integration**: Clients can expect to receive compile error information automatically after each compilation without needing to explicitly request it
144
+
133
145
#### GetCompileErrors (Value: 106)
134
146
-**Format**:
135
147
- Request: Empty string
136
148
- 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.
149
+
-**Description**: Provides the collected compile errors that occurred during Unity's compilation process. This message is automatically sent to all connected clients immediately after each `CompilationFinished` message, but can also be requested manually.
150
+
-**Automatic Behavior**:
151
+
-**Auto-Send**: Automatically broadcast to all clients after every `CompilationFinished` message
152
+
-**Manual Request**: Can also be requested manually by sending an empty string request
138
153
139
154
-**C# Structure**:
140
155
@@ -173,7 +188,7 @@ public class Log
173
188
-**Error Filtering**: Only log messages containing "error CS" are collected
174
189
-**Automatic Clearing**: Previous compile errors are cleared when compilation starts
175
190
-**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.
191
+
-**Usage**: Clients automatically receive structured compile error information after each compilation for IDE integration, error highlighting, and debugging assistance. Manual requests are also supported for on-demand error retrieval.
177
192
178
193
#### RetrieveTestList (Value: 23)
179
194
-**Format**: Test mode string ("EditMode" or "PlayMode")
@@ -185,11 +200,20 @@ public class Log
185
200
-`TestMode` - Execute all tests in the specified mode
186
201
-`TestMode:AssemblyName.dll` - Execute all tests in the specified assembly
187
202
-`TestMode:FullTestName` - Execute a specific test by its full name
203
+
-`TestMode:PartialTestName?` - Execute tests using fuzzy matching (partial name matching), by ending with `?`
188
204
-**Examples**:
189
205
-`"EditMode"` - Run all edit mode tests
190
206
-`"PlayMode:MyTests.dll"` - Run all tests in MyTests assembly
191
207
-`"EditMode:MyNamespace.MyTestClass"` - Run all tests in MyTestClass
192
-
-**Description**: Executes tests based on the specified filter. The filter can target all tests in a mode, all tests in an assembly, or a specific test by name.
208
+
-`"EditMode:TestMethod?"` - Run all tests whose full name ends with "TestMethod"
209
+
-`"PlayMode:Utils?"` - Run all tests whose full name ends with "Utils"
210
+
-**Description**: Executes tests based on the specified filter. The filter can target all tests in a mode, all tests in an assembly, or a specific test by name. When the filter doesn't match any exact test names, fuzzy matching is performed to find tests whose full names end with the specified search term.
211
+
-**Fuzzy Matching Behavior**:
212
+
- If filter ends with `?`, the system performs fuzzy matching
213
+
- Fuzzy matching finds all tests (including non-leaf nodes) whose `FullName` ends with the search term
214
+
- Case-insensitive matching is used
215
+
- Both leaf tests and test containers (classes, namespaces) can be matched
216
+
- Multiple matches are supported - all matching tests will be executed
193
217
194
218
Response:
195
219
- A response that is empty is sent to the original client to confirm that the message is received and already processed.
0 commit comments