From 8a65dfe12a33c9368dbaff1238559def4be6bd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Wed, 22 Apr 2020 12:54:06 +0200 Subject: [PATCH] blank lines around code blocks --- .../architectural_overview/file_view_providers.md | 1 + basics/architectural_overview/virtual_file.md | 1 + basics/getting_started/update_plugins_format.md | 1 + basics/persisting_sensitive_data.md | 2 ++ basics/plugin_structure/plugin_dependencies.md | 3 +++ basics/plugin_structure/plugin_extension_points.md | 6 ++++++ basics/plugin_structure/plugin_extensions.md | 2 ++ basics/plugin_structure/plugin_services.md | 1 + basics/psi_cookbook.md | 1 + intro/sdk_code_guidelines.md | 2 ++ products/android_studio.md | 2 ++ products/clion.md | 1 + products/dev_alternate_products.md | 3 +++ products/goland.md | 2 ++ products/phpstorm/php_open_api.md | 2 -- products/rubymine.md | 1 + .../api_changes/api_changes_list_2020.md | 1 + .../frameworks_and_external_apis/xml_dom_api.md | 7 +++++++ reference_guide/intellij_artifacts.md | 3 +++ .../internal_actions/enabling_internal.md | 3 ++- reference_guide/jcef.md | 1 + reference_guide/project_model/library.md | 3 +++ reference_guide/project_model/project.md | 2 ++ reference_guide/project_wizard.md | 3 +++ reference_guide/ui_themes/themes.md | 3 +++ reference_guide/ui_themes/themes_customize.md | 13 +++++++++++++ reference_guide/ui_themes/themes_extras.md | 7 +++++++ reference_guide/ui_themes/themes_metadata.md | 5 +++-- reference_guide/work_with_icons_and_images.md | 1 + tutorials/action_system/grouping_action.md | 1 + .../action_system/working_with_custom_actions.md | 3 +++ tutorials/build_system/deployment.md | 6 ++++++ tutorials/custom_language_support/annotator.md | 3 +++ .../custom_language_support/code_style_settings.md | 5 +++++ tutorials/custom_language_support/commenter.md | 2 ++ .../completion_contributor.md | 2 ++ .../custom_language_support/find_usages_provider.md | 2 ++ .../custom_language_support/folding_builder.md | 1 + tutorials/custom_language_support/formatter.md | 3 +++ .../go_to_symbol_contributor.md | 4 ++++ .../custom_language_support/grammar_and_parser.md | 3 +++ .../language_and_filetype.md | 6 ++++++ .../lexer_and_parser_definition.md | 6 ++++++ .../custom_language_support/line_marker_provider.md | 4 ++++ .../psi_helper_and_utilities.md | 2 ++ tutorials/custom_language_support/quick_fix.md | 3 +++ .../reference_contributor.md | 9 +++++++++ .../structure_view_factory.md | 4 ++++ .../syntax_highlighter_and_color_settings_page.md | 5 +++++ tutorials/editor_basics/coordinates_system.md | 1 + tutorials/kotlin.md | 2 +- tutorials/live_templates.md | 1 + tutorials/live_templates/new_macros.md | 2 ++ tutorials/live_templates/template_support.md | 6 ++++++ tutorials/project_wizard/module_types.md | 3 +++ .../writing_tests_for_plugins/annotator_test.md | 2 ++ .../writing_tests_for_plugins/completion_test.md | 1 + tutorials/writing_tests_for_plugins/folding_test.md | 2 ++ tutorials/writing_tests_for_plugins/parsing_test.md | 2 ++ .../tests_prerequisites.md | 1 + user_interface_components/kotlin_ui_dsl.md | 6 ++++-- 61 files changed, 178 insertions(+), 8 deletions(-) diff --git a/basics/architectural_overview/file_view_providers.md b/basics/architectural_overview/file_view_providers.md index d87dc3d00..3819fca09 100644 --- a/basics/architectural_overview/file_view_providers.md +++ b/basics/architectural_overview/file_view_providers.md @@ -29,6 +29,7 @@ To create a file type that has multiple interspersing trees for different langua Implement [`FileViewProviderFactory`](upsource:///platform/core-api/src/com/intellij/psi/FileViewProviderFactory.java) and return your `FileViewProvider` implementation from `createFileViewProvider()` method. Register as follows in `plugin.xml`: + ```xml diff --git a/basics/architectural_overview/virtual_file.md b/basics/architectural_overview/virtual_file.md index 942146cee..b417bc83c 100644 --- a/basics/architectural_overview/virtual_file.md +++ b/basics/architectural_overview/virtual_file.md @@ -48,6 +48,7 @@ project.getMessageBus().connect().subscribe(VirtualFileManager.VFS_CHANGES, new } }); ``` + See [Message Infrastructure](/reference_guide/messaging_infrastructure.md) and [Plugin Listeners](/basics/plugin_structure/plugin_listeners.md) for more details. For a non-blocking alternative, starting with version 2019.2 of the platform, see [`AsyncFileListener`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/AsyncFileListener.java) diff --git a/basics/getting_started/update_plugins_format.md b/basics/getting_started/update_plugins_format.md index 2bef19319..81aa7143d 100644 --- a/basics/getting_started/update_plugins_format.md +++ b/basics/getting_started/update_plugins_format.md @@ -52,6 +52,7 @@ The format of an `updatePlugins.xml` file is simply a list of sequential element ``` +
**Note:** * An `updatePlugins.xml` file must contain at least one set of `` elements. diff --git a/basics/persisting_sensitive_data.md b/basics/persisting_sensitive_data.md index 94555ef2d..bc49cb58e 100644 --- a/basics/persisting_sensitive_data.md +++ b/basics/persisting_sensitive_data.md @@ -9,6 +9,7 @@ The Credentials Store API allows you to securely store sensitive user data, like Use [`PasswordSafe`](upsource:///platform/platform-api/src/com/intellij/ide/passwordSafe/PasswordSafe.kt) to work with credentials. ### Retrieve stored credentials + ```java String key = null; // e.g. serverURL, accountID CredentialAttributes credentialAttributes = createCredentialAttributes(key); @@ -33,6 +34,7 @@ Use [`PasswordSafe`](upsource:///platform/platform-api/src/com/intellij/ide/pass Credentials credentials = new Credentials(username, password); PasswordSafe.getInstance().set(credentialAttributes, credentials); ``` + To remove stored credentials, pass `null` for `credentials` parameter. ## Storage diff --git a/basics/plugin_structure/plugin_dependencies.md b/basics/plugin_structure/plugin_dependencies.md index bacf35fc5..8c876fbde 100644 --- a/basics/plugin_structure/plugin_dependencies.md +++ b/basics/plugin_structure/plugin_dependencies.md @@ -60,6 +60,7 @@ To display a list of available IntelliJ Platform modules, invoke the [code compl ### 3.1 Configuring plugin.xml In the `plugin.xml`, add a `` tag with the ID of the dependency plugin as its content. Continuing with the example from [Section 2](#2-project-setup) above, the dependency declaration in `plugin.xml` would be: + ```xml org.jetbrains.kotlin ``` @@ -72,6 +73,7 @@ add `optional="true" config-file="otherconfig.xml"` to the `` tag. For example, if a plugin project adds additional highlighting for Java and Kotlin files, use the following setup. The main `plugin.xml` will define an annotator for Java and specify an optional dependency on the Kotlin plugin: + ```xml ... @@ -84,6 +86,7 @@ The main `plugin.xml` will define an annotator for Java and specify an optional ``` Then create a file called `withKotlin.xml`, in the same directory as the main `plugin.xml` file. In that file, define an annotator for Kotlin: + ```xml diff --git a/basics/plugin_structure/plugin_extension_points.md b/basics/plugin_structure/plugin_extension_points.md index c17884d9f..f40810c61 100644 --- a/basics/plugin_structure/plugin_extension_points.md +++ b/basics/plugin_structure/plugin_extension_points.md @@ -21,6 +21,7 @@ You can declare extensions and extension points in the plugin configuration file To declare extension points in your plugin, add an `` section to your `plugin.xml`. Then insert a child element `` that defines the extension point name and the name of a bean class or an interface that is allowed to extend the plugin functionality in the `name`, `beanClass` and `interface` attributes, respectively. _myPlugin/META-INF/plugin.xml_ + ```xml my.plugin @@ -46,6 +47,7 @@ The plugin that contributes to the extension point will read those properties fr To clarify this, consider the following sample `MyBeanClass` bean class used in the above `plugin.xml` file: _myPlugin/src/com/myplugin/MyBeanClass.java_ + ```java public class MyBeanClass extends AbstractExtensionPointBean { @Attribute("key") @@ -69,6 +71,7 @@ public class MyBeanClass extends AbstractExtensionPointBean { For above extension points usage in _anotherPlugin_ would look like this (see also [Declaring Extensions](plugin_extensions.md#declaring-extensions)): _anotherPlugin/META-INF/plugin.xml_ + ```xml another.plugin @@ -90,6 +93,7 @@ _anotherPlugin/META-INF/plugin.xml_ To refer to all registered extension instances at runtime, declare an [`ExtensionPointName`](upsource:///platform/extensions/src/com/intellij/openapi/extensions/ExtensionPointName.java) passing in the fully-qualified name matching its [declaration in `plugin.xml`](#how-to-declare-extension-points). _myPlugin/src/com/myplugin/MyExtensionUsingService.java_ + ```java public class MyExtensionUsingService { @@ -104,6 +108,7 @@ public class MyExtensionUsingService { } } ``` + A gutter icon for the `ExtensionPointName` declaration allows navigating to the corresponding `` declaration in `plugin.xml`. ## Dynamic extension points @@ -113,6 +118,7 @@ To support [Dynamic Plugins](dynamic_plugins.md) (2020.1 and later), an extensio - alternatively, an `ExtensionPointChangeListener` can perform necessary updates of data structures (register via `ExtensionPointName.addExtensionPointListener()`) Extension points matching these conditions can then be marked as _dynamic_ by adding `dynamic="true"` in their declaration: + ```xml diff --git a/basics/plugin_structure/plugin_extensions.md b/basics/plugin_structure/plugin_extensions.md index 4e94a36ad..0b6471881 100644 --- a/basics/plugin_structure/plugin_extensions.md +++ b/basics/plugin_structure/plugin_extensions.md @@ -51,6 +51,7 @@ To clarify this procedure, consider the following sample section of the `plugin. ``` + ### Extension default properties The following properties are available always: @@ -71,6 +72,7 @@ Property names matching the following list will resolve to FQN: - ending with `Class` (case-sensitive) A required parent type can be specified in the extension point declaration via nested ``: + ```xml diff --git a/basics/plugin_structure/plugin_services.md b/basics/plugin_structure/plugin_services.md index 28f5f3270..ec68f930a 100644 --- a/basics/plugin_structure/plugin_services.md +++ b/basics/plugin_structure/plugin_services.md @@ -90,6 +90,7 @@ MyProjectService projectService = project.service() This minimal sample shows [light](#light-services) `ProjectService` interacting with another project level service `AnotherService` (not shown here). _ProjectService.java_ + ```java @Service public final class ProjectService { diff --git a/basics/psi_cookbook.md b/basics/psi_cookbook.md index 60ead7e92..b792a31d3 100644 --- a/basics/psi_cookbook.md +++ b/basics/psi_cookbook.md @@ -47,6 +47,7 @@ This page gives a list of recipes for the most common operations for working wit PsiJavaFile javaFile = (PsiJavaFile) psiClass.getContainingFile(); PsiPackage pkg = JavaPsiFacade.getInstance(project).findPackage(javaFile.getPackageName()); ``` + or `com.intellij.psi.util.PsiUtil.getPackageName()` diff --git a/intro/sdk_code_guidelines.md b/intro/sdk_code_guidelines.md index 59da41c99..48b88f94f 100644 --- a/intro/sdk_code_guidelines.md +++ b/intro/sdk_code_guidelines.md @@ -35,6 +35,7 @@ Each roadmap should contain: ## Plugin Copyright Statements Use the standard intellij-community copyright notice in all sample plugins authored by JetBrains: + ```text Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file." ``` @@ -88,6 +89,7 @@ Standardized structure not only makes the samples simpler to navigate and unders Note that directories below the plugin root folder should not have underscore characters, and should use camelCase if needed. The following is an example directory structure for a `foo_basics` plugin. + ```text code_samples/ foo_basics/ diff --git a/products/android_studio.md b/products/android_studio.md index 8223f44b2..0f814fd22 100644 --- a/products/android_studio.md +++ b/products/android_studio.md @@ -42,6 +42,7 @@ Here are the steps to configure the `build.gradle` file for developing a plugin Set the Development Instance to the (user-specific) absolute path to the target Android Studio application. The snippet below is an example of configuring the Setup and Running DSLs in a `build.gradle` specific to developing a plugin targeted at Android Studio. + ```groovy intellij { // Define IntelliJ Platform against which to build the plugin project. @@ -62,6 +63,7 @@ The snippet below is an example of configuring the Setup and Running DSLs in a ` As discussed in the [Plugin Dependencies](/basics/getting_started/plugin_compatibility.md#declaring-plugin-dependencies) section of this guide, a plugin's dependency on [Modules Specific to Functionality](/basics/getting_started/plugin_compatibility.md#modules-specific-to-functionality) must be declared in `plugin.xml`. When using Android Studio-specific features (APIs), a dependency on `com.intellij.modules.androidstudio` must be declared as shown in the code snippet below. Otherwise, if only general IntelliJ Platform features (APIs) are used, then a dependency on `com.intellij.modules.platform` must be declared as discussed in [Plugin Compatibility with IntelliJ Platform Products](/basics/getting_started/plugin_compatibility.md). + ```xml com.intellij.modules.androidstudio ``` diff --git a/products/clion.md b/products/clion.md index ffb4e7846..2b21fd114 100644 --- a/products/clion.md +++ b/products/clion.md @@ -22,6 +22,7 @@ The table below summarizes the `gradle-intellij-plugin` attributes to set in the The dependency on the CLion APIs must be declared in the `plugin.xml` file. As described in [Modules Specific to Functionality](/basics/getting_started/plugin_compatibility.md#modules-specific-to-functionality) table, the `` elements should contain the CLion module, as illustrated in the `plugin.xml` snippet below: + ```xml com.intellij.modules.clion diff --git a/products/dev_alternate_products.md b/products/dev_alternate_products.md index 00565dad7..2192573fa 100644 --- a/products/dev_alternate_products.md +++ b/products/dev_alternate_products.md @@ -42,6 +42,7 @@ Specifying the target as a product-specific `intellij.type` attribute has two ad A `build.gradle` snippet setting a plugin project to target PyCharm is shown below. The `gradle-intellij-plugin` will fetch the matching build of PyCharm Professional to define the APIs available, and use that build of PyCharm (and associated JetBrains runtime) as the Development Instance. No additional product-specific configuration needs to be set in `build.gradle`: + ```groovy intellij { version '2019.2.3' @@ -104,6 +105,7 @@ Set the `runIde.ideDirectory` attribute to the (user-specific) absolute path of The exact path format varies by operating system. This snippet is an example for configuring the Setup and Running DSLs in a `build.gradle` specific to developing a plugin for _targetIDE_. + ```groovy intellij { // Define IntelliJ Platform against which to build the plugin project. @@ -130,6 +132,7 @@ Otherwise, if only general IntelliJ Platform features (APIs) are used, then a de > **NOTE** In the special case of a plugin project declaring dependencies only on other plugins, it must also declare a dependency on `com.intellij.modules.platform`. Otherwise, the plugin project is considered to be legacy and will only load in IntelliJ IDEA. Continuing with the example of developing a plugin for PhpStorm: + ```xml com.jetbrains.php diff --git a/products/goland.md b/products/goland.md index b533f7939..e32df711a 100644 --- a/products/goland.md +++ b/products/goland.md @@ -26,12 +26,14 @@ The dependency on the Go plugin APIs must be declared in the `plugin.xml` file. As described in [Modules Specific to Functionality](/basics/getting_started/plugin_compatibility.md#modules-specific-to-functionality) table, the `` tags must declare `com.intellij.modules.go`. The `plugin.xml` file must also declare a dependency on `com.intellij.modules.platform` as explained in [Configuring the plugin.xml File](dev_alternate_products.md#configuring-pluginxml). The dependency declaration is illustrated in the `plugin.xml` snippet below: + ```xml org.jetbrains.plugins.go com.intellij.modules.platform ``` + ## Available GoLand APIs Use the [Exploring APIs as a Consumer](/basics/getting_started/plugin_compatibility.md#exploring-apis-as-a-consumer) process to identify the library `intellij-go-.jar`, where `` corresponds to the version of the Go plugin. Test your plugin with any version of GoLand you intend to support. diff --git a/products/phpstorm/php_open_api.md b/products/phpstorm/php_open_api.md index 98b5c2d8f..749664783 100644 --- a/products/phpstorm/php_open_api.md +++ b/products/phpstorm/php_open_api.md @@ -61,8 +61,6 @@ public interface PhpTypeProvider2 { Our implementation: includes a Completion contributor for the parameter values too. ```java -/** - */ public class PhpStaticFactoryTypeProvider extends CompletionContributor implements PhpTypeProvider2 { private static final Key>>> STATIC_FACTORY_TYPE_MAP = diff --git a/products/rubymine.md b/products/rubymine.md index 9b171fedd..b9c035f51 100644 --- a/products/rubymine.md +++ b/products/rubymine.md @@ -27,6 +27,7 @@ The correct Ruby plugin version is also determined from the Ruby plugin version The dependency on the Ruby plugin APIs must be declared in the `plugin.xml` file. As described in [Modules Specific to Functionality](/basics/getting_started/plugin_compatibility.md#modules-specific-to-functionality) table, the `` elements must contain `com.intellij.modules.ruby`. The dependency declaration is illustrated in the `plugin.xml` snippet below: + ```xml com.intellij.modules.ruby diff --git a/reference_guide/api_changes/api_changes_list_2020.md b/reference_guide/api_changes/api_changes_list_2020.md index 472c4438e..835125805 100644 --- a/reference_guide/api_changes/api_changes_list_2020.md +++ b/reference_guide/api_changes/api_changes_list_2020.md @@ -143,6 +143,7 @@ Images module functionality (package `org.intellij.images.*`) extracted to plugi : The dependency [must be declared](/basics/plugin_structure/plugin_dependencies.md) explicitly now: * Add `com.intellij.platform.images` in `plugin.xml` * Add to `build.gradle`: + ```groovy intellij { plugins = ['platform-images'] diff --git a/reference_guide/frameworks_and_external_apis/xml_dom_api.md b/reference_guide/frameworks_and_external_apis/xml_dom_api.md index 61ccc7d6d..5634ffd88 100644 --- a/reference_guide/frameworks_and_external_apis/xml_dom_api.md +++ b/reference_guide/frameworks_and_external_apis/xml_dom_api.md @@ -33,6 +33,7 @@ It's _not_ correct to create chained calls like file.getDocument().getRootTag().findFirstSubTag("foo"). findSubTags("bar")[1].getValue().getTrimmedText() ``` + because each call here may return `null`. So the code would probably look like this: @@ -223,6 +224,7 @@ One more common case in DTD and Schemas is when children have the same tag name ```java List getEntities(); ``` + There's also an annotation `@SubTagList` where you can explicitly specify the tag name. Returned collections cannot be modified directly. To delete an element from collection, just call `undefine()` on this element. The tag will then be removed, and element will become invalid (`DomElement.isValid() == false`). Note that this behavior differs from that of fixed-number children and attributes: they are always valid, even after `undefine()`. Again, unlike those children types, collection children always have valid underlying XML tags. @@ -238,6 +240,7 @@ which adds an element to wherever you want, or ```java Entity addEntity(); ``` + which adds a new DOM element to the end of the collection. Please note the singular tense of the word "Entity". That's because here we deal with one `Entity` object, while in the collection getter we dealt with potentially many entities. Now, you can do anything you want with the returned value: modify, define the tag's value, children, etc. @@ -255,6 +258,7 @@ List getBars(); @SubTagsList({"foo", "bar"}) List getMergedListOfFoosAndBars(); ``` + The annotation here is mandatory - we cannot guess several tag names from one method name. To add elements to such mixed collections, you should create "add" methods for each possible tag name: @@ -263,6 +267,7 @@ To add elements to such mixed collections, you should create "add" methods for e @SubTagsList(value={"foo","bar"}, tagName="foo") Fubar addFoo(); @SubTagsList(value={"foo","bar"}, tagName="bar") Fubar addBar(int index); ``` + The index parameter in the last example means the index in the merged collection, not in the collection of tags named "bar". ### Dynamic Definition @@ -405,6 +410,7 @@ GenericDomValue getVeryLongName() @PropertyAccessor("very-long-name") GenericDomValue getName() ``` + In this case, the second method will return just the same as the first one. If there were "foo.bar.name" instead of "very-long-name" in the annotation, the system would actually call `getFoo().getBar().getName()` and return the result to you. Such annotations are useful when you're extending some interface that is inconsistent with your model, or you try to extract a common super-interface from two model interfaces with differently named children that have the same sense (see `` and ``). The case just described is simple, but rare. More often, you really have to incorporate some logic into your model. Then nothing except Java code helps you. And it will. Add the desired methods to your interface, then create an abstract class implementing the interface, and implement there only methods that you added manually and that are not directly connected to your XML model. Note that the class should have a constructor with no arguments. @@ -523,6 +529,7 @@ public class ConverterComponent extends BasicDomElementComponent { } } ``` + All the fields here are now bound to controls in a GUI form. Very often you'll have to create your own file editor. Then, to use all the binding and undo functionality, it's suggested to inherit your [`FileEditorProvider`](upsource:///platform/platform-api/src/com/intellij/openapi/fileEditor/FileEditorProvider.java) from [`PerspectiveFileEditorProvider`](upsource:///xml/dom-openapi/src/com/intellij/util/xml/ui/PerspectiveFileEditorProvider.java), create an instance of [`DomFileEditor`](upsource:///xml/dom-openapi/src/com/intellij/util/xml/ui/DomFileEditor.java) there, and pass a [`BasicDomElementComponent`](upsource:///xml/dom-openapi/src/com/intellij/util/xml/ui/BasicDomElementComponent.java). To easily create an editor with a caption at the top, like in our EJB and JSF, you may use the static method `DomFileEditor.createDomFileEditor()`. `DomFileEditor` automatically listens to all changes in the document corresponding to the given DOM element, and therefore refreshes your component on undo. If you want to listen to changes in additional documents, use the methods `addWatchedDocument()`, `removeWatchedDocument()`, `addWatchedElement()`, `removeWatchedElement()` in `DomFileEditor`. diff --git a/reference_guide/intellij_artifacts.md b/reference_guide/intellij_artifacts.md index 15b73ebec..8d5138c38 100644 --- a/reference_guide/intellij_artifacts.md +++ b/reference_guide/intellij_artifacts.md @@ -90,6 +90,7 @@ There are two parts to the example: the repository and the dependency sections. ### Repositories Section This code snippet selects the release repository with the first URL, and repository of IntelliJ Platform dependencies with the second URL. The second URL is needed because this example selects individual modules. + ```groovy repositories { maven { url "https://www.jetbrains.com/intellij-repository/releases" } @@ -99,12 +100,14 @@ repositories { ### Dependencies Section This code snippet specifies the desired module artifacts. + ```groovy dependencies { compile "com.jetbrains.intellij.platform:jps-model-serialization:182.2949.4" compile "com.jetbrains.intellij.platform:jps-model-impl:182.2949.4" } ``` + Note: * The artifact version (`182.2949.4`) must match in both statements. * In this example `jps-model-serialization` declares the APIs and `jps-model-impl` provides the implementation, so both diff --git a/reference_guide/internal_actions/enabling_internal.md b/reference_guide/internal_actions/enabling_internal.md index 318e19aca..c92d0764a 100644 --- a/reference_guide/internal_actions/enabling_internal.md +++ b/reference_guide/internal_actions/enabling_internal.md @@ -12,7 +12,8 @@ There are multiple ways to enable internal mode, but the simplest is within Inte This selection opens IntelliJ IDEA's `idea.properties` file. If it does not exist, IntelliJ IDEA will prompt to create one. * Add the line shown below to the `idea.properties` file: -``` + +```properties idea.is.internal=true ``` * Save the `idea.properties` file and restart IntelliJ IDEA. diff --git a/reference_guide/jcef.md b/reference_guide/jcef.md index 73cd03e25..5646f0dee 100644 --- a/reference_guide/jcef.md +++ b/reference_guide/jcef.md @@ -76,6 +76,7 @@ For executing JS code and callbacks (see below), use the wrapped `CefBrowser` in By default, `JBCefBrowser` is created with implicit `JBCefClient` (disposed automatically). It is possible to pass your own `JBCefClient` (disposed by the developer). For accessing: + ```java JBCefClient getJBCefClient(); ``` diff --git a/reference_guide/project_model/library.md b/reference_guide/project_model/library.md index 84c312e21..74a44d28a 100644 --- a/reference_guide/project_model/library.md +++ b/reference_guide/project_model/library.md @@ -23,6 +23,7 @@ Package [`libraries`](upsource:///platform/projectModel-api/src/com/intellij/ope ### Getting a List of Libraries a Module Depends On To get the list of libraries that a module depends on, use `OrderEnumerator.forEachLibrary` as follows. + ```java final List libraryNames = new ArrayList(); ModuleRootManager.getInstance(module).orderEntries().forEachLibrary(library -> { @@ -41,6 +42,7 @@ whereas the list of project-level library tables is accessed through `LibraryTab Once you have a `LibraryTable`, you can get the libraries in it by calling `LibraryTable.getLibraries()`. To get the list of all module libraries defined in a given module, use the following API: + ```java OrderEntryUtil.getModuleLibraries(ModuleRootManager.getInstance(module)); ``` @@ -48,6 +50,7 @@ OrderEntryUtil.getModuleLibraries(ModuleRootManager.getInstance(module)); ### Getting the Library Content [`Library`](upsource:///platform/projectModel-api/src/com/intellij/openapi/roots/libraries/Library.java) provides the `getUrls()` method you can use to get a list of source roots and classes the library includes. To clarify, consider the following code snippet: + ```java StringBuilder roots = new StringBuilder("The " + lib.getName() + " library includes:\n"); roots.append("Sources:\n"); diff --git a/reference_guide/project_model/project.md b/reference_guide/project_model/project.md index dd0913ded..f38e44682 100644 --- a/reference_guide/project_model/project.md +++ b/reference_guide/project_model/project.md @@ -45,6 +45,7 @@ Messages.showInfoMessage("Source roots for the " + projectName + " plugin:\n" + ### Checking if a File Belongs to a Project Use [`ProjectFileIndex`](upsource:///platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java) to get this information: + ```java ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(project).getFileIndex(); ``` @@ -52,6 +53,7 @@ ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(project).getF ### Getting the Content or Source Root to Which the a File or Directory Belongs Use the `ProjectFileIndex.getContentRootForFile()` and `ProjectFileIndex.getSourceRootForFile()` methods. For example: + ```java VirtualFile moduleContentRoot = ProjectRootManager.getInstance(project).getFileIndex().getContentRootForFile(virtualFileOrDirectory); VirtualFile moduleSourceRoot = ProjectRootManager.getInstance(project).getFileIndex().getSourceRootForFile(virtualFileOrDirectory); diff --git a/reference_guide/project_wizard.md b/reference_guide/project_wizard.md index bb5ba7306..80886a430 100644 --- a/reference_guide/project_wizard.md +++ b/reference_guide/project_wizard.md @@ -34,6 +34,7 @@ To create a new module type and an extension ```xml ``` + to the [`plugin.xml`](https://github.com/bulenkov/RedlineSmalltalk/blob/master/resources/META-INF/plugin.xml). A custom module type should extend the @@ -95,6 +96,7 @@ Method ```java public void moduleCreated(@NotNull final Module module); ``` + executed tasks right after a module has been created, these may include configuring roots looking up for an SDK and setting it up, adding a specific facet if required and others. For more details please see the following @@ -108,6 +110,7 @@ Adding new steps to the module wizard can be done by overriding the ```java public ModuleWizardStep[] createWizardSteps(WizardContext wizardContext, ModulesProvider modulesProvider); ``` + method in a custom [module builder](https://github.com/bulenkov/RedlineSmalltalk/blob/master/src/st/redline/smalltalk/module/RsModuleBuilder.java). If this method returns a non-empty array of ModuleWizardStep objects, new steps will be shown in their indexing order while creating a new module. diff --git a/reference_guide/ui_themes/themes.md b/reference_guide/ui_themes/themes.md index 2f3c09e0a..518fbea55 100644 --- a/reference_guide/ui_themes/themes.md +++ b/reference_guide/ui_themes/themes.md @@ -65,6 +65,7 @@ For the SDK code sample `theme_basics` the box is _unchecked_. Clicking the _OK_ button creates a default Theme description file named `[themeName].theme.json` in the plugin project's `resources` folder. In this example, the file is named `theme_basics.theme.json`. The content of the default file is a short set of key–value pairs: + ```json { "name": "theme_basics", @@ -84,11 +85,13 @@ The `ui` section will be addressed in [Customizing UI Control Colors](themes_cus The Wizard also creates a `themeProvider` declaration in the `` section of the plugin's `plugin.xml` file. This declaration binds the Theme description file to a theme provider extension using a generated unique `id`. + ```xml ``` + > **WARNING** Do not modify or re-use an existing value of the generated `id` attribute. At this point, the UI Theme `theme_basics` is a valid UI Theme. diff --git a/reference_guide/ui_themes/themes_customize.md b/reference_guide/ui_themes/themes_customize.md index 14b3b910a..f18d3bc93 100644 --- a/reference_guide/ui_themes/themes_customize.md +++ b/reference_guide/ui_themes/themes_customize.md @@ -37,6 +37,7 @@ Maintaining a Theme is more manageable if _Named Colors_ are globally defined in After that, the Named Color can be used instead of a hexadecimal description of the color. For example, defining the Named Color `basicBackground` and then using it to set the background color for panels. (Don't be concerned with the `"ui"` syntax in the example below, it will be discussed in [Custom UI Control Colors](#custom-ui-control-colors).) + ```json { "name": "theme_basics", @@ -62,6 +63,7 @@ Default global icon colors are customized by adding key-value pairs to a `"Color The `ColorPalette` must be inserted in the `icons` section. In the following example the `key` - the default red color (#DB5860) used for `Action` icons in the _Light_ Theme - is overridden to the `value` of a different color (#D61A26): + ```json { "icons": { @@ -71,6 +73,7 @@ In the following example the `key` - the default red color (#DB5860) used for `A } } ``` + This color substitution is applied throughout the IDE UI. ### Custom Icon Palette Colors @@ -92,6 +95,7 @@ The list of available icon `Actions` and `Objects` keys are provided by the comp ![Color Palette Popup](img/theme_colorpalette_popup.png){:width="600px"} For example, the following key-value pair changes the color for all blue-colored icons on toolbars to the color #5BC0DE: + ```json { "icons": { @@ -101,6 +105,7 @@ For example, the following key-value pair changes the color for all blue-colore } } ``` + This more specific change to the `Actions.Blue` color overrides the default definition. It will also, in the narrower context of blue `Actions` icons, supersede any global color overrides of the default blue icon color. @@ -118,6 +123,7 @@ This path is derived from the `AllIcons.[Group].[IconName]` path in icon section For example, the _Build_ (hammer) icon in the toolbar has the path `Allcons.Actions.Compile` as reported by the UI Inspector. Therefore the `key` for the _Build_ icon is `/actions/compile.svg`. The `value` is the file name of the replacement icon, located in the `resources` folder of the UI Theme plugin project: + ```json { "icons": { @@ -125,6 +131,7 @@ The `value` is the file name of the replacement icon, located in the `resources` } } ``` + The color of a replaced icon takes precedence over any `ColorPalette` overrides. ## Customizing UI Controls @@ -151,6 +158,7 @@ A key-value pair is inserted in this section, but only the `property` portion of The `value` is the custom color. The following example would change the default background color to #AED7E3 for all UI controls: + ```json { "ui": { @@ -160,6 +168,7 @@ The following example would change the default background color to #AED7E3 for a } } ``` + Note that the wildcard `"*": {}` section must be within the `"ui": {}` section. #### Customizing the Color of Specific UI Control Types @@ -167,6 +176,7 @@ The color of a specific UI control types are changed by adding a key-value pair The `key` is the full `element.property` format and the `value` is the custom color. The following example sets the background color for all labels to the color #F6E9C9 + ```json { "ui": { @@ -177,6 +187,7 @@ The following example sets the background color for all labels to the color #F6E } } ``` + The `Label.background` entry supersedes, in the narrower context of label backgrounds, any default color as well as any wildcard color assigned to backgrounds. #### Customizing the Color of UI Tabs @@ -243,6 +254,7 @@ Methods for identifying UI control keys are in the [Finding Attribute Keys for U The appearance of borders for specific UI control types are customized by adding a key-value pair to the `"ui": {}` section of a Theme description file. The following example sets a new border width and color for all windows: + ```json { "ui": { @@ -250,6 +262,7 @@ The following example sets a new border width and color for all windows: } } ``` + In this example the customized border supersedes the default definition and any global color override. diff --git a/reference_guide/ui_themes/themes_extras.md b/reference_guide/ui_themes/themes_extras.md index 09a09cb3e..f108fc4c5 100644 --- a/reference_guide/ui_themes/themes_extras.md +++ b/reference_guide/ui_themes/themes_extras.md @@ -30,6 +30,7 @@ The next step is to add the color scheme to the UI Theme plugin project: The `value` is the name of the editor color scheme file. The example below adds an editor scheme named "Lightning" to the _Theme Basics_ custom UI Theme: + ```json { "name": "Theme Basics", @@ -45,11 +46,13 @@ The example below adds an editor scheme named "Lightning" to the _Theme Basics_ When an editor color scheme is exported as a file, the color options appear as `name`-`value` attributes of `option` elements. The `name` is the aspect of the editor to be changed, and the `value` is the new color in six-digit RGB or eight-digit RGBA hexadecimal notation. For example, the snippet below sets the color of the line numbers displayed in the editor: + ```xml ``` + For additional examples of `name` and `value` attributes, review the editor color scheme XML file for the [High Contrast editor scheme](upsource:///platform/platform-resources/src/themes/highContrastScheme.xml). ### Customizing Version Control File Status Colors @@ -57,6 +60,7 @@ As [described above](#creating-a-custom-editor-scheme-using-settingspreferences) No other procedure is necessary to customize these colors. In the exported color scheme file the `name` is the VCS file status, and the `value` is the new color corresponding to that status. For example, customized VCS colors for a subset of file statuses will appear in the editor scheme file as: + ```xml ``` + For additional examples of `FILESTATUS` color `name` attributes, see the editor color scheme XML file for the [High Contrast editor scheme](upsource:///platform/platform-resources/src/themes/highContrastScheme.xml). ### Customizing Editor Scroll Bar Colors @@ -82,6 +87,7 @@ In some cases `usage` itself can be compound such as `ScrollBar.Mac.Transparent. In these compound cases, the last portion of the compound `usage` still describes where the color is to be applied. Note that the following example snippet uses an eight-digit hexadecimal color `value` to give `ScrollBar.Mac.thumbColor` transparency: + ```xml [...] - ``` `/resources/META-INF/MyPlugin.themeMetadata.json`: + ```json { "name": "My Plugin", @@ -47,7 +48,6 @@ The following minimal sample demonstrates all details required when exposing UI } ] } - ``` ### Attributes @@ -69,6 +69,7 @@ The following minimal sample demonstrates all details required when exposing UI > **TIP** Do not remove existing keys, but deprecate them instead to help Theme authors upgrade their existing themes. Color keys can be used via `JBColor.namedColor()` providing defaults for Light and Dark theme: + ```java private static final Color SECTION_HEADER_FOREGROUND = JBColor.namedColor("Plugins.SectionHeader.foreground", new JBColor(0x787878, 0x999999)); diff --git a/reference_guide/work_with_icons_and_images.md b/reference_guide/work_with_icons_and_images.md index 867fde9fb..106005832 100644 --- a/reference_guide/work_with_icons_and_images.md +++ b/reference_guide/work_with_icons_and_images.md @@ -59,6 +59,7 @@ As SVG icons can be scaled arbitrarily, they provide better results on HiDPI env A base size denoting the size (in the user space) of the rendered image in 1x scale should be provided. The size is set via the `width` and `height` attributes omitting the size units. If unspecified, it defaults to 16x16 pixels. A minimal SVG icon file: + ```xml diff --git a/tutorials/action_system/grouping_action.md b/tutorials/action_system/grouping_action.md index aab3faa7e..87ff49a30 100644 --- a/tutorials/action_system/grouping_action.md +++ b/tutorials/action_system/grouping_action.md @@ -162,6 +162,7 @@ public class DynamicActionGroup extends ActionGroup { ### Registering a Variable Action Group To register the dynamic menu group, a `` attribute needs to be placed in the `` section of [`plugin`.xml](https://github.com/JetBrains/intellij-sdk-docs/blob/master/code_samples/action_basics/src/main/resources/META-INF/plugin.xml). When enabled, this group appears at the entry just below the [Static Grouped Actions](#binding-action-groups-to-ui-components) in the **Tools** menu: + ```xml diff --git a/tutorials/action_system/working_with_custom_actions.md b/tutorials/action_system/working_with_custom_actions.md index ededff448..52f5669f5 100644 --- a/tutorials/action_system/working_with_custom_actions.md +++ b/tutorials/action_system/working_with_custom_actions.md @@ -20,6 +20,7 @@ Classes that extend it should override `AnAction.update()`, and must override `A * The `actionPerformed()` method implements the code that executes when an action is invoked by the user. As an example, [`PopupDialogAction`](https://github.com/JetBrains/intellij-sdk-docs/blob/master/code_samples/action_basics/src/main/java/org/intellij/sdk/action/PopupDialogAction.java) overrides `AnAction` for the `action_basics` code sample. + ```java public class PopupDialogAction extends AnAction { @@ -78,6 +79,7 @@ In this case, `PopupDialogAction` would be available in the **Tools** menu, it w After finishing the **New Action** form and applying the changes, the `` section of the plugin's `plugins.xml` file would contain: + ```xml ` declaration for `PopupDialogAction` in the `action_basics` [plugi It also contains an attribute for an [`Icon`](/reference_guide/work_with_icons_and_images.md) and encloses elements declaring text overrides, keyboard and mouse shortcuts, and to which menu group the action should be added. The full declaration is: + ```xml diff --git a/tutorials/build_system/deployment.md b/tutorials/build_system/deployment.md index 61b44a4a9..e7c1af061 100644 --- a/tutorials/build_system/deployment.md +++ b/tutorials/build_system/deployment.md @@ -30,6 +30,7 @@ You can store the Hub Token in [Gradle properties](https://docs.gradle.org/curre If you place a `gradle.properties` file containing your Hub Permanent Token in your project's root directory, please ensure your version control tool ignores this file. For example in Git, you can add the following line to your `.gitignore` file: + ``` gradle.properties ``` @@ -43,6 +44,7 @@ intellijPublishToken=YOUR_HUB_TOKEN_HERE ``` Then refer to these values in `publishPlugin` task in your `build.gradle` file: + ```groovy publishPlugin { token intellijPublishToken @@ -52,6 +54,7 @@ publishPlugin { ### Using Environment Variables Alternatively, and possibly slightly safer because you cannot accidentally commit your token to version control, you can provide your token via an environment variable. For example, start by defining an environment variable such as: + ```bash export ORG_GRADLE_PROJECT_intellijPublishToken='YOUR_HUB_TOKEN_HERE' ``` @@ -61,6 +64,7 @@ Environment variables visible to all processes need to be defined in [Environmen Now provide the environment variable in the run configuration with which you run the `publishPlugin` task locally. To do so, create a Gradle run configuration (if not already done), choose your Gradle project, specify the `publishPlugin` task, and then add the environment variable. + ```groovy publishPlugin { token = System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken") @@ -83,6 +87,7 @@ You may wish to verify this by [installing your plugin from disk](https://www.je ### Publishing a Plugin Once you are confident the plugin works as intended, make sure the plugin version is updated, as the JetBrains Plugin repository won't accept multiple artifacts with the same version. To deploy a new version of your plugin to the JetBrains plugin repository, execute the following Gradle command: + ```bash gradle publishPlugin ``` @@ -93,6 +98,7 @@ If successfully deployed, any users who currently have your plugin installed on ### Specifying a Release Channel You may also deploy plugins to a release channel of your choosing, by configuring the `publishPlugin.channels` property. For example: + ```groovy publishPlugin { channels 'beta' diff --git a/tutorials/custom_language_support/annotator.md b/tutorials/custom_language_support/annotator.md index 827be974b..c582b47cc 100644 --- a/tutorials/custom_language_support/annotator.md +++ b/tutorials/custom_language_support/annotator.md @@ -14,12 +14,14 @@ The `SimpleAnnotator` subclasses [`Annotator`](upsource:///platform/analysis-api Consider a literal string that starts with "simple:" as a prefix of a Simple Language key. It isn't part of the Simple Language, but it is a useful convention for detecting Simple Language keys embedded as string literals in other languages, like Java. Annotate the `simple:key` literal expression, and differentiate between a well-formed vs. an unresolved property: + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleAnnotator.java %} ``` ## 7.2. Register the Annotator Using the `com.intellij.annotator` extension point in the plugin configuration file, register the Simple Language annotator class with the IntelliJ Platform: + ```xml @@ -28,6 +30,7 @@ Using the `com.intellij.annotator` extension point in the plugin configuration f ## 7.3. Run the Project As a test, define the following Java file containing a Simple Language `prefix:value` pair: + ```java public class Test { public static void main(String[] args) { diff --git a/tutorials/custom_language_support/code_style_settings.md b/tutorials/custom_language_support/code_style_settings.md index 2c734bc81..c8f15faaa 100644 --- a/tutorials/custom_language_support/code_style_settings.md +++ b/tutorials/custom_language_support/code_style_settings.md @@ -12,6 +12,7 @@ This example creates a settings/preferences page that uses the default language ## 16.1. Define Code Style Settings Define a code style settings for Simple Language by subclassing [`CustomCodeStyleSettings`](upsource:///platform/lang-api/src/com/intellij/psi/codeStyle/CustomCodeStyleSettings.java). + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleCodeStyleSettings.java %} ``` @@ -19,12 +20,14 @@ Define a code style settings for Simple Language by subclassing [`CustomCodeStyl ## 16.2. 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 a code style settings provider for Simple Language by subclassing [`CodeStyleSettingsProvider`](upsource:///platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsProvider.java). + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleCodeStyleSettingsProvider.java %} ``` ## 16.3. 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. + ```xml @@ -33,12 +36,14 @@ The `SimpleCodeStyleSettingsProvider` implementation is registered with the Inte ## 16.4. Define the Language Code Style Settings Provider Define a code style settings provider for Simple Language by subclassing [`LanguageCodeStyleSettingsProvider`](upsource:///platform/lang-api/src/com/intellij/psi/codeStyle/LanguageCodeStyleSettingsProvider.java), which provides common code style settings for a specific language. + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleLanguageCodeStyleSettingsProvider.java %} ``` ## 16.5. 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. + ```xml diff --git a/tutorials/custom_language_support/completion_contributor.md b/tutorials/custom_language_support/completion_contributor.md index ddc23979d..97ef7e2e1 100644 --- a/tutorials/custom_language_support/completion_contributor.md +++ b/tutorials/custom_language_support/completion_contributor.md @@ -13,12 +13,14 @@ The Simple Language plugin implements the less complex of the two methods, refer For this tutorial, the `simple_language_plugin` provides custom completion for values in Simple Language property files. Create a completion contributor by subclassing [`CompletionContributor`](upsource:///platform/analysis-api/src/com/intellij/codeInsight/completion/CompletionContributor.java). This rudimentary completion contributor always adds "Hello" to the results set, regardless of context: + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleCompletionContributor.java %} ``` ## 9.2. Register the Completion Contributor The `SimpleCompletionContributor` implementation is registered in the plugin configuration file with the IntelliJ Platform using the `com.intellij.completion.contributor` extension point. + ```xml diff --git a/tutorials/custom_language_support/lexer_and_parser_definition.md b/tutorials/custom_language_support/lexer_and_parser_definition.md index 52e528b65..9c1990d31 100644 --- a/tutorials/custom_language_support/lexer_and_parser_definition.md +++ b/tutorials/custom_language_support/lexer_and_parser_definition.md @@ -11,6 +11,7 @@ The easiest way to create a lexer is to use [JFlex](https://jflex.de/). ## 4.1. Define a Lexer Define a `Simple.flex` file with rules for the Simple Language lexer, as demonstrated in `org.intellij.sdk.language.Simple.flex`. + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/Simple.flex %} ``` @@ -29,18 +30,21 @@ See [Implementing Lexer](/reference_guide/custom_language_support/implementing_l ## 4.3. Define a Lexer Adapter The JFlex lexer needs to be adapted to the IntelliJ Platform Lexer API. This is done by subclassing [`FlexAdapter`](upsource:///platform/core-api/src/com/intellij/lexer/FlexAdapter.java). + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleLexerAdapter.java %} ``` ## 4.4. Define a Root File The `SimpleFile` implementation is the top-level node of the [tree of `PsiElements`](/reference_guide/custom_language_support/implementing_parser_and_psi.md) for a Simple Language file. + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/psi/SimpleFile.java %} ``` ## 4.5. Define a Parser The Simple Language parser is defined by subclassing [`ParserDefinition`](upsource:///platform/core-api/src/com/intellij/lang/ParserDefinition.java). + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleParserDefinition.java %} ``` @@ -49,6 +53,7 @@ The Simple Language parser is defined by subclassing [`ParserDefinition`](upsour Registering the parser definition in the `plugin.xml` file makes it available to the IntelliJ Platform. Use the `com.intellij.lang.parserDefinition` extension point for registration. For example, see `simple_language_plugin/src/main/resources/META-INF/plugin.xml`. + ```xml @@ -134,12 +141,14 @@ The [Rename refactoring](https://www.jetbrains.com/help/idea/rename-refactorings Support for in-place refactoring is specified explicitly in a refactoring support provider. Create `SimpleRefactoringSupportProvider` by subclassing [`RefactoringSupportProvider`](upsource:///platform/lang-api/src/com/intellij/lang/refactoring/RefactoringSupportProvider.java) As long as an element is a `SimpleProperty` it is allowed to be refactored: + ```java {% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleRefactoringSupportProvider.java %} ``` ## 10.10. Register the Refactoring Support Provider The `SimpleRefactoringSupportProvider` implementation is registered with the IntelliJ Platform in the plugin configuration file using the `com.intellij.lang.refactoringSupport` extension point. + ```xml diff --git a/tutorials/editor_basics/coordinates_system.md b/tutorials/editor_basics/coordinates_system.md index 73157e6fb..acc2c581a 100644 --- a/tutorials/editor_basics/coordinates_system.md +++ b/tutorials/editor_basics/coordinates_system.md @@ -166,6 +166,7 @@ Starting on the left end of the line, and using the arrow key to advance a line- System.out.println( str ); } ``` + The apparent discontinuity in Logical Position is because the RTL portion of the string is treated (or counted) in the logical character order in which it would be written. The apparent continuity in Visual Position is because the RTL portion of the string is counted in the visual order in which it is displayed in the code. diff --git a/tutorials/kotlin.md b/tutorials/kotlin.md index 8b7a499b6..2014b58aa 100644 --- a/tutorials/kotlin.md +++ b/tutorials/kotlin.md @@ -12,7 +12,7 @@ In addition to [null safety](https://kotlinlang.org/docs/reference/null-safety.h Likewise, it is easy to customize the behavior of internal classes in IntelliJ IDEA, with [extensions](https://kotlinlang.org/docs/reference/extensions.html). For example, it is common practice to [guard logging statements](https://www.slf4j.org/faq.html#logging_performance) to avoid the cost of parameter construction, leading to the following ceremony when using the log: ```java -if(logger.isDebugEnabled()) { +if (logger.isDebugEnabled()) { logger.debug("..."); } ``` diff --git a/tutorials/live_templates.md b/tutorials/live_templates.md index 0c66e0586..80fb7dea8 100644 --- a/tutorials/live_templates.md +++ b/tutorials/live_templates.md @@ -8,6 +8,7 @@ When a user types the designated abbreviation followed by a configurable *expans For example, consider a `for` loop. Typically, the end user would need to type `for(int i = 0; i < 10; i++) {}`. This pattern may be shortened to `fori` and the remaining contents will be expanded, leaving the following structure: + ``` for(int i = [|]; i < []; i++) { [] diff --git a/tutorials/live_templates/new_macros.md b/tutorials/live_templates/new_macros.md index 7760bfac5..d007764b9 100644 --- a/tutorials/live_templates/new_macros.md +++ b/tutorials/live_templates/new_macros.md @@ -34,6 +34,7 @@ The XML representation of an example Live Template using the new `titleCase` fun There is only one variable, `TITLE`. The expression for `TITLE` evaluates to the `titleCase` function provided by the plugin. The argument to the `titleCase` function is `SELECTION`, which tells the IntelliJ Platform to operate on the current selection. + ```xml