Skip to content

feat(cli): UTExportedTypeDeclarations support for file associations#22

Open
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_featcli_utexportedtypedeclarations_support_for_file_associations_pr166from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_featcli_utexportedtypedeclarations_support_for_file_associations_pr166
Open

feat(cli): UTExportedTypeDeclarations support for file associations#22
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_featcli_utexportedtypedeclarations_support_for_file_associations_pr166from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_featcli_utexportedtypedeclarations_support_for_file_associations_pr166

Conversation

@tomerqodo
Copy link
Copy Markdown

@tomerqodo tomerqodo commented Jan 21, 2026

Benchmark PR from qodo-benchmark#166


Note

Improves macOS file association capabilities and Info.plist generation.

  • Emits UTExportedTypeDeclarations from bundle.fileAssociations[].exportedType into Info.plist
  • Supports LSItemContentTypes via new bundle.fileAssociations[].contentTypes
  • Extends config/types: adds ExportedFileAssociation, FileAssociation.content_types and FileAssociation.exported_type; updates CLI schemas and descriptions
  • Example updated to showcase new associations and config (schema path and protocol-asset enabled)

Written by Cursor Bugbot for commit e1e8692. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(),
),
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

.name
.as_ref()
.unwrap_or(&association.ext[0].0)
.expect("File association must have a name")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

"UTTypeConformsTo".into(),
plist::Value::Array(content_types.iter().map(|s| s.clone().into()).collect()),
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant