Difference between Facet and FrameworkType?
Hi,
I'm wondering what's the difference between facet and FrameworkType, both of them seem to add support for a new language/framework + downloading things + configuring things...
I'm a little confused, because sometimes a facet is used (Spring, Android), and sometimes it's a framework (kotlin, groovy).
I'm developing a custom language plugin for Ceylon, and I would like to mark a given module as "contains ceylon code", either because it was created as a ceylon module, or because we detected a ceylon file in a java project. When a module is identified as containing ceylon stuff, it will:
- invoke a type checker that will be used everywhere in the plugin
- add a new settings panel for this module
Now, since I don't understand the difference between facets and frameworks, I'm not sure which solution I should implement. Could one of you provide me some guidance here?
Thanks
Please sign in to leave a comment.
A facet is a persistent component that contains user-editable settings. For example, the Android facet allows the user to configure the location of AndroidManifest.xml and some other things.
A FrameworkType allows you to perform additional logic during project creation, but is not persisted after the project has been created. For example, the FrameworkType for Kotlin can set up the Kotlin runtime for the module while the project is created, but once the project has been created, Kotlin does not depend on any additional persistent settings; as long as you have files of the right type, everything will work.
If you need to show settings, then it sounds like you need a facet. However, from our experience, it's better to avoid having facets (and, therefore, settings) when possible, because it significantly reduces the likelihood that the users will experience a broken plugin because of a misconfigured facet.