Hi, Ethan. I believe what you're seeing is due to a current artificial (and intentional as I'll explain below) limitation in IC2 around metadata from installed unlocked packages with a namespace where the retrieved metadata includes the namespace, but IC2 doesn't know anything about that namespace in the project which leads to any number of issues when working with that metadata.
We can confirm that to be the case one way or the other, and it's likely a good idea to do that before proceeding on any other assumptions. You'll need to add the following to Help > Diagnostic Tools > Debug Log Settings:
#com.illuminatedcloud.intellij.configCache.FilePropertiesCache
then refresh the list of server metadata using the Refresh toolbar button or the Update Now link. That is going to pretty much flood your idea.log file with information about the list of server metadata returned by the API and whether or not it's eligible to be managed in an IC2 project. What you're going to be looking for is a set of log entries in that file like the following:
2023-05-24 11:30:48,661 [ 101432] FINE - #com.illuminatedcloud.intellij.configCache.FilePropertiesCache - listMetadata() returned 7 results.
2023-05-24 11:30:48,661 [ 101432] FINE - #com.illuminatedcloud.intellij.configCache.FilePropertiesCache - Evaluating for inclusion:
{
"createdById": "0058B000002KmXgQAK",
"createdByName": "User User",
"createdDate": 1684875552000,
"fileName": "classes/DynamicLabelAccess.cls",
"fullName": "DynamicLabelAccess",
"id": "01p8B000003z30dQAA",
"lastModifiedById": "0058B000002KmXgQAK",
"lastModifiedByName": "User User",
"lastModifiedDate": 1684875567000,
"manageableState": "UNMANAGED",
"type": "ApexClass"
}
2023-05-24 11:30:48,661 [ 101432] FINE - #com.illuminatedcloud.intellij.configCache.FilePropertiesCache - Including DynamicLabelAccess.
...
Look for some of the specific metadata objects that you'd expect/hope to be there and see how they're reported, specifically the value for manageableState. My guess is that's going to show as INSTALLED_EDITABLE in which case you're definitely hitting the aforementioned limitation. To be perfectly candid, here's the comment in IC2 regarding that exact limitation:
// TODO: I think that technically anything that's INSTALLED_EDITABLE is...well...editable,
// but that can create serious issues with, e.g., Apex source files because they come back
// with namespaces in their filenames that must be interpreted properly. For now disallow
// that and we'll see if anyone specifically asks for it.
and you would technically be the first "anyone specifically ask[ing] for it".
Let's start with confirmation of that assertion (one way or the other), and then we can discuss potential resolutions.
Regards,
Scott Wells