17. Code Style Settings
Code style settings enable defining formatting options. A code style settings provider creates an instance of the settings and also creates an options page in settings/preferences. This example creates a settings/preferences page that uses the default language code style settings, customized by a language code style settings provider.
Define Code Style Settings
Define SimpleCodeStyleSettings
for Simple Language by subclassing CustomCodeStyleSettings
.
Define Code Style Settings Provider
The code style settings provider gives the IntelliJ Platform a standard way to instantiate CustomCodeStyleSettings
for the Simple Language.
Define SimpleCodeStyleSettingsProvider
for Simple Language by subclassing CodeStyleSettingsProvider
.
Register the Code Style Settings Provider
The SimpleCodeStyleSettingsProvider
implementation is registered with the IntelliJ Platform in the plugin configuration file using the com.intellij.codeStyleSettingsProvider
extension point.
Define the Language Code Style Settings Provider
Define SimpleLanguageCodeStyleSettingsProvider
for Simple Language by subclassing LanguageCodeStyleSettingsProvider
, which provides common code style settings for a specific language.
Register the Language Code Style Settings Provider
The SimpleLanguageCodeStyleSettingsProvider
implementation is registered with the IntelliJ Platform in the plugin configuration file using the com.intellij.langCodeStyleSettingsProvider
extension point.
Run the Project
Run the plugin by using the Gradle runIde
task.
In the IDE Development Instance, open the Simple Language code formatting page: .