On CrowBar's PvE Deerisle you can find inspect weapon system
By holding weapon in hand and pressing mouse middle button you will see what ammo it uses and which mags you can attach on it, also you will be able to see how much resources it will use for repairing
When you press B while hovering over weapon with your cursor you will be able to see which mags/suppressors/optics from your invetory do fit that weapon
By pressing B on any weapon attachment you will be able to see which weapon does it fit
Small tip: Check weapon system is not only for weapons it also can be used for clothing which can show you how many quick bar slots you get or level of armor protection or even your camouflage from environment (zombies, animals)