For a number of low end PICs includi a few PIC24s the Code Configurator will generate code to set up and operate the peripherals.
For PIC32 there is Harmony that also includes a code generator, the MHC. Harmony is not just a code generator, it's a framework.
By far the biggest problem with any code generator is maintenance of code, particularly when there are bugs in the generator itself, you need to modify generated code, or the code generstor itself is updated. Almost always it's a time-bomb ready to break and overwrite your code.
The quality of both the Code Configurator and Harmony/MHC is quite bad, and there is not a publicly maintained list of the numerous broken bits. Harmony also means you have to learn their framework, which is a straitjacket for programmers and is terribly difficult to understand well enough to get your fingers dirty on real production code. The Code Configurator isn't as bad but it still generates code for things like I2C which is trying to be a jack of all trades but master of none, that comment extends to Harmony too.
I do use both the Code Configurator and MHC almost daily, but neither are a panacea: you still have to know your simpler peripherals at the hardware and register level pretty thoroughly. Innevitably you'll almost certainly end up with a hybrid design using both generated code and your own stuff, mostly because of the bugs and unmaintainablilty of generated code by the code generators.
All code generators I've encountered have been universally shit since I first used them over 25 years ago. The idea might sound good but the implementation is always half arsed. These examples are no different.