Commit 9cd9bc3
authored
Add solutions to remove invalid metadata directives in documentation comments (#1277)
* Add solutions to remove invalid metadata directives in documentation comments
- Implement solutions for org.swift.docc.Metadata.Invalid<directive>InDocumentationComment diagnostics
- Each invalid directive now has a solution that removes the directive
- Follows the same pattern as other directive removal solutions in the codebase
- Added comprehensive tests to verify solutions are provided correctly
- Fixes issue #1111
* Fix code duplication in validateForUseInDocumentationComment method
- Create diagnostic once instead of duplicating it
- Use conditional solutions array based on range availability
- Single Problem creation path for better maintainability
* Add range verification test for invalid metadata directive solutions
- Verify replacement range matches problem's diagnostic range
- Ensures solution targets the correct content
- Improves test coverage for range accuracy
* Move test comments into assertion messages for better clarity
- Move explanatory comments into assertion message parameters
- Provides better context when tests fail
- Makes tests more self-documenting
* Fix code duplication in validateForUseInDocumentationComment method
- Create diagnostic once instead of duplicating it
- Use conditional solutions array based on range availability
- Single Problem creation path for better maintainability1 parent a4b9902 commit 9cd9bc3
File tree
2 files changed
+61
-11
lines changed- Sources/SwiftDocC/Semantics/Metadata
- Tests/SwiftDocCTests/Semantics
2 files changed
+61
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
238 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
239 | 246 | | |
240 | 247 | | |
241 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1311 | 1311 | | |
1312 | 1312 | | |
1313 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
1314 | 1327 | | |
1315 | 1328 | | |
1316 | 1329 | | |
| |||
1352 | 1365 | | |
1353 | 1366 | | |
1354 | 1367 | | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
1355 | 1398 | | |
1356 | 1399 | | |
1357 | 1400 | | |
| |||
0 commit comments