feat(cli): UTExportedTypeDeclarations support for file associations#22
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| .collect(), | ||
| ), | ||
| ); | ||
| } |
There was a problem hiding this comment.
Inverted condition causes extensions to be omitted
High Severity
The condition if association.ext.is_empty() is inverted. It only inserts CFBundleTypeExtensions when the extensions list is empty, which would just insert an empty array. The condition needs to be if !association.ext.is_empty() to properly include file extensions when they exist. This would cause macOS to not recognize the file associations by extension.
| .name | ||
| .as_ref() | ||
| .unwrap_or(&association.ext[0].0) | ||
| .expect("File association must have a name") |
There was a problem hiding this comment.
Panic when file association name is not provided
High Severity
The code uses .expect() for the name field, but name is optional with a documented default of ext[0]. The example config in this PR has file associations without name fields, which would cause a panic at build time. The previous fallback to association.ext[0] was removed.
| "UTTypeConformsTo".into(), | ||
| plist::Value::Array(content_types.iter().map(|s| s.clone().into()).collect()), | ||
| ); | ||
| } |
There was a problem hiding this comment.
Wrong field used for UTTypeConformsTo in export
High Severity
The code uses association.content_types to populate UTTypeConformsTo in the exported type declaration. It should use exported_type.conforms_to instead. The content_types field maps to LSItemContentTypes, while conforms_to on ExportedFileAssociation is the correct field for UTTypeConformsTo. This means the conformsTo values in the config will be ignored.
Benchmark PR from qodo-benchmark#166
Note
Improves macOS file association capabilities and Info.plist generation.
UTExportedTypeDeclarationsfrombundle.fileAssociations[].exportedTypeintoInfo.plistLSItemContentTypesvia newbundle.fileAssociations[].contentTypesExportedFileAssociation,FileAssociation.content_typesandFileAssociation.exported_type; updates CLI schemas and descriptionsprotocol-assetenabled)Written by Cursor Bugbot for commit e1e8692. Configure here.