mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
Merge branch 'master' into IJSDK-118
This commit is contained in:
commit
670af0fa34
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="comparing_references_inspection" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="comparing_references_inspection" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="comparing_references_inspection" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="conditional_operator_intention" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="conditional_operator_intention" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="conditional_operator_intention" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
8
.idea/runConfigurations/framework.xml
generated
8
.idea/runConfigurations/framework.xml
generated
@ -1,8 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="framework" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<module name="framework" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/live_templates.xml
generated
10
.idea/runConfigurations/live_templates.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="live_templates" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="live_templates" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="live_templates" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
11
.idea/runConfigurations/max_opened_projects.xml
generated
Normal file
11
.idea/runConfigurations/max_opened_projects.xml
generated
Normal file
@ -0,0 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="max_opened_projects" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="max_opened_projects" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/module.xml
generated
10
.idea/runConfigurations/module.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="module" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="module" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="module" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/plugin_sample.xml
generated
10
.idea/runConfigurations/plugin_sample.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="plugin_sample" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="plugin_sample" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="plugin_sample" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
9
.idea/runConfigurations/project_model.xml
generated
9
.idea/runConfigurations/project_model.xml
generated
@ -1,8 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="project_model" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="project_model" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="project_model" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<method />
|
||||
<predefined_log_file enabled="true" id="idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/project_view_pane.xml
generated
10
.idea/runConfigurations/project_view_pane.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="project_view_pane" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="project_view_pane" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="project_view_pane" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/project_wizard.xml
generated
10
.idea/runConfigurations/project_wizard.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="project_wizard" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="project_wizard" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="project_wizard" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/psi_demo.xml
generated
10
.idea/runConfigurations/psi_demo.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="psi_demo" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="psi_demo" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="psi_demo" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<predefined_log_file id="idea.log" enabled="true" />
|
||||
<method />
|
||||
<predefined_log_file enabled="true" id="idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/register_actions.xml
generated
10
.idea/runConfigurations/register_actions.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="register_actions" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="register_actions" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="register_actions" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/Library/Caches/IntelliJIdea16/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/Library/Caches/IntelliJIdea16/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/run_configuration.xml
generated
10
.idea/runConfigurations/run_configuration.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="run_configuration" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="run_configuration" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="run_configuration" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
@ -1,8 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="simple_language_plugin" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="simple_language_plugin" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="simple_language_plugin" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<method />
|
||||
<predefined_log_file enabled="true" id="idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
14
.idea/runConfigurations/theme_basics.xml
generated
14
.idea/runConfigurations/theme_basics.xml
generated
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="theme_basics" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="theme_basics" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="theme_basics" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
|
||||
</component>
|
10
.idea/runConfigurations/tool_window.xml
generated
10
.idea/runConfigurations/tool_window.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="tool_window" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="tool_window" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="tool_window" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/tree_structure_provider.xml
generated
10
.idea/runConfigurations/tree_structure_provider.xml
generated
@ -1,9 +1,11 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="tree_structure_provider" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<configuration default="false" name="tree_structure_provider" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
||||
<module name="tree_structure_provider" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxMetaspaceSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
<log_file checked="false" alias="IDEA LOG" path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
17
_SUMMARY.md
17
_SUMMARY.md
@ -33,10 +33,12 @@
|
||||
* [Plugin Structure](basics/plugin_structure.md)
|
||||
* [Plugin Content](basics/plugin_structure/plugin_content.md)
|
||||
* [Plugin Class Loaders](basics/plugin_structure/plugin_class_loaders.md)
|
||||
* [Plugin Components](basics/plugin_structure/plugin_components.md)
|
||||
* [Plugin Services](basics/plugin_structure/plugin_services.md)
|
||||
* [Plugin Extensions and Extension Points](basics/plugin_structure/plugin_extensions_and_extension_points.md)
|
||||
* [Plugin Actions](basics/plugin_structure/plugin_actions.md)
|
||||
* [Plugin Extensions](basics/plugin_structure/plugin_extensions.md)
|
||||
* [Plugin Services](basics/plugin_structure/plugin_services.md)
|
||||
* [Plugin Listeners](basics/plugin_structure/plugin_listeners.md)
|
||||
* [Plugin Extension Points](basics/plugin_structure/plugin_extension_points.md)
|
||||
* [Plugin Components](basics/plugin_structure/plugin_components.md)
|
||||
* [Plugin Configuration File](basics/plugin_structure/plugin_configuration_file.md)
|
||||
* [Plugin Logo (Icon)](basics/plugin_structure/plugin_icon_file.md)
|
||||
* [Plugin Dependencies](basics/plugin_structure/plugin_dependencies.md)
|
||||
@ -163,7 +165,7 @@
|
||||
|
||||
## Part VI - Testing
|
||||
|
||||
* [Testing Plugins](basics/testing_plugins.md)
|
||||
* [Testing Plugins](basics/testing_plugins/testing_plugins.md)
|
||||
* [Tests and Fixtures](basics/testing_plugins/tests_and_fixtures.md)
|
||||
* [Light and Heavy Tests](basics/testing_plugins/light_and_heavy_tests.md)
|
||||
* [Test Project and Testdata Directories](basics/testing_plugins/test_project_and_testdata_directories.md)
|
||||
@ -188,7 +190,6 @@
|
||||
* [Go to Class and Go to Symbol](reference_guide/custom_language_support/go_to_class_and_go_to_symbol.md)
|
||||
* [Documentation](reference_guide/custom_language_support/documentation.md)
|
||||
* [Additional Minor Features](reference_guide/custom_language_support/additional_minor_features.md)
|
||||
* To do Explorer
|
||||
* Parameter Info
|
||||
* Parameter Hints
|
||||
* [Custom Language Support Tutorial](tutorials/custom_language_support_tutorial.md)
|
||||
@ -234,7 +235,7 @@
|
||||
* AppCode
|
||||
* [CLion](products/clion.md)
|
||||
* DataGrip
|
||||
* GoLand
|
||||
* [GoLand](products/goland.md)
|
||||
* [IntelliJ IDEA](products/idea.md)
|
||||
* [Tomcat Integration](reference_guide/tomcat_integration.md)
|
||||
* [Spring API](reference_guide/frameworks_and_external_apis/spring_api.md)
|
||||
@ -244,8 +245,8 @@
|
||||
* [Existing Third Party Plugins](products/phpstorm/existing_plugins.md)
|
||||
* [PyCharm](products/pycharm.md)
|
||||
* [Rider](products/rider.md)
|
||||
* RubyMine
|
||||
* WebStorm
|
||||
* [RubyMine](products/rubymine.md)
|
||||
* [WebStorm](products/webstorm.md)
|
||||
|
||||
## Part IX - Custom IDEs
|
||||
* Build Your Own IDE
|
||||
|
@ -8,11 +8,14 @@ baseurl: /intellij/sdk/docs/
|
||||
|
||||
description: Documentation for working with and extending the IntelliJ Platform SDK
|
||||
|
||||
# This is tag 192.5728.98 (2019.2)
|
||||
# This is tag 193.5233.102 (2019.3)
|
||||
upsource:
|
||||
server: upsource.jetbrains.com
|
||||
repo: idea-ce
|
||||
commit: e97504227f5f68c58cd623c8f317a134b6d440b5
|
||||
commit: 37502bec42258b27d4547dbe8593ba3427bfcc49
|
||||
|
||||
github_repo: JetBrains/intellij-sdk-docs
|
||||
youtrack_project: IJSDK
|
||||
|
||||
exclude:
|
||||
- code_samples
|
@ -10,7 +10,7 @@ For example, one of the action classes is responsible for the **File \| Open Fil
|
||||
Actions are organized into groups, which, in turn, can contain other groups. A group of actions can form a toolbar or a menu.
|
||||
Subgroups of the group can form submenus of the menu.
|
||||
|
||||
Every action and action group has an unique identifier. Identifiers of many of the standard IDEA actions are defined in the [IdeActions](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java) class.
|
||||
Every action and action group has an unique identifier. Identifiers of many of the standard IDEA actions are defined in the [`IdeActions`](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java) class.
|
||||
|
||||
Every action can be included in multiple groups, and thus appear in multiple places within the IDEA user interface. Different places where actions can appear are defined by constants in the [`ActionPlaces`](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java) interface. For every place where the action appears, a new [`Presentation`](upsource:///platform/platform-api/src/com/intellij/ide/presentation/Presentation.java) is created. Thus, the same action can have different text or icons when it appears in different places of the user interface. Different presentations for the action are created by copying the presentation returned by the `AnAction.getTemplatePresentation()` method.
|
||||
|
||||
@ -130,62 +130,8 @@ Registering actions in `plugin.xml` is demonstrated in the following example. Th
|
||||
|
||||
To register an action from code, two steps are required.
|
||||
|
||||
* First, an instance of the class derived from `AnAction` must be passed to the `registerAction` method of the [ActionManager](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionManager.java) class, to associate the action with an ID.
|
||||
* Second, the action needs to be added to one or more groups. To get an instance of an action group by ID, it is necessary to call `ActionManager.getAction()` and cast the returned value to the [DefaultActionGroup](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/DefaultActionGroup.java) class.
|
||||
|
||||
You can create a plugin that registers actions on IDEA startup using the following procedure.
|
||||
|
||||
**To register an action on IDEA startup**
|
||||
|
||||
* Create a new class that implements the [`ApplicationComponent`](upsource:///platform/core-api/src/com/intellij/openapi/components/ApplicationComponent.java) interface.
|
||||
* In this class, override the `getComponentName`, `initComponent`, and `disposeComponent` methods.
|
||||
* Register this class in the `<application-components>` section of the plugin.xml file.
|
||||
|
||||
To clarify the above procedure, consider the following sample Java class `MyPluginRegistration` that registers an action defined in a custom `TextBoxes` class and adds a new menu command to the *Window* menu group on the main menu:
|
||||
|
||||
```java
|
||||
public class MyPluginRegistration implements ApplicationComponent {
|
||||
// Returns the component name (any unique string value).
|
||||
@NotNull public String getComponentName() {
|
||||
return "MyPlugin";
|
||||
}
|
||||
|
||||
|
||||
// If you register the MyPluginRegistration class in the <application-components> section of
|
||||
// the plugin.xml file, this method is called on IDEA start-up.
|
||||
public void initComponent() {
|
||||
ActionManager am = ActionManager.getInstance();
|
||||
TextBoxes action = new TextBoxes();
|
||||
|
||||
// Passes an instance of your custom TextBoxes class to the registerAction method of the ActionManager class.
|
||||
am.registerAction("MyPluginAction", action);
|
||||
|
||||
// Gets an instance of the WindowMenu action group.
|
||||
DefaultActionGroup windowM = (DefaultActionGroup) am.getAction("WindowMenu");
|
||||
|
||||
// Adds a separator and a new menu command to the WindowMenu group on the main menu.
|
||||
windowM.addSeparator();
|
||||
windowM.add(action);
|
||||
}
|
||||
|
||||
// Disposes system resources.
|
||||
public void disposeComponent() {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Note, that the sample `TextBoxes` class is described in [Getting Started with Plugin Development](/basics/getting_started.md).
|
||||
|
||||
To ensure that your plugin is initialized on IDEA start-up, make the following changes to the `<application-components>` section of the `plugin.xml` file:
|
||||
|
||||
```xml
|
||||
<application-components>
|
||||
<!-- Add your application components here -->
|
||||
<component>
|
||||
<implementation-class>MypackageName.MyPluginRegistration</implementation-class>
|
||||
</component>
|
||||
</application-components>
|
||||
```
|
||||
* First, an instance of the class derived from `AnAction` must be passed to the `registerAction` method of the [`ActionManager`](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionManager.java) class, to associate the action with an ID.
|
||||
* Second, the action needs to be added to one or more groups. To get an instance of an action group by ID, it is necessary to call `ActionManager.getAction()` and cast the returned value to the [`DefaultActionGroup`](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/DefaultActionGroup.java) class.
|
||||
|
||||
## Building UI from Actions
|
||||
|
||||
|
@ -2,40 +2,36 @@
|
||||
title: File View Providers
|
||||
---
|
||||
|
||||
A file view provider (see the [FileViewProvider](upsource:///platform/core-api/src/com/intellij/psi/FileViewProvider.java) class) was introduced in *IntelliJ IDEA* 6.0. Its main purpose is to manage access to multiple PSI trees within a single file.
|
||||
A file view provider ([`FileViewProvider`](upsource:///platform/core-api/src/com/intellij/psi/FileViewProvider.java)) manages access to multiple PSI trees within a single file.
|
||||
|
||||
For example, a JSPX page has a separate PSI tree for the Java code in it (`PsiJavaFile`), a separate tree for the XML code (`XmlFile`), and a separate tree for JSP as a whole [JspFile](upsource:///java/jsp-openapi/src/com/intellij/psi/jsp/JspFile.java)).
|
||||
For example, a JSPX page has a separate PSI tree for the Java code in it (`PsiJavaFile`), a separate tree for the XML code (`XmlFile`), and a separate tree for JSP as a whole [`JspFile`](upsource:///java/jsp-openapi/src/com/intellij/psi/jsp/JspFile.java)).
|
||||
|
||||
Each of the PSI trees covers the entire contents of the file, and contains special "outer language elements" in the places where contents in a different language can be found.
|
||||
|
||||
A [`FileViewProvider`](upsource:///platform/core-api/src/com/intellij/psi/FileViewProvider.java) instance corresponds to a single `VirtualFile`, a single `Document`, and can be used to retrieve multiple `PsiFile` instances.
|
||||
A `FileViewProvider` instance corresponds to a single `VirtualFile`, a single `Document`, and can be used to retrieve multiple `PsiFile` instances.
|
||||
|
||||
## How do I get an FVP?
|
||||
## How do I get a FileViewProvider?
|
||||
|
||||
* From a VirtualFile: `PsiManager.getInstance(project).findViewProvider()`
|
||||
* From a PSI file: `psiFile.getViewProvider()`
|
||||
* From a `VirtualFile`: `PsiManager.getInstance(project).findViewProvider()`
|
||||
* From a `PsiFile`: `psiFile.getViewProvider()`
|
||||
|
||||
## What can I do with an FVP?
|
||||
## What can I do with a FileViewProvider?
|
||||
|
||||
* To get the set of all languages for which PSI trees exist in a file: `fileViewProvider.getLanguages()`
|
||||
* To get the PSI tree for a particular language: `fileViewProvider.getPsi(language)`, where the `language` parameter can take values of the [Language](upsource:///platform/core-api/src/com/intellij/lang/Language.java) type defined in [StdLanguages](upsource:///platform/platform-api/src/com/intellij/lang/StdLanguages.java) class. For example, to get the PSI tree for XML, use `fileViewProvider.getPsi(StdLanguages.XML)`.
|
||||
* To get the PSI tree for a particular language: `fileViewProvider.getPsi(language)`. For example, to get the PSI tree for XML, use `fileViewProvider.getPsi(XMLLanguage.INSTANCE)`.
|
||||
* To find an element of a particular language at the specified offset in the file: `fileViewProvider.findElementAt(offset, language)`
|
||||
|
||||
## How do I extend the FileViewProvider?
|
||||
|
||||
To create a file type that has multiple interspersing trees for different languages, your plugin must contain an extension to the `fileType.fileViewProviderFactory` [extension point](/basics/plugin_structure/plugin_extensions_and_extension_points.md) available in the *IntelliJ Platform* core.
|
||||
To create a file type that has multiple interspersing trees for different languages, a plugin must contain an extension to the `com.intellij.fileType.fileViewProviderFactory` extension point.
|
||||
|
||||
This extension point is declared using the [FileTypeExtensionPoint](upsource:///platform/core-api/src/com/intellij/openapi/fileTypes/FileTypeExtensionPoint.java)
|
||||
bean class.
|
||||
|
||||
To access this extension point, create a Java class that implements the [FileViewProviderFactory](upsource:///platform/core-api/src/com/intellij/psi/FileViewProviderFactory.java) interface, and in this class, override the `createFileViewProvider` method.
|
||||
|
||||
To declare the extension to the `fileType.fileViewProviderFactory` extension point, add the following syntax to the `<extensions>` section of the `plugin.xml` file:
|
||||
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
|
||||
<extensions>
|
||||
<fileType.fileViewProviderFactory filetype="%file_type%" implementationClass="%class_name%" />
|
||||
<fileType.fileViewProviderFactory filetype="%file_type%" implementationClass="com.plugin.MyFileViewProviderFactory" />
|
||||
</extensions>
|
||||
```
|
||||
|
||||
Where `%file_type%` refers to the type of the file being created (for example, "JFS"), and the `%class_name%` refers to the name of your Java class that implements the [`FileViewProviderFactory`](upsource:///platform/core-api/src/com/intellij/psi/FileViewProviderFactory.java) interface.
|
||||
Where `%file_type%` refers to the type of the file being created (for example, "JFS").
|
@ -17,20 +17,20 @@ for more information on commands and write actions.
|
||||
## Creating the New PSI
|
||||
|
||||
The PSI elements to add to the tree, or to replace existing PSI elements, are normally *created from text*.
|
||||
In the most general case, you use the `createFileFromText` method of [`PsiFileFactory`](upsource:///platform/core-api/src/com/intellij/psi/PsiFileFactory.java)
|
||||
In the most general case, you use the `createFileFromText()` method of [`PsiFileFactory`](upsource:///platform/core-api/src/com/intellij/psi/PsiFileFactory.java)
|
||||
to create a new file that contains the code construct which you need to add to the tree or to use as a replacement
|
||||
for an existing element, traverse the resulting tree to locate the specific element that you need, and then pass that
|
||||
element to `add()` or `replace()`.
|
||||
|
||||
Most languages provide factory methods which let you create specific code constructs more easily. For example,
|
||||
the [`PsiJavaParserFacade`](upsource:///java/java-psi-api/src/com/intellij/psi/PsiJavaParserFacade.java) class
|
||||
contains methods such as `createMethodFromText`, which creates a Java method from the given text.
|
||||
contains methods such as `createMethodFromText()`, which creates a Java method from the given text.
|
||||
|
||||
When you're implementing refactorings, intentions or inspection quickfixes that work with existing code, the text that
|
||||
you pass to the various `createFromText` methods will combine hard-coded fragments and fragments of code taken from
|
||||
you pass to the various `createFromText()` methods will combine hard-coded fragments and fragments of code taken from
|
||||
the existing file. For small code fragments (individual identifiers), you can simply append the text from the existing
|
||||
code to the text of the code fragment you're building. In that case, you need to make sure that the resulting text is
|
||||
syntactically correct, otherwise the `createFromText` method will throw an exception.
|
||||
syntactically correct, otherwise the `createFromText()` method will throw an exception.
|
||||
|
||||
For larger code fragments, it's best to perform the modification in several steps:
|
||||
|
||||
@ -63,7 +63,7 @@ equalsCall.getArgumentList().getExpressions()[0].replace(rExpr);
|
||||
PsiExpression result = (PsiExpression) binaryExpression.replace(equalsCall);
|
||||
```
|
||||
|
||||
Just as everywhere else in the IntelliJ Platform API, the text passed to `createFileFromText` and other `createFromText`
|
||||
Just as everywhere else in the IntelliJ Platform API, the text passed to `createFileFromText()` and other `createFromText()`
|
||||
methods must use only `\n` as line separators.
|
||||
|
||||
|
||||
@ -101,6 +101,6 @@ the user's code style settings and inserted into the correct place of the file.
|
||||
In some cases, you need to perform a PSI modification and then to perform an operation on the document you've just
|
||||
modified through the PSI (for example, start a live template). In this case, you need to call a special method that
|
||||
completes the PSI-based post-processing (such as formatting) and commits the changes to the document. The method
|
||||
you need to call is called `doPostponedOperationsAndUnblockDocument`, and it's defined in the
|
||||
you need to call is called `doPostponedOperationsAndUnblockDocument()`, and it's defined in the
|
||||
[`PsiDocumentManager`](upsource:///platform/core-api/src/com/intellij/psi/PsiDocumentManager.java) class.
|
||||
|
||||
|
@ -5,9 +5,9 @@ title: Navigating the PSI
|
||||
There are three main ways to navigate the PSI: *top-down*, *bottom-up*, and using *references*. In the first scenario,
|
||||
you have a PSI file or another higher-level element (for example, a method), and you need to find all elements that match a
|
||||
specified condition (for example, all variable declarations). In the second scenario, you have a specific point
|
||||
in the PSI tree (for example, the element at caret), and need to find out something about its context (for example,
|
||||
in the PSI tree (for example, the element at caret) and need to find out something about its context (for example,
|
||||
the element in which it has been declared). Finally, *references* allow you to navigate from the use of an element
|
||||
(e.g. a method call) to the declaration (the method being called) and back. References are described in a
|
||||
(e.g., a method call) to the declaration (the method being called) and back. References are described in a
|
||||
[separate topic](psi_references.md).
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ file.accept(new JavaRecursiveElementVisitor() {
|
||||
In many cases, you can also use more specific APIs for top-down navigation. For example, if you need to get a list of
|
||||
all methods in a Java class, you can do that using a visitor, but a much easier way to do that is to call `PsiClass.getMethods()`.
|
||||
|
||||
The [PsiTreeUtil class](upsource:///platform/core-api/src/com/intellij/psi/util/PsiTreeUtil.java) contains a number of
|
||||
[`PsiTreeUtil`](upsource:///platform/core-api/src/com/intellij/psi/util/PsiTreeUtil.java) contains a number of
|
||||
general-purpose, language-independent functions for PSI tree navigation, some of which (for example, `findChildrenOfType`)
|
||||
perform top-down navigation.
|
||||
|
||||
|
@ -6,7 +6,7 @@ A PSI (Program Structure Interface) file represents a hierarchy of PSI elements
|
||||
|
||||
PSI elements and operations at the level of individual PSI elements are used to explore the internal structure of source code as it is interpreted by the **IntelliJ Platform**. For example, you can use PSI elements to perform code analysis, such as [code inspections](https://www.jetbrains.com/help/idea/code-inspection.html) or [intention actions](https://www.jetbrains.com/idea/help/intention-actions.html).
|
||||
|
||||
The [PsiElement](upsource:///platform/core-api/src/com/intellij/psi/PsiElement.java) class is the common base class for PSI elements.
|
||||
The [`PsiElement`](upsource:///platform/core-api/src/com/intellij/psi/PsiElement.java) class is the common base class for PSI elements.
|
||||
|
||||
## How do I get a PSI element?
|
||||
|
||||
|
@ -4,7 +4,7 @@ title: PSI Files
|
||||
|
||||
A PSI (Program Structure Interface) file is the root of a structure representing the contents of a file as a hierarchy of elements in a particular programming language.
|
||||
|
||||
The [PsiFile](upsource:///platform/core-api/src/com/intellij/psi/PsiFile.java) class is the common base class for all PSI files, while files in a specific language are usually represented by its subclasses. For example, the [PsiJavaFile](upsource:///java/java-psi-api/src/com/intellij/psi/PsiJavaFile.java) class represents a Java file, and the [XmlFile](upsource:///xml/xml-psi-api/src/com/intellij/psi/xml/XmlFile.java) class represents an XML file.
|
||||
The [`PsiFile`](upsource:///platform/core-api/src/com/intellij/psi/PsiFile.java) class is the common base class for all PSI files, while files in a specific language are usually represented by its subclasses. For example, the [PsiJavaFile](upsource:///java/java-psi-api/src/com/intellij/psi/PsiJavaFile.java) class represents a Java file, and the [XmlFile](upsource:///xml/xml-psi-api/src/com/intellij/psi/xml/XmlFile.java) class represents an XML file.
|
||||
|
||||
Unlike `VirtualFile` and `Document`, which have application scope (even if multiple projects are open, each file is represented by the same `VirtualFile` instance), PSI has project scope (the same file is represented by multiple `PsiFile` instances if the file belongs to multiple projects open at the same time).
|
||||
|
||||
@ -24,7 +24,7 @@ To iterate over the elements in a file, use `psiFile.accept(new PsiRecursiveElem
|
||||
|
||||
## Where does a PSI file come from?
|
||||
|
||||
As PSI is language-dependent, PSI files are created through the [Language](upsource:///platform/core-api/src/com/intellij/lang/Language.java) object, by using the `LanguageParserDefinitions.INSTANCE.forLanguage(language).createFile(fileViewProvider)` method.
|
||||
As PSI is language-dependent, PSI files are created through the [`Language`](upsource:///platform/core-api/src/com/intellij/lang/Language.java) object, by using the `LanguageParserDefinitions.INSTANCE.forLanguage(language).createFile(fileViewProvider)` method.
|
||||
|
||||
Like documents, PSI files are created on demand when the PSI is accessed for a particular file.
|
||||
|
||||
|
@ -36,6 +36,7 @@ The process of resolving references is distinct from parsing, and is not perform
|
||||
not always successful. If the code currently open in the IDE does not compile, or in other situations, it's normal
|
||||
for `PsiReference.resolve()` to return `null`, and if you work with references, you need to be able to handle that in your code.
|
||||
|
||||
> **TIP** Please see also _Cache results of heavy computations_ in [Working with PSI efficiently](/reference_guide/performance/performance.md#working-with-psi-efficiently).
|
||||
|
||||
## Contributed References
|
||||
|
||||
@ -75,7 +76,7 @@ To handle this, it provides a reference that can be resolved to multiple possibl
|
||||
Such references implement the [`PsiPolyVariantReference`](upsource:///platform/core-api/src/com/intellij/psi/PsiPolyVariantReference.java) interface.
|
||||
|
||||
For resolving a `PsiPolyVariantReference`, you call its `multiResolve()` method. The call returns an array of
|
||||
[`ResolveResult`](upsource:///platform/core-api/src/com/intellij/psi/PsiResolveResult.java) objects. Each of the
|
||||
[`ResolveResult`](upsource:///platform/core-api/src/com/intellij/psi/ResolveResult.java) objects. Each of the
|
||||
objects identifies a PSI element and also specifies whether the result is valid. For example, if you have multiple
|
||||
Java method overloads and a call with arguments not matching any of the overloads, you will get
|
||||
back `ResolveResult` objects for all of the overloads, and `isValidResult()` will return false for all of them.
|
||||
@ -87,7 +88,7 @@ As you already know, resolving a reference means going from a usage to the corre
|
||||
navigation in the opposite direction - from a declaration to its usages - you need to perform a **references search**.
|
||||
|
||||
To perform a references search, you use the
|
||||
[`ReferencesSearch`](upsource:///platform/indexing-api/com/intellij/psi/search/searches/ReferencesSearch.java) class.
|
||||
[`ReferencesSearch`](upsource:///platform/indexing-api/src/com/intellij/psi/search/searches/ReferencesSearch.java) class.
|
||||
To perform a search, you need to specify the *element* to search for, and optionally other parameters such as the
|
||||
scope in which the reference needs to be searched. You get back a *query* object that allows you to get all results
|
||||
as an array, or to iterate over the results one by one. If you don't need to collect all the results, it's more efficient
|
||||
|
@ -2,7 +2,7 @@
|
||||
title: Virtual Files
|
||||
---
|
||||
|
||||
A virtual file [com.intellij.openapi.vfs.VirtualFile](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java) is the *IntelliJ Platform's* representation of a file in a file system (VFS). Most commonly, a virtual file is a file in your local file system. However, the *IntelliJ Platform* supports multiple pluggable file system implementations, so virtual files can also represent classes in a JAR file, old revisions of files loaded from a version control repository, and so on.
|
||||
A virtual file [`VirtualFile`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java) is the *IntelliJ Platform's* representation of a file in a file system (VFS). Most commonly, a virtual file is a file in your local file system. However, the *IntelliJ Platform* supports multiple pluggable file system implementations, so virtual files can also represent classes in a JAR file, old revisions of files loaded from a version control repository, and so on.
|
||||
|
||||
The VFS level deals only with binary content. You can get or set the contents of a `VirtualFile` as a stream of bytes, but concepts like encodings and line separators are handled on higher system levels.
|
||||
|
||||
@ -35,19 +35,35 @@ If you do need to create a file through VFS, you can use the `VirtualFile.create
|
||||
|
||||
## How do I get notified when VFS changes?
|
||||
|
||||
The `VirtualFileManager.addVirtualFileListener()` method allows you to receive notifications about all changes in the VFS.
|
||||
> **NOTE** See [Virtual file system events](/basics/virtual_file_system.md#virtual-file-system-events) for important details.
|
||||
|
||||
Implement the [`BulkFileListener`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/newvfs/BulkFileListener.java) interface and subscribe to the [message bus](/reference_guide/messaging_infrastructure.md) topic `VirtualFileManager.VFS_CHANGES`. For example:
|
||||
|
||||
```java
|
||||
project.getMessageBus().connect().subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() {
|
||||
@Override
|
||||
public void after(@NotNull List<? extends VFileEvent> events) {
|
||||
// handle the events
|
||||
}
|
||||
});
|
||||
```
|
||||
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)
|
||||
|
||||
Plugins targeting versions 2017.2 or older of the platform can use the now deprecated `VirtualFileManager.addVirtualFileListener()` method which allows you to receive notifications about all changes in the VFS.
|
||||
|
||||
## Are there any utilities for analyzing and manipulating virtual files?
|
||||
|
||||
[`VfsUtil`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VfsUtil.java) and [`VfsUtilCore`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java) provide utility methods for analyzing files in the Virtual File System.
|
||||
[`VfsUtil`](upsource:///platform/analysis-api/src/com/intellij/openapi/vfs/VfsUtil.java) and [`VfsUtilCore`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VfsUtilCore.java) provide utility methods for analyzing files in the Virtual File System.
|
||||
|
||||
You can use [`ProjectLocator`](upsource:///platform/core-api/src/com/intellij/openapi/project/ProjectLocator.java) to find the projects that contain a given virtual file.
|
||||
You can use [`ProjectLocator`](upsource:///platform/projectModel-api/src/com/intellij/openapi/project/ProjectLocator.java) to find the projects that contain a given virtual file.
|
||||
|
||||
## How do I extend VFS?
|
||||
|
||||
To provide an alternative file system implementation (for example, an FTP file system), implement the [VirtualFileSystem](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFileSystem.java) class (most likely you'll also need to implement `VirtualFile`), and register your implementation as an [application component](/basics/plugin_structure/plugin_components.md).
|
||||
To provide an alternative file system implementation (for example, an FTP file system), implement the [`VirtualFileSystem`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFileSystem.java) class (most likely you'll also need to implement `VirtualFile`), and register your implementation as an [application component](/basics/plugin_structure/plugin_components.md).
|
||||
|
||||
To hook into operations performed in the local file system (for example, if you are developing a version control system integration that needs custom rename/move handling), implement the [LocalFileOperationsHandler](upsource:///platform/platform-api/src/com/intellij/openapi/vfs/LocalFileOperationsHandler.java) interface and register it through the`LocalFileSystem.registerAuxiliaryFileOperationsHandler` method.
|
||||
To hook into operations performed in the local file system (for example, if you are developing a version control system integration that needs custom rename/move handling), implement the [`LocalFileOperationsHandler`](upsource:///platform/analysis-api/src/com/intellij/openapi/vfs/LocalFileOperationsHandler.java) interface and register it through the`LocalFileSystem.registerAuxiliaryFileOperationsHandler` method.
|
||||
|
||||
## What are the rules for working with VFS?
|
||||
|
||||
|
@ -4,8 +4,13 @@ title: Creating Your First Plugin
|
||||
|
||||
This documentation section will help you get started with developing plugins for the *IntelliJ Platform*. You can use either [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/) or [IntelliJ IDEA Ultimate](https://www.jetbrains.com/idea/download/) as your IDE (it is highly recommended to use the latest available version). Both include the complete set of plugin development tools. To become more familiar with *IntelliJ IDEA*, please refer to the [IntelliJ IDEA Web Help](https://www.jetbrains.com/idea/help/).
|
||||
|
||||
There are two possible workflows for building plugins. The recommended workflow for new projects is
|
||||
to [use Gradle](#using-gradle). The old [Plugin DevKit](#using-devkit) workflow still supports existing projects.
|
||||
There are two supported workflows available for building plugins.
|
||||
The recommended workflow for new projects is to [use Gradle](#using-gradle).
|
||||
The old [Plugin DevKit](#using-devkit) workflow still supports existing projects.
|
||||
|
||||
If a new plugin will be Scala-based, a plugin development workflow [sbt-idea-plugin](https://github.com/JetBrains/sbt-idea-plugin), is available.
|
||||
The workflow is analogous to the Gradle workflow but tailored to developing IntelliJ Platform plugins in Scala.
|
||||
JetBrains does not officially support this Scala workflow, and at this time the workflow has only minimal documentation.
|
||||
|
||||
The Gradle workflow offers these advantages:
|
||||
* Gradle in general:
|
||||
|
@ -33,10 +33,12 @@ Multi-part build numbers can also be used in the `since-build` and `until-build`
|
||||
<idea-version since-build="162" until-build="162.*"/> <!-- any 162-based version, 162.94, 162.94.11, etc.-->
|
||||
```
|
||||
|
||||
>> **Tip** Specific build numbers and their corresponding release version are available via _Previous Releases_ on the corresponding product's download page, e.g. [Previous IntelliJ IDEA Releases](https://www.jetbrains.com/idea/download/previous.html).
|
||||
> **NOTE** Specific build numbers and their corresponding release version are available via _Previous Releases_ on the corresponding product's download page, e.g. [Previous IntelliJ IDEA Releases](https://www.jetbrains.com/idea/download/previous.html).
|
||||
|
||||
### IntelliJ Platform based products of recent IDE versions
|
||||
|
||||
> **TIP** Which versions should your plugin support? We've collected some insights based on download statistics in [Statistics: Product Versions in Use](https://plugins.jetbrains.com/docs/marketplace/product-versions-in-use-statistics.html).
|
||||
|
||||
| Branch number | IntelliJ Platform version |
|
||||
|-----------------------------------------------------------------|---------------------------|
|
||||
| [193](https://github.com/JetBrains/intellij-community/tree/193) | 2019.3 |
|
||||
|
@ -2,7 +2,7 @@
|
||||
title: Creating an action
|
||||
---
|
||||
|
||||
Your plugins can customize the IntelliJ Platform UI by adding new items to the menus and toolbars. The IntelliJ Platform provides the class [AnAction](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java), whose `actionPerformed` method is called each time you select a menu item or click a toolbar button.
|
||||
Your plugins can customize the IntelliJ Platform UI by adding new items to the menus and toolbars. The IntelliJ Platform provides the class [`AnAction`](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java), whose `actionPerformed` method is called each time you select a menu item or click a toolbar button.
|
||||
|
||||
To create custom actions in the *IntelliJ Platform*, you should perform two basic steps:
|
||||
|
||||
|
@ -98,7 +98,7 @@ Consequently, Java dependencies are expressed differently in `plugin.xml` depend
|
||||
* `build.gradle` _required_ to include `intellij.plugins 'java'`
|
||||
|
||||
## Exploring Module and Plugin APIs
|
||||
Once the [dependency on a module or plugin](/basics/plugin_structure/plugin_dependencies.md#) is declared in `plugin.xml`, it's useful to explore the packages and classes available in that dependency.
|
||||
Once the [dependency on a module or plugin](/basics/plugin_structure/plugin_dependencies.md) is declared in `plugin.xml`, it's useful to explore the packages and classes available in that dependency.
|
||||
The section below gives some recommended procedures for discovering what's available in a module or plugin on which a project depends.
|
||||
These procedures assume a project has the `build.gradle` and `plugin.xml` dependencies configured correctly.
|
||||
|
||||
@ -118,7 +118,7 @@ Expand the External Library (as shown) to reveal the JAR files contained in the
|
||||
Drill down into the JAR files to expose the packages and (decompiled) classes.
|
||||
|
||||
### Exploring APIs as an Extender
|
||||
If a project is dependent on a plugin or module, in some cases the project can also [extend](/basics/plugin_structure/plugin_extensions_and_extension_points.md) the functionality available from the plugin or module.
|
||||
If a project is dependent on a plugin or module, in some cases the project can also [extend](/basics/plugin_structure/plugin_extensions.md) the functionality available from the plugin or module.
|
||||
|
||||
To browse the opportunities for extension, start by placing the cursor on the contents of the `<depends>` elements in the project's `plugin.xml` file.
|
||||
Use the [Go to Declaration](https://www.jetbrains.com/help/idea/navigating-through-the-source-code.html#go_to_declaration) IDE feature to navigate to the `plugin.xml` file for the plugin on which the project depends.
|
||||
|
@ -15,11 +15,12 @@ File-based indexes are built directly over the content of files. Stub indexes ar
|
||||
|
||||
Querying a file-based index gets you the set of files matching a certain condition. Querying a stub index gets you the set of matching PSI elements. Therefore, custom language plugin developers should typically use stub indexes in their plugin implementations.
|
||||
|
||||
>> **TIP** [Indices Viewer](https://plugins.jetbrains.com/plugin/13029-indices-viewer/) is a plugin that helps inspecting indices' contents and properties.
|
||||
>> **TIP** [Indices Viewer](https://plugins.jetbrains.com/plugin/13029-indices-viewer/) is a plugin that helps inspecting indices' contents and properties.
|
||||
Please see also [Improving indexing performance](/reference_guide/performance/performance.md#improving-indexing-performance).
|
||||
|
||||
## Dumb mode
|
||||
|
||||
Indexing is a potentially long process. It's performed in background, and during this time, IDE's features are restricted to the ones that don't require index: basic text editing, version control etc. This restriction is managed by [DumbService](upsource:///platform/core-api/src/com/intellij/openapi/project/DumbService.java).
|
||||
Indexing is a potentially long process. It's performed in background, and during this time, IDE's features are restricted to the ones that don't require index: basic text editing, version control etc. This restriction is managed by [`DumbService`](upsource:///platform/core-api/src/com/intellij/openapi/project/DumbService.java).
|
||||
|
||||
`DumbService` provides API to query whether the IDE is currently in "dumb" mode (where index access is not allowed) or "smart" mode (with all index built and ready to use). It also provides ways of delaying code execution until indices are ready. Please see its javadoc for more details.
|
||||
|
||||
@ -31,4 +32,4 @@ Sometimes, the following conditions hold:
|
||||
* eagerly calculating the data for the entire project during indexing isn't needed (e.g. it slows down the indexing, and/or this data probably will ever be needed for a minor subset of all project files)
|
||||
* the data can be recalculated lazily on request without major performance penalties
|
||||
|
||||
In such cases, file-based index can be used, but file gists provide a way to perform data calculation lazily, caching on disk, and a more lightweight API. Please see [VirtualFileGist](upsource:///platform/indexing-api/src/com/intellij/util/gist/VirtualFileGist.java) and [PsiFileGist](upsource:///platform/indexing-api/src/com/intellij/util/gist/PsiFileGist.java) documentation.
|
||||
In such cases, file-based index can be used, but file gists provide a way to perform data calculation lazily, caching on disk, and a more lightweight API. Please see [`VirtualFileGist`](upsource:///platform/indexing-api/src/com/intellij/util/gist/VirtualFileGist.java) and [`PsiFileGist`](upsource:///platform/indexing-api/src/com/intellij/util/gist/PsiFileGist.java) documentation.
|
||||
|
@ -22,7 +22,7 @@ When you access the index, you specify the key that you're interested in and get
|
||||
|
||||
A fairly simple file-based index implementation is the [UI Designer bound forms index](upsource:///plugins/ui-designer/src/com/intellij/uiDesigner/binding/FormClassIndex.java). Refer to it as an example to understand this topic better.
|
||||
|
||||
Each specific index implementation is a class extending [FileBasedIndexExtension](upsource:///platform/indexing-api/src/com/intellij/util/indexing/FileBasedIndexExtension.java). A file-based index should be registered in the `<fileBasedIndex>` extension point.
|
||||
Each specific index implementation is a class extending [`FileBasedIndexExtension`](upsource:///platform/indexing-api/src/com/intellij/util/indexing/FileBasedIndexExtension.java). A file-based index should be registered in the `com.intellij.fileBasedIndex` extension point.
|
||||
|
||||
An implementation of a file-based index consists of the following main parts:
|
||||
|
||||
@ -34,15 +34,15 @@ An implementation of a file-based index consists of the following main parts:
|
||||
* `getInputFilter()` allows to restrict the indexing only to a certain set of files.
|
||||
* `getVersion()` returns the version of the index implementation. The index is automatically rebuilt if the current version differs from the version of the index implementation used to build the index.
|
||||
|
||||
If you don't need to associate any value with the files (i.e. your value type is Void), you can simplify the implementation by using [ScalarIndexExtension](upsource:///platform/indexing-impl/src/com/intellij/util/indexing/ScalarIndexExtension.java) as the base class.
|
||||
If you don't need to associate any value with the files (i.e. your value type is Void), you can simplify the implementation by using [`ScalarIndexExtension`](upsource:///platform/indexing-impl/src/com/intellij/util/indexing/ScalarIndexExtension.java) as the base class.
|
||||
|
||||
> **Note** The data returned by `DataIndexer.map()` must depend only on input data passed to the method, and must not depend on any external files. Otherwise your index will not be correctly updated when the external data changes, and you will have stale data in your index.
|
||||
> **WARNING** The data returned by `DataIndexer.map()` must depend only on input data passed to the method, and must not depend on any external files. Otherwise your index will not be correctly updated when the external data changes, and you will have stale data in your index.
|
||||
|
||||
> **Note** Please see `com.intellij.util.indexing.DebugAssertions` on how to enable additional debugging assertions during development to assert correct index implementation.
|
||||
|
||||
## Accessing a file-based index
|
||||
|
||||
Access to file-based indexes is performed through the [FileBasedIndex](upsource:///platform/indexing-api/src/com/intellij/util/indexing/FileBasedIndex.java) class.
|
||||
Access to file-based indexes is performed through the [`FileBasedIndex`](upsource:///platform/indexing-api/src/com/intellij/util/indexing/FileBasedIndex.java) class.
|
||||
|
||||
The following primary operations are supported:
|
||||
|
||||
@ -54,7 +54,7 @@ The following primary operations are supported:
|
||||
* `getContainingFiles()` allows to obtain all files in which a specific key was encountered.
|
||||
* `processValues()` allows to iterate though all files in which a specific key was encountered and to access the associated values at the same time.
|
||||
|
||||
> **Note** Nested index access is forbidden as it might lead to a deadlock. Collect all necessary data from index A first, then process results while accessing index B.
|
||||
> **WARNING** Nested index access is forbidden as it might lead to a deadlock. Collect all necessary data from index A first, then process results while accessing index B.
|
||||
|
||||
## Standard indexes
|
||||
|
||||
|
@ -20,12 +20,12 @@ For each element type that you want to store in the stub tree, you need to perfo
|
||||
* Make sure that the implementation class for the PSI element extends [`StubBasedPsiElementBase`](upsource:///platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java) parameterized by the type of the stub interface ([example](upsource:///plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImpl.java)<!--#L45-->). Provide both a constructor that accepts an `ASTNode` and a constructor which accepts a stub.
|
||||
* Create a class which implements `IStubElementType` and is parameterized with the stub interface and the actual PSI element interface ([example](upsource:///plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/parsing/PropertyStubElementType.java)). Implement the `createPsi()` and `createStub()` methods for creating PSI from a stub and vice versa. Implement the `serialize()` and `deserialize()` methods for storing the data in a binary stream.
|
||||
* Use the class implementing `IStubElementType` as the element type constant when parsing ([example](upsource:///plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/parsing/PropertiesElementTypes.java)).
|
||||
* Make sure that all methods in the PSI element interface access the stub data rather than the PSI tree when appropriate ([example: Property.getKey() implementation](upsource:///plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImpl.java)<!--#L95-->).
|
||||
* Make sure that all methods in the PSI element interface access the stub data rather than the PSI tree when appropriate ([example: `Property.getKey()` implementation](upsource:///plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImpl.java)<!--#L95-->).
|
||||
|
||||
The following steps need to be performed only once for each language that supports stubs:
|
||||
|
||||
* Change the file element type for your language (the element type that you return from `ParserDefinition.getFileNodeType()`) to a class that extends `IStubFileElementType`.
|
||||
* In your `plugin.xml`, define the `<stubElementTypeHolder>` extension and specify the interface which contains the `IElementType` constants used by your language's parser ([example](upsource:///plugins/properties/src/META-INF/plugin.xml)<!--#L55-->).
|
||||
* In your `plugin.xml`, define the `com.intellij.stubElementTypeHolder` extension and specify the interface which contains the `IElementType` constants used by your language's parser ([example](upsource:///plugins/properties/src/META-INF/plugin.xml)).
|
||||
|
||||
For serializing string data, e.g. element names, in stubs, we recommend to use `StubOutputStream.writeName()` and `StubInputStream.readName()` methods. These methods ensure that each unique identifier is stored only once in the data stream. This reduces the size of the serialized stub tree data.
|
||||
|
||||
@ -41,9 +41,9 @@ It's essential to make sure that all information stored in the stub tree depends
|
||||
|
||||
When building the stub tree, you can at the same time put some data about the stub elements into a number of indexes, which then can be used to find the PSI elements by the corresponding key. Unlike file-based indexes, stub indexes do not support storing custom data as values; the value is always a PSI element. Keys in stub indexes are normally strings (such as class names); other data types are also supported if desired.
|
||||
|
||||
A stub index is a class which extends [`AbstractStubIndex`](upsource:///platform/indexing-api/src/com/intellij/psi/stubs/AbstractStubIndex.java). In the most common case, when the key type is `String`, you use a more specific base class, namely [StringStubIndexExtension](upsource:///platform/indexing-api/src/com/intellij/psi/stubs/StringStubIndexExtension.java). Stub index implementation classes are registered in the `<stubIndex>` extension point.
|
||||
A stub index is a class which extends [`AbstractStubIndex`](upsource:///platform/indexing-api/src/com/intellij/psi/stubs/AbstractStubIndex.java). In the most common case, when the key type is `String`, you use a more specific base class, namely [`StringStubIndexExtension`](upsource:///platform/indexing-api/src/com/intellij/psi/stubs/StringStubIndexExtension.java). Stub index implementation classes are registered in the `com.intellij.stubIndex` extension point.
|
||||
|
||||
To put data into an index, you implement the method `IStubElementType.indexStub()` ([example: JavaClassElementType.indexStub()](upsource:///java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaClassElementType.java)<!--#L189-->). This method accepts an `IndexSink` as a parameter, and puts in the index ID and the key for each index in which the element should be stored.
|
||||
To put data into an index, you implement the method `IStubElementType.indexStub()` ([example: `JavaClassElementType.indexStub()`](upsource:///java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaClassElementType.java)<!--#L189-->). This method accepts an `IndexSink` as a parameter, and puts in the index ID and the key for each index in which the element should be stored.
|
||||
|
||||
To access the data from an index, the following two methods are used:
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
title: Persisting State of Components
|
||||
---
|
||||
|
||||
The *IntelliJ Platform* provides an API that allows components or services to persist their state between restarts of the IDE. You can use either a simple API to persist a few values, or persist the state of more complicated components using the [PersistentStateComponent](upsource:///platform/core-api/src/com/intellij/openapi/components/PersistentStateComponent.java) interface.
|
||||
The *IntelliJ Platform* provides an API that allows components or services to persist their state between restarts of the IDE. You can use either a simple API to persist a few values, or persist the state of more complicated components using the [`PersistentStateComponent`](upsource:///platform/core-api/src/com/intellij/openapi/components/PersistentStateComponent.java) interface.
|
||||
|
||||
> **WARNING** If you need to persist sensitive data like passwords, please see [Persisting Sensitive Data](persisting_sensitive_data.md).
|
||||
|
||||
|
@ -6,9 +6,12 @@ Click the following topics to learn more about the plugin system structure and p
|
||||
|
||||
* [Plugin Content](plugin_structure/plugin_content.md)
|
||||
* [Plugin Class Loaders](plugin_structure/plugin_class_loaders.md)
|
||||
* [Plugin Components](plugin_structure/plugin_components.md)
|
||||
* [Plugin Extensions and Extension Points](plugin_structure/plugin_extensions_and_extension_points.md)
|
||||
* [Plugin Actions](plugin_structure/plugin_actions.md)
|
||||
* [Plugin Extensions](plugin_structure/plugin_extensions.md)
|
||||
* [Plugin Services](plugin_structure/plugin_services.md)
|
||||
* [Plugin Listeners](plugin_structure/plugin_listeners.md)
|
||||
* [Plugin Extension Points](plugin_structure/plugin_extension_points.md)
|
||||
* [Plugin Components](plugin_structure/plugin_components.md)
|
||||
* [Plugin Configuration File](plugin_structure/plugin_configuration_file.md)
|
||||
* [Plugin Logo (Icon)](plugin_structure/plugin_icon_file.md)
|
||||
* [Plugin Dependencies](plugin_structure/plugin_dependencies.md)
|
||||
|
@ -4,4 +4,7 @@ title: Plugin Actions
|
||||
|
||||
The *IntelliJ Platform* provides the concept of _actions_. An action is a class, derived from the [`AnAction`](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java) class, whose `actionPerformed` method is called when the menu item or toolbar button is selected.
|
||||
|
||||
The system of actions allows plugins to add their own items to IDEA menus and toolbars. Actions are organized into groups, which, in turn, can contain other groups. A group of actions can form a toolbar or a menu. Subgroups of the group can form submenus of a menu. You can find detailed information on how to create and register your actions in the [IntelliJ Platform Action System](/basics/action_system.md).
|
||||
Actions are the most common way for a user to invoke the functionality of your plugin. An action can be invoked from
|
||||
a menu or a toolbar, using a keyboard shortcut, or from the Find Action interface.
|
||||
|
||||
Actions are organized into groups, which, in turn, can contain other groups. A group of actions can form a toolbar or a menu. Subgroups of the group can form submenus of a menu. You can find detailed information on how to create and register your actions in the [IntelliJ Platform Action System](/basics/action_system.md).
|
||||
|
@ -2,85 +2,26 @@
|
||||
title: Plugin Components
|
||||
---
|
||||
|
||||
> **TIP** Due to performance considerations, please consider using [Services](plugin_services.md) instead whenever possible.
|
||||
> **WARNING** When writing new plugins, you should avoid creating components, and you should migrate existing components in your plugins to services, extensions or listeners (see below).
|
||||
|
||||
Components are the fundamental concept of plugin integration. There are three kinds of components:
|
||||
Plugin components are a legacy feature supported for compatibility with plugins created for older versions of the
|
||||
IntelliJ Platform. Plugins using components do not support dynamic loading (the ability to install, update and
|
||||
uninstall plugins without restarting the IDE).
|
||||
|
||||
* **Application level components** are created and initialized when your IDE starts up. They can be acquired from the [Application](upsource:///platform/core-api/src/com/intellij/openapi/application/Application.java) instance by using the `getComponent(Class)` method.
|
||||
* **Project level components** are created for each [`Project`](upsource:///platform/core-api/src/com/intellij/openapi/project/Project.java) instance in the IDE. (Please note that components may be created even for unopened projects.) They can be acquired from the `Project` instance by using the `getComponent(Class)` method.
|
||||
* **Module level components** are created for each [`Module`](upsource:///platform/core-api/src/com/intellij/openapi/module/Module.java) inside every project loaded in the IDE.
|
||||
Module level components can be acquired from a `Module` instance with the `getComponent(Class)` method.
|
||||
Plugin components are defined using `<application-components>`, `<project-components>` and `<module-components>`
|
||||
tags in a `plugin.xml` file.
|
||||
|
||||
Every component should have interface and implementation classes specified in the configuration file. The interface class will be used for retrieving the component from other components, and the implementation class will be used for component instantiation.
|
||||
To migrate your code from components to more modern APIs, please use the following guidelines:
|
||||
|
||||
Note that two components of the same level ([Application](upsource:///platform/core-api/src/com/intellij/openapi/application/Application.java), [Project](upsource:///platform/core-api/src/com/intellij/openapi/project/Project.java) or [Module](upsource:///platform/core-api/src/com/intellij/openapi/module/Module.java)) cannot have the same interface class. The same class may be specified for both interface and Implementation.
|
||||
|
||||
Each component has a unique name which is used for its externalization and other internal needs. The name of a component is returned by its `getComponentName()` method.
|
||||
|
||||
## Components naming notation
|
||||
|
||||
It is recommended to name components in the form `<plugin_name>.<component_name>`.
|
||||
|
||||
## Application level components
|
||||
|
||||
An application component that has no dependencies should have a constructor with no parameters which will be used for its instantiation. If an application component depends on other application components, it can specify these components as constructor parameters. The *IntelliJ Platform* will ensure that the components are instantiated in the correct order to satisfy the dependencies.
|
||||
|
||||
Application level components must be registered in the `<application-components>` section of the plugin.xml file (see [Plugin Configuration File](plugin_configuration_file.md)).
|
||||
|
||||
## Project level components
|
||||
|
||||
Optionally, a project level component's implementation class may implement the [ProjectComponent](upsource:///platform/core-api/src/com/intellij/openapi/components/ProjectComponent.java) interface.
|
||||
|
||||
The constructor of a project level component can have a parameter of the [Project](upsource:///platform/core-api/src/com/intellij/openapi/project/Project.java) type, if it needs the project instance. It can also specify other application-level or project-level components as parameters, if it depends on those components.
|
||||
|
||||
Project level components must be registered in the `<project-components>` section of the `plugin.xml` file (see [Plugin Configuration File](plugin_configuration_file.md)).
|
||||
|
||||
## Module level components
|
||||
|
||||
Optionally, a module level component's implementation class may implement the [ModuleComponent](upsource:///platform/projectModel-api/src/com/intellij/openapi/module/ModuleComponent.java) interface.
|
||||
|
||||
The constructor of a module level component can have a parameter of the Module type, if it needs the module instance. It can also specify other application level, project level or module level components as parameters, if it depends on those components.
|
||||
|
||||
Module level components must be registered in the `<module-components>` section of the `plugin.xml` file (see [Plugin Configuration File](plugin_configuration_file.md)).
|
||||
|
||||
## Persisting the state of components
|
||||
|
||||
The state of every component will be automatically saved and loaded if the component's class implements the [JDOMExternalizable](upsource:///platform/util/src/com/intellij/openapi/util/JDOMExternalizable.java) (deprecated) or [PersistentStateComponent](upsource:///platform/projectModel-api/src/com/intellij/openapi/components/PersistentStateComponent.java) interface.
|
||||
|
||||
When the component's class implements the [PersistentStateComponent](upsource:///platform/projectModel-api/src/com/intellij/openapi/components/PersistentStateComponent.java) interface, the component state is saved in an XML file that you can specify using the [@State](upsource:///platform/projectModel-api/src/com/intellij/openapi/components/State.java) and [@Storage](upsource:///platform/projectModel-api/src/com/intellij/openapi/components/Storage.java) annotations in your Java code.
|
||||
|
||||
When the component's class implements the [JDOMExternalizable](upsource:///platform/util/src/com/intellij/openapi/util/JDOMExternalizable.java) interface, the components save their state in the following files:
|
||||
|
||||
* Project level components save their state to the project (`.ipr`) file.
|
||||
|
||||
However, if the workspace option in the `plugin.xml` file is set to `true`, the component saves its configuration to the workspace (`.iws`) file instead.
|
||||
|
||||
* Module level components save their state to the module (`.iml`) file.
|
||||
|
||||
For more information and samples, refer to [Persisting State of Components](/basics/persisting_state_of_components.md).
|
||||
|
||||
## Defaults
|
||||
|
||||
The defaults (a component's predefined settings) should be placed in the `<component_name>.xml` file. Place this file in the plugin's classpath in the folder corresponding to the default package. The `readExternal()` method will be called on the `<component>` root tag.
|
||||
|
||||
If a component has defaults, the `readExternal()` method is called twice:
|
||||
|
||||
* The first time for defaults
|
||||
* The second time for saved configuration
|
||||
|
||||
## Plugin components lifecycle
|
||||
|
||||
The components are loaded in the following order:
|
||||
|
||||
* Creation - constructor is invoked.
|
||||
* Initialization - the `initComponent` method is invoked (if the component implements the [BaseComponent](upsource:///platform/core-api/src/com/intellij/openapi/components/BaseComponent.java) interface).
|
||||
* Configuration - the `readExternal` method is invoked (if the component implements [JDOMExternalizable](upsource:///platform/util/src/com/intellij/openapi/util/JDOMExternalizable.java) interface), or the `loadState` method is invoked (if the component implements [PersistentStateComponent](upsource:///platform/projectModel-api/src/com/intellij/openapi/components/PersistentStateComponent.java) and has non-default persisted state).
|
||||
* For module components, the `moduleAdded` method of the [ModuleComponent](upsource:///platform/projectModel-api/src/com/intellij/openapi/module/ModuleComponent.java) interface is invoked to notify that a module has been added to the project.
|
||||
* For project components, the `projectOpened` method of the [ProjectComponent](upsource:///platform/core-api/src/com/intellij/openapi/components/ProjectComponent.java) interface is invoked to notify that a project has been loaded.
|
||||
|
||||
The components are unloaded in the following order:
|
||||
|
||||
* Saving configuration - the `writeExternal` method is invoked (if the component implements the [JDOMExternalizable](upsource:///platform/util/src/com/intellij/openapi/util/JDOMExternalizable.java) interface), or the `getState` method is invoked (if the component implements PersistentStateComponent).
|
||||
* Disposal - the `disposeComponent` method is invoked.
|
||||
|
||||
Note that you should not request any other components using the `getComponent()` method in the constructor of your component, otherwise you'll get an assertion. If you need access to other components when initializing your component, you can specify them as constructor parameters or access them in the `initComponent` method.
|
||||
* To manage some state or logic that is only needed when the user performs a specific operation,
|
||||
use a [Service](plugin_services.md).
|
||||
* To store the state of your plugin at the application or project level, use a [Service](plugin_services.md)
|
||||
and implement the `PersistentStateComponent` interface. See [Persisting State of Components](/basics/persisting_state_of_components.md) for details.
|
||||
* To subscribe to events, use a [listener](plugin_listeners.md) or create an [extension](plugin_extensions.md) for a dedicated extension point (for example, `com.intellij.editorFactoryListener`) if one exists for the event you need to subscribe to.
|
||||
* Executing code on application startup should be avoided whenever possible because it slows down startup.
|
||||
Plugin code should only be executed when projects are opened or when the user invokes an action of your plugin. If you can't avoid this, create
|
||||
an [extension](plugin_extensions.md) for the `com.intellij.appLifecycleListener` extension point.
|
||||
* To execute code when a project is being opened, provide [StartupActivity](upsource:///platform/core-api/src/com/intellij/openapi/startup/StartupActivity.java) implementation and register an [extension](plugin_extensions.md) for the `com.intellij.postStartupActivity` or `com.intellij.backgroundPostStartupActivity` extension point (the latter is supported starting with version 2019.3 of the platform).
|
||||
* To execute code on project closing or application shutdown, implement the `Disposable` interface in a [Service](plugin_services.md)
|
||||
and place the code in the `dispose()` method, or use `Disposer.register()` passing a `Project` or `Application` instance
|
||||
as the `parent` argument.
|
||||
|
@ -3,7 +3,11 @@ title: Plugin Configuration File - plugin.xml
|
||||
---
|
||||
|
||||
The following is a sample plugin configuration file. This sample showcases and describes all elements that can be used in the `plugin.xml` file.
|
||||
Additional information about configuring `<actions>` is available in the [Actions](/basics/action_system.md#registering-actions) section in Part II.
|
||||
|
||||
Limited HTML elements are allowed within `<description>` and `<changed-notes>` elements.
|
||||
However, content containing HTML elements must be surrounded by `<![CDATA[ ]]>` tags.
|
||||
Allowed HTML elements include text formatting, paragraphs, and lists.
|
||||
```xml
|
||||
<!-- `url` specifies the URL of the plugin homepage (can be opened from "Plugins" settings dialog) -->
|
||||
<idea-plugin url="https://www.jetbrains.com/idea">
|
||||
@ -27,12 +31,14 @@ The following is a sample plugin configuration file. This sample showcases and d
|
||||
For plugins that add language/platform/framework support, the description MUST specify
|
||||
the version of the corresponding language/platform/framework.
|
||||
Don't mention the IDE compatibility. E.g. don't say "Adds support to IntelliJ IDEA for..."
|
||||
Displayed in the "Plugins" settings dialog and the plugin repository Web interface. -->
|
||||
Displayed in the "Plugins" settings dialog and the plugin repository Web interface.
|
||||
Simple HTML elements can be included between <![CDATA[ ]]> tags. -->
|
||||
<description>Integrates Volume Snapshot Service W10</description>
|
||||
|
||||
<!-- Description of changes in the latest version of the plugin.
|
||||
Displayed in the "Plugins" settings dialog and the plugin repository Web interface. -->
|
||||
<change-notes>Initial release of the plugin.</change-notes>
|
||||
Displayed in the "Plugins" settings dialog and the plugin repository Web interface.
|
||||
Simple HTML elements can be included between <![CDATA[ ]]> tags. -->
|
||||
<change-notes>Initial release of the plugin.</change-notes>
|
||||
|
||||
<!-- Plugin version
|
||||
Recommended format is BRANCH.BUILD.FIX (MAJOR.MINOR.FIX)
|
||||
@ -43,7 +49,7 @@ The following is a sample plugin configuration file. This sample showcases and d
|
||||
The optional "url" attribute specifies the URL of the vendor homepage.
|
||||
The optional "email" attribute specifies the e-mail address of the vendor.
|
||||
Displayed in the "Plugins" settings dialog and the plugin repository Web interface. -->
|
||||
<vendor url="https://www.jetbrains.com" email="support@jetbrains.com">A Company Inc.</vendor>
|
||||
<vendor url="https://www.company.com" email="support@company.com">A Company Inc.</vendor>
|
||||
|
||||
<!-- Mandatory dependencies on plugins or modules.
|
||||
The FQN module names in <depends> elements are used to determine IDE compatibility for the plugin.
|
||||
@ -66,7 +72,7 @@ The following is a sample plugin configuration file. This sample showcases and d
|
||||
`action.[pluginID].[ActionID].text` -->
|
||||
<resource-bundle>messages.MyPluginBundle</resource-bundle>
|
||||
|
||||
<!-- Plugin's application components -->
|
||||
<!-- Plugin's application components (note that components are deprecated and should not be used in new plugins) -->
|
||||
<application-components>
|
||||
<component>
|
||||
<!-- Component's interface class -->
|
||||
@ -77,7 +83,7 @@ The following is a sample plugin configuration file. This sample showcases and d
|
||||
</component>
|
||||
</application-components>
|
||||
|
||||
<!-- Plugin's project components -->
|
||||
<!-- Plugin's project components (note that components are deprecated and should not be used in new plugins) -->
|
||||
<project-components>
|
||||
<component>
|
||||
<!-- Interface and implementation classes are the same -->
|
||||
@ -95,14 +101,14 @@ The following is a sample plugin configuration file. This sample showcases and d
|
||||
</component>
|
||||
</project-components>
|
||||
|
||||
<!-- Plugin's module components -->
|
||||
<!-- Plugin's module components (note that components are deprecated and should not be used in new plugins) -->
|
||||
<module-components>
|
||||
<component>
|
||||
<implementation-class>com.foo.Component3</implementation-class>
|
||||
</component>
|
||||
</module-components>
|
||||
|
||||
<!-- Actions -->
|
||||
<!-- Actions -->
|
||||
<actions>
|
||||
<action id="VssIntegration.GarbageCollection" class="com.foo.impl.CollectGarbage" text="Collect _Garbage" description="Run garbage collector">
|
||||
<keyboard-shortcut first-keystroke="control alt G" second-keystroke="C" keymap="$default"/>
|
||||
@ -127,8 +133,18 @@ The following is a sample plugin configuration file. This sample showcases and d
|
||||
tag matches the name of the extension point, and the
|
||||
"implementation" class specifies the name of the class
|
||||
added to the extension point. -->
|
||||
<extensions xmlns="VssIntegration">
|
||||
<extensions defaultExtensionNs="VssIntegration">
|
||||
<testExtensionPoint implementation="com.foo.impl.MyExtensionImpl"/>
|
||||
</extensions>
|
||||
|
||||
<!-- Application-level listeners -->
|
||||
<applicationListeners>
|
||||
<listener class="com.foo.impl.MyListener" topic="com.intellij.openapi.vfs.newvfs.BulkFileListener"/>
|
||||
</applicationListeners>
|
||||
|
||||
<!-- Project-level listeners -->
|
||||
<projectListeners>
|
||||
<listener class="com.foo.impl.MyToolwindowListener" topic="com.intellij.openapi.wm.ex.ToolWindowManagerListener"/>
|
||||
</projectListeners>
|
||||
</idea-plugin>
|
||||
```
|
||||
|
@ -2,48 +2,49 @@
|
||||
title: Plugin Content
|
||||
---
|
||||
|
||||
There are two possible ways of organizing plugin content:
|
||||
The plugin `jar` file must contain:
|
||||
- the configuration file (`META-INF/plugin.xml`) ([Plugin Configuration File](plugin_configuration_file.md))
|
||||
- the classes that implement the plugin functionality
|
||||
- recommended: plugin logo file(s) (`META-INF/pluginIcon*.svg`) ([Plugin Logo](plugin_icon_file.md))
|
||||
|
||||
1. A plugin consisting of one `.jar` file placed in the plugins directory:
|
||||
|
||||
The archive should contain the configuration file (`META-INF/plugin.xml`),
|
||||
plugin icon files (`META-INF/pluginIcon*.svg`),
|
||||
and the classes that implement the plugin functionality. The configuration file
|
||||
specifies the plugin name, description, version, vendor, the supported IntelliJ IDEA version,
|
||||
plugin components, actions and action groups, and action user interface placement.
|
||||
See the [Plugin Icon File](plugin_icon_file.md) page for more information about plugin icon SVG files.
|
||||
### Plugin Without Dependencies
|
||||
A plugin consisting of a single `.jar` file is placed in the `/plugins` directory.
|
||||
|
||||
```
|
||||
```
|
||||
.IntelliJIDEAx0/
|
||||
└── plugins
|
||||
└── sample.jar
|
||||
├── com/foo/...
|
||||
│ ...
|
||||
│ ...
|
||||
└── META-INF
|
||||
├── plugin.xml
|
||||
├── pluginIcon.svg
|
||||
└── pluginIcon_dark.svg
|
||||
```
|
||||
|
||||
|
||||
### Plugin With Dependencies
|
||||
The plugin `.jar` file is placed in the `/lib` folder under the plugin's "root" folder, together with all required bundled libraries.
|
||||
|
||||
All jars from the `/lib` folder are automatically added to the classpath (see also [Plugin Class Loaders](plugin_class_loaders.md)).
|
||||
|
||||
```
|
||||
.IntelliJIDEAx0/
|
||||
plugins/
|
||||
sample.jar/
|
||||
com/foo/...
|
||||
...
|
||||
...
|
||||
META-INF/
|
||||
plugin.xml
|
||||
pluginIcon.svg
|
||||
pluginIcon_dark.svg
|
||||
```
|
||||
|
||||
|
||||
2. Plugin files located in a `.jar` file that is placed in the lib folder:
|
||||
|
||||
```
|
||||
.IntelliJIDEAx0/
|
||||
plugins/
|
||||
Sample/
|
||||
lib/
|
||||
libfoo.jar
|
||||
libbar.jar
|
||||
Sample.jar/
|
||||
com/foo/...
|
||||
...
|
||||
...
|
||||
META-INF/
|
||||
plugin.xml
|
||||
pluginIcon.svg
|
||||
pluginIcon_dark.svg
|
||||
```
|
||||
|
||||
All jars from the `lib` folder are automatically added to the classpath.
|
||||
└── plugins
|
||||
└── sample
|
||||
└── lib
|
||||
├── lib_foo.jar
|
||||
├── lib_bar.jar
|
||||
│ ...
|
||||
│ ...
|
||||
└── sample.jar
|
||||
├── com/foo/...
|
||||
│ ...
|
||||
│ ...
|
||||
└── META-INF
|
||||
├── plugin.xml
|
||||
├── pluginIcon.svg
|
||||
└── pluginIcon_dark.svg
|
||||
```
|
||||
|
102
basics/plugin_structure/plugin_extension_points.md
Normal file
102
basics/plugin_structure/plugin_extension_points.md
Normal file
@ -0,0 +1,102 @@
|
||||
---
|
||||
title: Plugin Extension Points
|
||||
---
|
||||
|
||||
> **NOTE** See [Plugin Extensions](plugin_extensions.md) for _using_ extension points in your plugin.
|
||||
|
||||
By defining _extension points_ in your plugin, you can allow other plugins to extend the functionality of your plugin.
|
||||
There are two types of extension points:
|
||||
|
||||
* _Interface_ extension points allow other plugins to extend your plugins with _code_. When you define an interface
|
||||
extension point, you specify an interface, and other plugins will provide classes implementing that interface.
|
||||
You'll then be able to invoke methods on those interfaces.
|
||||
* _Bean_ extension points allow other plugins to extend your plugins with _data_. You specify the fully qualified
|
||||
name of an extension class, and other plugins will provide data which will be turned into instances of that class.
|
||||
|
||||
## How to declare extension points
|
||||
|
||||
You can declare extensions and extension points in the plugin configuration file `plugin.xml`, within the `<extensions>` and `<extensionPoints>` sections, respectively.
|
||||
|
||||
To declare extension points in your plugin, add an `<extensionPoints>` section to your `plugin.xml`. Then insert a child element `<extensionPoint>` 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
|
||||
<idea-plugin>
|
||||
<id>my.plugin</id>
|
||||
|
||||
<extensionPoints>
|
||||
<extensionPoint name="myExtensionPoint1" beanClass="com.myplugin.MyBeanClass">
|
||||
<extensionPoint name="myExtensionPoint2" interface="com.myplugin.MyInterface">
|
||||
</extensionPoints>
|
||||
|
||||
</idea-plugin>
|
||||
```
|
||||
|
||||
* The `name` attribute assigns a unique name for this extension point, it will be prefixed with the plugin's `<id>` automatically.
|
||||
* The `beanClass` attribute sets a bean class that specifies one or several properties annotated with the [`@Attribute`](upsource:///platform/util/src/com/intellij/util/xmlb/annotations/Attribute.java) annotation.
|
||||
* The `interface` attribute sets an interface the plugin that contributes to the extension point must implement.
|
||||
|
||||
The plugin that contributes to the extension point will read those properties from the `plugin.xml` file.
|
||||
|
||||
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")
|
||||
public String key;
|
||||
|
||||
@Attribute("implementationClass")
|
||||
public String implementationClass;
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getClass() {
|
||||
return implementationClass;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> **TIP** See [Extension properties code insight](plugin_extensions.md#extension-properties-code-insight) on how to provide smart completion/validation.
|
||||
|
||||
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
|
||||
<idea-plugin>
|
||||
<id>another.plugin</id>
|
||||
|
||||
<!-- declare dependency on plugin defining extension point -->
|
||||
<depends>my.plugin</id>
|
||||
|
||||
<!-- use "my.plugin" namespace -->
|
||||
<extensions defaultExtensionNs="my.plugin">
|
||||
<myExtensionPoint1 key="someKey" implementationClass="another.some.implementation.class"/>
|
||||
|
||||
<myExtensionPoint2 implementation="another.MyInterfaceImpl"/>
|
||||
</extension>
|
||||
|
||||
</idea-plugin>
|
||||
```
|
||||
|
||||
## Using extension points
|
||||
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 {
|
||||
|
||||
private static final ExtensionPointName<MyBeanClass> EP_NAME = ExtensionPointName.create("my.plugin.myExtensionPoint1");
|
||||
|
||||
public void useExtensions() {
|
||||
for (MyBeanClass extension : EP_NAME.getExtensionList()) {
|
||||
String key = extension.getKey();
|
||||
String clazz = extension.getClass();
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
A gutter icon for the `ExtensionPointName` declaration allows navigating to the corresponding `<extensionPoint>` declaration in `plugin.xml`.
|
92
basics/plugin_structure/plugin_extensions.md
Normal file
92
basics/plugin_structure/plugin_extensions.md
Normal file
@ -0,0 +1,92 @@
|
||||
---
|
||||
title: Plugin Extensions
|
||||
redirect_from:
|
||||
/basics/plugin_structure/plugin_extensions_and_extension_points.html
|
||||
---
|
||||
|
||||
_Extensions_ are the most common way for a plugin to extend the functionality of the IntelliJ Platform in a way
|
||||
that is not as straightforward as adding an action to a menu or toolbar. The following are some of the most common
|
||||
tasks accomplished using extensions:
|
||||
|
||||
* The `com.intellij.toolWindow` extension point allows plugins to add [tool windows](/user_interface_components/tool_windows.md)
|
||||
(panels displayed at the sides of the IDE user interface);
|
||||
* The `com.intellij.applicationConfigurable` and `com.intellij.projectConfigurable` extension points allow plugins to add pages to the
|
||||
Settings/Preferences dialog;
|
||||
* [Custom language plugins](/reference_guide/custom_language_support.md) use many extension points
|
||||
to extend various language support features in the IDE.
|
||||
|
||||
There are [more than 1000 extension](#how-to-get-the-extension-points-list) points available in the platform and the bundled plugins, allowing to customize
|
||||
different parts of the IDE behavior.
|
||||
|
||||
## Declaring Extensions
|
||||
|
||||
> **TIP** Auto-completion, Quick Documentation and other code insight features are available on extension point tags and attributes.
|
||||
|
||||
1. Add an `<extensions>` element to your plugin.xml if it's not yet present there. Set the `defaultExtensionNs` attribute to one of the following values:
|
||||
* `com.intellij`, if your plugin extends the IntelliJ Platform core functionality.
|
||||
* `{ID of a plugin}`, if your plugin extends a functionality of another plugin.
|
||||
2. Add a new child element to the `<extensions>` element. The child element name must match the name of the extension point you want the extension to access.
|
||||
3. Depending on the type of the extension point, do one of the following:
|
||||
* If the extension point was declared using the `interface` attribute, for newly added child element, set the `implementation` attribute to the name of the class that implements the specified interface.
|
||||
* If the extension point was declared using the `beanClass` attribute, for newly added child element, set all attributes annotated with the [`@Attribute`](upsource:///platform/util/src/com/intellij/util/xmlb/annotations/Attribute.java) annotations in the specified bean class.
|
||||
|
||||
|
||||
To clarify this procedure, consider the following sample section of the `plugin.xml` file that defines two extensions designed to access the `com.intellij.appStarter` and `com.intellij.projectTemplatesFactory` extension points in the *IntelliJ Platform* and one extension to access the `another.plugin.myExtensionPoint` extension point in another plugin `another.plugin`:
|
||||
|
||||
```xml
|
||||
<!-- Declare extensions to access extension points in the IntelliJ Platform.
|
||||
These extension points have been declared using "interface".
|
||||
-->
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<appStarter implementation="com.myplugin.MyAppStarter" />
|
||||
<projectTemplatesFactory implementation="com.myplugin.MyProjectTemplatesFactory" />
|
||||
</extensions>
|
||||
|
||||
<!-- Declare extensions to access extension points in a custom plugin "another.plugin"
|
||||
The "myExtensionPoint" extension point has been declared using "beanClass"
|
||||
and exposes custom properties "key" and "implementationClass".
|
||||
-->
|
||||
<extensions defaultExtensionNs="another.plugin">
|
||||
<myExtensionPoint key="keyValue" implementationClass="com.myplugin.MyExtensionPointImpl" />
|
||||
</extensions>
|
||||
```
|
||||
### Extension default properties
|
||||
The following properties are available always:
|
||||
|
||||
- `id` - unique ID
|
||||
- `order` - allows to order all defined extensions using `first`, `last` or `before|after [id]` respectively
|
||||
- `os` - allows to restrict extension to given OS, e.g., `os="windows"` registers the extension on Windows only
|
||||
|
||||
|
||||
### Extension properties code insight
|
||||
Several tooling features are available to help configuring bean class extension points in `plugin.xml`.
|
||||
|
||||
Properties annotated with [`@RequiredElement`](upsource:///platform/extensions/src/com/intellij/openapi/extensions/RequiredElement.java) are inserted automatically and validated (2019.3 and later).
|
||||
|
||||
Property names matching the following list will resolve to FQN:
|
||||
- `implementation`
|
||||
- `className`
|
||||
- `serviceInterface` / `serviceImplementation`
|
||||
- ending with `Class` (case-sensitive)
|
||||
|
||||
A required parent type can be specified in the extension point declaration via nested `<with>`:
|
||||
```xml
|
||||
<extensionPoint name="myExtension" beanClass="MyExtensionBean">
|
||||
<with attribute="psiElementClass" implements="com.intellij.psi.PsiElement"/>
|
||||
</extensionPoint>
|
||||
```
|
||||
|
||||
Property name `language` will automatically resolve to all present `Language` IDs.
|
||||
|
||||
Specifying `@org.jetbrains.annotations.Nls` verifies capitalization of UI text properties according to given `capitalization` value (2019.2 and later).
|
||||
|
||||
Attributes with `Enum` type support code insight with _lowerSnakeCased_ notation (2020.1 and later).
|
||||
|
||||
## How to get the extension points list?
|
||||
|
||||
To get a list of extension points available in the *IntelliJ Platform* core, consult the `<extensionPoints>` section of the following XML configuration files:
|
||||
|
||||
* [`LangExtensionPoints.xml`](upsource:///platform/platform-resources/src/META-INF/LangExtensionPoints.xml)
|
||||
* [`PlatformExtensionPoints.xml`](upsource:///platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml)
|
||||
* [`VcsExtensionPoints.xml`](upsource:///platform/platform-resources/src/META-INF/VcsExtensionPoints.xml)
|
||||
|
@ -1,125 +0,0 @@
|
||||
---
|
||||
title: Plugin Extensions and Extension Points
|
||||
---
|
||||
|
||||
The *IntelliJ Platform* provides the concept of _extensions_ and _extension points_ that allows a plugin to interact with other plugins or with the IDE itself.
|
||||
|
||||
## Extension points
|
||||
|
||||
If you want your plugin to allow other plugins to extend its functionality, in the plugin, you must declare one or several _extension points_. Each extension point defines a class or an interface that is allowed to access this point.
|
||||
|
||||
## Extensions
|
||||
|
||||
If you want your plugin to extend the functionality of other plugins or the *IntelliJ Platform*, you must declare one or several _extensions_.
|
||||
|
||||
## How to declare extensions and extension points
|
||||
|
||||
You can declare extensions and extension points in the plugin configuration file `plugin.xml`, within the `<extensions>` and `<extensionPoints>` sections, respectively.
|
||||
|
||||
**To declare an extension point**
|
||||
|
||||
In the `<extensionPoints>` section, insert a child element `<extensionPoint>` 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.
|
||||
|
||||
To clarify this procedure, consider the following sample section of the plugin.xml file:
|
||||
|
||||
```xml
|
||||
<extensionPoints>
|
||||
<extensionPoint name="MyExtensionPoint1" beanClass="MyPlugin.MyBeanClass1">
|
||||
<extensionPoint name="MyExtensionPoint2" interface="MyPlugin.MyInterface">
|
||||
</extensionPoints>
|
||||
```
|
||||
|
||||
* The `interface` attribute sets an interface the plugin that contributes to the extension point must implement.
|
||||
* The `beanClass` attribute sets a bean class that specifies one or several properties annotated with the [@Attribute](upsource:///platform/util/src/com/intellij/util/xmlb/annotations/Attribute.java) annotation.
|
||||
|
||||
The plugin that contributes to the extension point will read those properties from the `plugin.xml` file.
|
||||
|
||||
To clarify this, consider the following sample `MyBeanClass1` bean class used in the above `plugin.xml` file:
|
||||
|
||||
```java
|
||||
public class MyBeanClass1 extends AbstractExtensionPointBean {
|
||||
@Attribute("key")
|
||||
public String key;
|
||||
|
||||
@Attribute("implementationClass")
|
||||
public String implementationClass;
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getClass() {
|
||||
return implementationClass;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To declare an extension designed to access the `MyExtensionPoint1` extension point, your `plugin.xml` file must contain the `<MyExtensionPoint1>` tag with the `key` and `implementationClass` attributes set to appropriate values (see sample below).
|
||||
|
||||
**To declare an extension**
|
||||
|
||||
> **TIP** Auto-completion is available for all these steps.
|
||||
|
||||
1. For the `<extensions>` element, set the `defaultExtensionNs` attribute to one of the following values:
|
||||
* `com.intellij`, if your plugin extends the IntelliJ Platform core functionality.
|
||||
* `{ID of a plugin}`, if your plugin extends a functionality of another plugin.
|
||||
2. Add a new child element to the `<extensions>` element. The child element name must match the name of the extension point you want the extension to access.
|
||||
3. Depending on the type of the extension point, do one of the following:
|
||||
* If the extension point was declared using the `interface` attribute, for newly added child element, set the `implementation` attribute to the name of the class that implements the specified interface.
|
||||
* If the extension point was declared using the `beanClass` attribute, for newly added child element, set all attributes annotated with the [@Attribute](upsource:///platform/util/src/com/intellij/util/xmlb/annotations/Attribute.java) annotations in the specified bean class.
|
||||
|
||||
|
||||
To clarify this procedure, consider the following sample section of the `plugin.xml` file that defines two extensions designed to access the `appStarter` and `applicationConfigurable` extension points in the *IntelliJ Platform* and one extension to access the `MyExtensionPoint1` extension point in a test plugin:
|
||||
|
||||
```xml
|
||||
<!-- Declare extensions to access extension points in the IntelliJ Platform.
|
||||
These extension points have been declared using the "interface" attribute.
|
||||
-->
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<appStarter implementation="MyTestPackage.MyTestExtension1" />
|
||||
<applicationConfigurable implementation="MyTestPackage.MyTestExtension2" />
|
||||
</extensions>
|
||||
|
||||
<!-- Declare extensions to access extension points in a custom plugin
|
||||
The MyExtensionPoint1 extension point has been declared using *beanClass* attribute.
|
||||
-->
|
||||
<extensions defaultExtensionNs="MyPluginID">
|
||||
<MyExtensionPoint1 key="keyValue" implementationClass="MyTestPackage.MyClassImpl"></MyExtensionPoint1>
|
||||
</extensions>
|
||||
```
|
||||
### Extension default properties
|
||||
The following properties are available always:
|
||||
|
||||
- `id` - unique ID
|
||||
- `order` - allows to order all defined extensions using `first`, `last` or `before|after [id]` respectively
|
||||
- `os` - allows to restrict extension to given OS, e.g., `os="windows"` registers the extension on Windows only
|
||||
|
||||
|
||||
### Extension properties code insight
|
||||
Several tooling features are available to help configuring bean class extension points in `plugin.xml`.
|
||||
|
||||
Property names matching the following list will resolve to FQN:
|
||||
- `implementation`
|
||||
- `className`
|
||||
- `serviceInterface` / `serviceImplementation`
|
||||
- ending with `Class` (case-sensitive)
|
||||
|
||||
A required parent type can be specified in the extension point declaration via nested `<with>`:
|
||||
```xml
|
||||
<extensionPoint name="myExtension" beanClass="MyExtensionBean">
|
||||
<with attribute="psiElementClass" implements="com.intellij.psi.PsiElement"/>
|
||||
</extensionPoint>
|
||||
```
|
||||
|
||||
Property name `language` will automatically resolve to all present `Language` IDs.
|
||||
|
||||
Specifying `@org.jetbrains.annotations.Nls` verifies capitalization of UI text properties according to given `capitalization` value (2019.2 and later).
|
||||
|
||||
## How to get the extension points list?
|
||||
|
||||
To get a list of extension points available in the *IntelliJ Platform* core, consult the `<extensionPoints>` section of the following XML configuration files:
|
||||
|
||||
* [`LangExtensionPoints.xml`](upsource:///platform/platform-resources/src/META-INF/LangExtensionPoints.xml)
|
||||
* [`PlatformExtensionPoints.xml`](upsource:///platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml)
|
||||
* [`VcsExtensionPoints.xml`](upsource:///platform/platform-resources/src/META-INF/VcsExtensionPoints.xml)
|
||||
|
90
basics/plugin_structure/plugin_listeners.md
Normal file
90
basics/plugin_structure/plugin_listeners.md
Normal file
@ -0,0 +1,90 @@
|
||||
---
|
||||
title: Plugin Listeners
|
||||
---
|
||||
|
||||
> **NOTE** Defining listeners in `plugin.xml` is supported starting with the version 2019.3 of the platform.
|
||||
|
||||
_Listeners_ allow plugins to declaratively subscribe to events delivered through the
|
||||
[message bus](/reference_guide/messaging_infrastructure.md). You can define both application- and project-level
|
||||
listeners.
|
||||
|
||||
Declarative registration of listeners allows you to achieve better performance compared to registering listeners
|
||||
from code, because listener instances are created lazily (the first time an event is sent to the topic), and not
|
||||
during application startup or project opening.
|
||||
|
||||
## Defining Application-Level Listeners
|
||||
|
||||
To define an application-level listener, add the following section to your `plugin.xml`:
|
||||
|
||||
```xml
|
||||
<applicationListeners>
|
||||
<listener class="myPlugin.MyListenerClass" topic="BaseListenerInterface"/>
|
||||
</applicationListeners>
|
||||
```
|
||||
|
||||
The `topic` attribute specifies the listener interface corresponding to the type of events you want to receive.
|
||||
Normally, this is the interface used as the type parameter of the `Topic` instance for the type of events.
|
||||
The `class` attribute specifies the class in your plugin that implements the listener interface and receives
|
||||
the events.
|
||||
|
||||
As a specific example, if you want to receive events about all changes in the virtual file system, you need
|
||||
to implement the `BulkFileListener` interface, corresponding to the topic `VirtualFileManager.VFS_CHANGES`.
|
||||
To subscribe to this topic from code, you could use something like the following snippet:
|
||||
|
||||
```java
|
||||
messageBus.connect().subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() {
|
||||
@Override
|
||||
public void after(@NotNull List<? extends VFileEvent> events) {
|
||||
// handle the events
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
To use declarative registration, you no longer need to reference the `Topic` instance. Instead, you refer directly
|
||||
to the listener interface class:
|
||||
|
||||
```xml
|
||||
<applicationListeners>
|
||||
<listener class="myPlugin.MyVfsListener" topic="com.intellij.openapi.vfs.newvfs.BulkFileListener"/>
|
||||
</applicationListeners>
|
||||
```
|
||||
|
||||
Then you provide the listener implementation as a top-level class:
|
||||
|
||||
```java
|
||||
public class MyVfsListener implements BulkFileListener {
|
||||
@Override
|
||||
public void after(@NotNull List<? extends VFileEvent> events) {
|
||||
// handle the events
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Defining Project-level Listeners
|
||||
|
||||
Project-level listeners are registered in the same way, except that the top-level tag is
|
||||
`<projectListeners>`. They can be used to listen to project-level events, for example, tool window operations:
|
||||
|
||||
```xml
|
||||
<projectListeners>
|
||||
<listener class="MyToolwindowListener" topic="com.intellij.openapi.wm.ex.ToolWindowManagerListener" />
|
||||
</projectListeners>
|
||||
```
|
||||
|
||||
The class implementing the listener interface can define a one-argument constructor accepting a `Project`,
|
||||
and it will receive the instance of the project for which the listener is created:
|
||||
|
||||
```java
|
||||
public class MyToolwindowListener implements ToolWindowManagerListener {
|
||||
private final Project project;
|
||||
|
||||
public MyToolwindowListener(Project project) {
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stateChanged() {
|
||||
// handle the state change
|
||||
}
|
||||
}
|
||||
```
|
@ -2,7 +2,7 @@
|
||||
title: Plugin Services
|
||||
---
|
||||
|
||||
A _service_ is a plugin component loaded on demand when your plugin calls the `getService` method of the [ServiceManager](upsource:///platform/core-api/src/com/intellij/openapi/components/ServiceManager.java) class.
|
||||
A _service_ is a plugin component loaded on demand when your plugin calls the `getService` method of the [`ServiceManager`](upsource:///platform/core-api/src/com/intellij/openapi/components/ServiceManager.java) class.
|
||||
|
||||
The *IntelliJ Platform* ensures that only one instance of a service is loaded even though the service is called several times. A service must have an implementation class which is used for service instantiation. A service may also have an interface class which is used to obtain the service instance and provides API of the service. The interface and implementation classes are specified in the `plugin.xml` file.
|
||||
|
||||
@ -12,9 +12,9 @@ The *IntelliJ Platform* offers three types of services: _application level_ serv
|
||||
|
||||
To declare a service, you can use the following extension points in the IntelliJ Platform:
|
||||
|
||||
* `applicationService`: designed to declare an application level service.
|
||||
* `projectService`: designed to declare a project level service.
|
||||
* `moduleService`: designed to declare a module level service.
|
||||
* `com.intellij.applicationService`: designed to declare an application level service.
|
||||
* `com.intellij.projectService`: designed to declare a project level service.
|
||||
* `com.intellij.moduleService`: designed to declare a module level service.
|
||||
|
||||
**To declare a service:**
|
||||
|
||||
|
@ -4,19 +4,21 @@ title: PSI Cookbook
|
||||
|
||||
This page gives a list of recipes for the most common operations for working with the PSI (Program Structure Interface). Unlike [Developing Custom Language Plugins](/reference_guide/custom_language_support.md), it talks about working with the PSI of existing languages (such as Java).
|
||||
|
||||
## How do I find a file if I know its name but don't know the path?
|
||||
> **TIP** Please see also [Working with PSI efficiently](/reference_guide/performance/performance.md#working-with-psi-efficiently).
|
||||
|
||||
### How do I find a file if I know its name but don't know the path?
|
||||
|
||||
`FilenameIndex.getFilesByName()`
|
||||
|
||||
## How do I find where a particular PSI element is used?
|
||||
### How do I find where a particular PSI element is used?
|
||||
|
||||
`ReferencesSearch.search()`
|
||||
|
||||
## How do I rename a PSI element?
|
||||
### How do I rename a PSI element?
|
||||
|
||||
`RefactoringFactory.createRename()`
|
||||
|
||||
## How can I cause the PSI for a virtual file to be rebuilt?
|
||||
### How can I cause the PSI for a virtual file to be rebuilt?
|
||||
|
||||
`FileContentUtil.reparseFiles()`
|
||||
|
||||
|
@ -27,11 +27,11 @@ As a plugin developer, you normally don't need to implement the `Executor` inter
|
||||
|
||||
The `RunProfileState` interface comes up in every run configuration implementation as the return value `RunProfile.getState()`. It describes a process which is ready to be started and holds the information like the command line, current working directory, and environment variables for the process to be started. (The existence of `RunProfileState` as a separate step in the execution flow allows run configuration extensions and other components to patch the configuration and to modify the parameters before it gets executed.)
|
||||
|
||||
The standard base class used as implementation of `RunProfileState` is [`CommandLineState`](upsource:///platform/lang-api/src/com/intellij/execution/configurations/CommandLineState.java). It contains the logic for putting together a running process and a console into an [`ExecutionResult`](upsource:///platform/lang-api/src/com/intellij/execution/ExecutionResult.java), but doesn't know anything how the process is actually started. For starting the process, it's best to use the [`GeneralCommandLine`](upsource:///platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java) class, which takes care of setting up the command line parameters and executing the process.
|
||||
The standard base class used as implementation of `RunProfileState` is [`CommandLineState`](upsource:///platform/lang-api/src/com/intellij/execution/configurations/CommandLineState.java). It contains the logic for putting together a running process and a console into an [`ExecutionResult`](upsource:///platform/lang-api/src/com/intellij/execution/ExecutionResult.java), but doesn't know anything how the process is actually started. For starting the process, it's best to use the [`GeneralCommandLine`](upsource:///platform/platform-util-io/src/com/intellij/execution/configurations/GeneralCommandLine.java) class, which takes care of setting up the command line parameters and executing the process.
|
||||
|
||||
Alternatively, if the process you need to run is a JVM-based one, you can use the [`JavaCommandLineState`](upsource:///java/execution/openapi/src/com/intellij/execution/configurations/JavaCommandLineState.java) base class. It knows about the command line parameters of the JVM and can take care of details like calculating the classpath for the JVM.
|
||||
|
||||
To monitor the execution of a process and capture its output, the [`OSProcessHandler`](upsource:///platform/platform-api/src/com/intellij/execution/process/OSProcessHandler.java) class is normally used. Once you've created an instance of `OSProcessHandler` from either a command line or a Process object, you need to call the `startNotify()` method to start capturing its output. You may also want to attach a [`ProcessTerminatedListener`](upsource:///platform/platform-api/src/com/intellij/execution/process/ProcessTerminatedListener.java) to the `OSProcessHandler`, so that the exit status of the process will be displayed in the console.
|
||||
To monitor the execution of a process and capture its output, the [`OSProcessHandler`](upsource:///platform/platform-util-io/src/com/intellij/execution/process/OSProcessHandler.java) class is normally used. Once you've created an instance of `OSProcessHandler` from either a command line or a Process object, you need to call the `startNotify()` method to start capturing its output. You may also want to attach a [`ProcessTerminatedListener`](upsource:///platform/platform-api/src/com/intellij/execution/process/ProcessTerminatedListener.java) to the `OSProcessHandler`, so that the exit status of the process will be displayed in the console.
|
||||
|
||||
## Displaying the process output
|
||||
|
||||
@ -40,7 +40,7 @@ If you're using `CommandLineState`, a console view will be automatically created
|
||||
* `TextConsoleBuilderFactory.createBuilder(project).getConsole()` creates a [`ConsoleView`](upsource:///platform/lang-api/src/com/intellij/execution/ui/ConsoleView.java) instance
|
||||
* `ConsoleView.attachToProcess()` attaches it to the output of a process.
|
||||
|
||||
If the process you're running uses ANSI escape codes to color its output, the [`ColoredProcessHandler`](upsource:///platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java) class will parse it and display the colors in the IntelliJ console.
|
||||
If the process you're running uses ANSI escape codes to color its output, the [`ColoredProcessHandler`](upsource:///platform/platform-impl/src/com/intellij/execution/process/ColoredProcessHandler.java) class will parse it and display the colors in the IntelliJ console.
|
||||
|
||||
Console [filters](upsource:///platform/lang-api/src/com/intellij/execution/filters/Filter.java) allow you to convert certain strings found in the process output to clickable hyperlinks. To attach a filter to the console, use `CommandLineState.addConsoleFilters()` or, if you're creating a console manually, `TextConsoleBuilder.addFilter()`.
|
||||
|
||||
|
@ -19,7 +19,7 @@ Every type there is represented as an instance of [`ConfigurationType`](upsource
|
||||
<configurationType implementation="org.jetbrains.plugins.gradle.service.execution.GradleExternalTaskConfigurationType" />
|
||||
```
|
||||
|
||||
The easiest way to implement this interface is to use the [`ConfigurationTypeBase`](upsource:///platform/lang-api/src/com/intellij/execution/configurations/runConfigurationType.kt) base class. In order to use it, you need to inherit from it and to provide the configuration type parameters (ID, name, description and icon) as constructor parameters. In addition to that, you need to call the [`addFactory()`](upsource:///platform/lang-api/src/com/intellij/execution/configurations/ConfigurationTypeBase.java)<!--#L46--> method to add a configuration factory.
|
||||
The easiest way to implement this interface is to use the [`ConfigurationTypeBase`](upsource:////platform/lang-api/src/com/intellij/execution/configurations/runConfigurationType.kt) base class. In order to use it, you need to inherit from it and to provide the configuration type parameters (ID, name, description and icon) as constructor parameters. In addition to that, you need to call the [`addFactory()`](upsource:///platform/lang-api/src/com/intellij/execution/configurations/ConfigurationTypeBase.java)<!--#L46--> method to add a configuration factory.
|
||||
|
||||
## Configuration factory
|
||||
|
||||
|
@ -7,9 +7,9 @@ The test fixture creates a *test project* environment. Unless you customize the
|
||||
[`LightPlatformCodeInsightFixtureTestCase`](upsource:///platform/testFramework/src/com/intellij/testFramework/fixtures/LightPlatformCodeInsightFixtureTestCase.java) (renamed to `BasePlatformTestCase` in 2019.2) uses an in-memory implementation; if you set up the test environment by calling `IdeaTestFixtureFactory.createCodeInsightFixture`, you can specify the implementation to use.
|
||||
|
||||
> **WARNING** If your tests use the in-memory implementation, and you abort the execution of your tests, the persisted filesystem caches may get out of sync with the in-memory structures, and you may get spurious errors in your tests.
|
||||
> If you get an unexpected error after a series of successful runs, **try running the test again**, and if that doesn't help, **delete the "system" subdirectory** in your sandbox directory (specified via `sandboxDirectory` for Gradle setups or in the *IntelliJ Platform* SDK settings for Devkit setups) .
|
||||
> If you get an unexpected error after a series of successful runs, **try rerunning the test**, and if that doesn't help, **delete the "system" subdirectory** in your [sandbox directory](/basics/ide_development_instance.md#the-development-instance-sandbox-directory).
|
||||
|
||||
In your plugin, you normally store the test data for your tests (such as files on which plugin features will be executed and expected output files) in the `testdata` directory. This is just a directory under the content root of your plugin, but not under a source root. Files in `testdata` are normally not valid source code and must not be compiled.
|
||||
In your plugin, you normally store the test data for your tests (such as files on which plugin features will be executed and expected output files) in the `testdata` directory. This is just a directory under the content root of your plugin, but not under a source root. Files in `testdata` usually are not valid source code and must not be compiled.
|
||||
|
||||
To specify the location of `testdata`, you must override the `getTestDataPath()` method. The default implementation assumes running as part of the *IntelliJ Platform* source tree and is not appropriate for third-party plugins.
|
||||
|
||||
@ -23,8 +23,10 @@ Most operations in plugin tests require a file open in the in-memory editor, in
|
||||
|
||||
Alternatively, you can use one of the other methods which take parameters annotated with [`@TestDataFile`](upsource:///platform/testFramework/src/com/intellij/testFramework/TestDataFile.java). These methods copy the specified files from the `testdata` directory to the test project directory, open the first of the specified files in the in-memory editor, and then perform the requested operation such as highlighting or code completion.
|
||||
|
||||
When a file is opened in the in-memory editor, special markup in the file content can be used to specify the caret position or selection. You can use one of the following markers:
|
||||
### Special Markup
|
||||
When a file is opened in the in-memory editor, special markup in the file content can be used to specify the caret position or selection.
|
||||
|
||||
You can use one of the following markers:
|
||||
* `<caret>` specifies the position where the caret should be placed.
|
||||
* `<selection>` and `</selection>` specify the start and end of the text range to be selected.
|
||||
* `<block>` and `</block>` specify the start and end points of the column selection.
|
||||
|
@ -34,9 +34,9 @@ The tag name specifies the severity of the expected highlighting. The following
|
||||
|
||||
The tag can also have the following optional attributes:
|
||||
|
||||
* `descr` - expected message associated with the highlighter (if not specified, any text will match; if the message contains a quotation mark, it can be escaped by putting two backslash characters before it)
|
||||
* `descr` expected message associated with the highlighter (if not specified, any text will match; if the message contains a quotation mark, it can be escaped by putting two backslash characters before it)
|
||||
* `foregroundColor`, `backgroundColor`, `effectColor` expected colors for the highlighting
|
||||
* `effectType` expected effect type for the highlighting (see `EffectType` enum for possible values)
|
||||
* `effectType` expected effect type for the highlighting (see [`EffectType`](upsource:///platform/core-api/src/com/intellij/openapi/editor/markup/EffectType.java))
|
||||
* `fontType` expected font style for the highlighting (0 - normal, 1 - bold, 2 - italic, 3 - bold italic)
|
||||
|
||||
> **Note** *Nested* tags are **supported**:
|
||||
|
@ -1,10 +1,12 @@
|
||||
---
|
||||
title: Testing Plugins
|
||||
redirect_from:
|
||||
- /basics/testing_plugins.html
|
||||
---
|
||||
|
||||
Most of the tests in the *IntelliJ Platform* codebase are *model level functional tests*. What this means is the following:
|
||||
|
||||
* The tests run in a headless environment which uses real production implementations for the majority of components, except for a number of UI components.
|
||||
* The tests run in a headless environment that uses real production implementations for the majority of components, except for a number of UI components.
|
||||
* The tests usually test a feature as a whole, rather than individual functions that comprise its implementation.
|
||||
* The tests do not test the Swing UI and work directly with the underlying model instead.
|
||||
* Most of the tests take a source file or a set of source files as input data, execute a feature, and then compare the output with expected results. Results can be specified as another set of source files, as special markup in the input file, or directly in the test code.
|
||||
@ -18,10 +20,11 @@ Another consequence of our testing approach is what our test framework does not
|
||||
* We do not provide a recommended approach to mocking. We have a few tests in our codebase that use JMock, but in general, we find it difficult to mock all of the interactions with *IntelliJ Platform* components that your plugin class will need to have, and we recommend working with real components instead.
|
||||
* We do not provide a general-purpose framework for Swing UI testing. You can try using tools such as [FEST](https://code.google.com/p/fest/) or [Sikuli](http://sikulix.com/) for plugin UI testing, but we don't use either of them and cannot provide any guidelines for their use. Internally, we use manual testing for testing our Swing UIs.
|
||||
|
||||
* [Tests and Fixtures](/basics/testing_plugins/tests_and_fixtures.md)
|
||||
* [Light and Heavy Tests](/basics/testing_plugins/light_and_heavy_tests.md)
|
||||
* [Test Project and Testdata Directories](/basics/testing_plugins/test_project_and_testdata_directories.md)
|
||||
* [Writing Tests](/basics/testing_plugins/writing_tests.md)
|
||||
* [Testing Highlighting](/basics/testing_plugins/testing_highlighting.md)
|
||||
## Topics
|
||||
* [Tests and Fixtures](tests_and_fixtures.md)
|
||||
* [Light and Heavy Tests](light_and_heavy_tests.md)
|
||||
* [Test Project and Testdata Directories](test_project_and_testdata_directories.md)
|
||||
* [Writing Tests](writing_tests.md)
|
||||
* [Testing Highlighting](testing_highlighting.md)
|
||||
|
||||
Check out [this step-by-step tutorial](/tutorials/writing_tests_for_plugins.md) teaching how to write and run automated tests for your custom language plugin (source code included).
|
@ -4,8 +4,8 @@ title: Tests and Fixtures
|
||||
|
||||
The *IntelliJ Platform* testing infrastructure is not tied to any specific test framework. In fact, the IntelliJ IDEA Team uses JUnit, TestNG and Cucumber for testing different parts of the project. However, most of the tests are written using JUnit 3.
|
||||
|
||||
When writing your own tests, you have the choice between using a standard base class to perform the test set up for you and using a fixture class, which lets you perform the setup manually and does not tie you to a specific test framework.
|
||||
When writing your tests, you have the choice between using a standard base class to perform the test set up for you and using a fixture class, which lets you perform the setup manually and does not tie you to a specific test framework.
|
||||
|
||||
With the former approach, you can use classes such as [`LightPlatformCodeInsightFixtureTestCase`](upsource:///platform/testFramework/src/com/intellij/testFramework/fixtures/LightPlatformCodeInsightFixtureTestCase.java) (renamed to `BasePlatformTestCase` in 2019.2).
|
||||
With the former approach, you can use classes such as [`LightPlatformCodeInsightFixtureTestCase`](upsource:///platform/testFramework/src/com/intellij/testFramework/fixtures/LightPlatformCodeInsightFixtureTestCase.java) (renamed to [`BasePlatformTestCase`](upsource:///platform/testFramework/src/com/intellij/testFramework/fixtures/BasePlatformTestCase.java) in 2019.2).
|
||||
|
||||
With the latter approach, you use the [`IdeaTestFixtureFactory`](upsource:///platform/testFramework/src/com/intellij/testFramework/fixtures/IdeaTestFixtureFactory.java) class to create instances of fixtures for the test environment, and you need to call the fixture creation and setup methods from the test setup method used by your test framework.
|
||||
|
@ -2,8 +2,9 @@
|
||||
title: Writing Tests
|
||||
---
|
||||
|
||||
In most cases, once you have the necessary files copied to the test project and loaded into the in-memory editor, writing the test itself involves invoking your plugin code and has few dependencies on the test framework. However, for many common cases the framework provides helper methods that can make testing easier:
|
||||
In most cases, once you have the necessary files copied to the test project and loaded into the in-memory editor, writing the test itself involves invoking your plugin code and has few dependencies on the test framework.
|
||||
|
||||
However, for many common cases, the framework provides helper methods that can make testing easier:
|
||||
* `type()` simulates the typing of a character or string into the in-memory editor.
|
||||
* `performEditorAction()` simulates the execution of an action in the context of the in-memory editor.
|
||||
* `complete()` simulates the invocation of code completion and returns the list of lookup elements displayed in the completion list (or `null` if the completion had no suggestions or one suggestion which was auto-inserted).
|
||||
@ -11,4 +12,4 @@ In most cases, once you have the necessary files copied to the test project and
|
||||
* `findSingleIntention()` in combination with `launchAction()` simulate the invocation of an intention action or inspection quickfix with the specified name.
|
||||
* `renameElementAtCaret()` or `rename()` simulate the execution of a rename refactoring.
|
||||
|
||||
To compare the results of executing the action with the expected results, you can use the `checkResultByFile()` method. The file with the expected results can also contain markup to specify the expected caret position or selected text range. If you're testing an action which modifies multiple files (a project-wide refactoring, for example), you can compare an entire directory under the test project with the expected output using `PlatformTestUtil.assertDirectoriesEqual()`.
|
||||
To compare the results of executing the action with the expected results, you can use the `checkResultByFile()` method. The file with the expected results can also contain [markup](test_project_and_testdata_directories.md#special-markup) to specify the expected caret position or selected text range. If you're testing an action that modifies multiple files (a project-wide refactoring, for example), you can compare an entire directory under the test project with the expected output using `PlatformTestUtil.assertDirectoriesEqual()`.
|
||||
|
@ -42,12 +42,12 @@ From the point of view of the caller, refresh operations can be either synchrono
|
||||
|
||||
Both synchronous and asynchronous refreshes can be initiated from any thread. If a refresh is initiated from a background thread, the calling thread must not hold a read action, because otherwise a deadlock would occur. See [IntelliJ Platform Architectural Overview](/basics/architectural_overview/general_threading_rules.md) for more details on the threading model and read/write actions.
|
||||
|
||||
The same threading requirements also apply to functions like [LocalFileSystem.refreshAndFindFileByPath()](upsource:///platform/platform-api/src/com/intellij/openapi/vfs/LocalFileSystem.java), which perform a partial refresh if the file with the specified path is not found in the snapshot.
|
||||
The same threading requirements also apply to functions like [`LocalFileSystem.refreshAndFindFileByPath()`](upsource:///platform/analysis-api/src/com/intellij/openapi/vfs/LocalFileSystem.java), which perform a partial refresh if the file with the specified path is not found in the snapshot.
|
||||
|
||||
In nearly all cases, using asynchronous refreshes is strongly preferred. If there is some code that needs to be executed after the refresh is complete, the code should be passed as a `postRunnable` parameter to one of the refresh methods:
|
||||
|
||||
* [RefreshQueue.createSession()](upsource:///platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java)<!--#L36-->
|
||||
* [VirtualFile.refresh()](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java)<!--#L681-->
|
||||
* [`RefreshQueue.createSession()`](upsource:///platform/analysis-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java)<!--#L36-->
|
||||
* [`VirtualFile.refresh()`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java)<!--#L681-->
|
||||
|
||||
Synchronous refreshes can cause deadlocks in some cases, depending on which locks are held by the thread invoking the refresh operation.
|
||||
|
||||
@ -55,15 +55,14 @@ Synchronous refreshes can cause deadlocks in some cases, depending on which lock
|
||||
|
||||
All changes happening in the virtual file system, either as a result of refresh operations or caused by user's actions, are reported as _virtual file system events_. VFS events are always fired in the event dispatch thread, and in a write action.
|
||||
|
||||
The most efficient way to listen to VFS events is to implement the `BulkFileListener` interface and to subscribe with it to the [VirtualFileManager.VFS_CHANGES](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFileManager.java)<!--#L34--> topic.
|
||||
The most efficient way to listen to VFS events is to implement the `BulkFileListener` interface and to subscribe with it to the [`VirtualFileManager.VFS_CHANGES`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFileManager.java)<!--#L34--> topic.
|
||||
A non-blocking variant [`AsyncFileListener`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/AsyncFileListener.java) is also available in 2019.2 or later.
|
||||
See [How do I get notified when VFS changes?](/basics/architectural_overview/virtual_file.md#how-do-i-get-notified-when-vfs-changes) for implementation details.
|
||||
|
||||
This API gives you all the changes detected during the refresh operation in one list, and lets you process them in batch. Alternatively, you can implement the `VirtualFileListener` interface and register it using [VirtualFileManager.addVirtualFileListener()](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFileManager.java)<!--#L113-->. This will let you process the events one by one.
|
||||
|
||||
> **Note** VFS listeners are application level, and will receive events for changes happening in *all* the projects opened by the user. You may need to filter out events which aren't relevant to your task.
|
||||
> **WARNING** VFS listeners are application level and will receive events for changes happening in *all* the projects opened by the user. You may need to filter out events that aren't relevant to your task (e.g., via [`ProjectFileIndex#isInContent()`](upsource:///platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java)).
|
||||
|
||||
VFS events are sent both before and after each change, and you can access the old contents of the file in the before event. Note that events caused by a refresh are sent after the changes have already occurred on disk - so when you process the `beforeFileDeletion` event, for example, the file has already been deleted from disk. However, it is still present in the VFS snapshot, and you can access its last contents using the VFS API.
|
||||
|
||||
Note that a refresh operation fires events only for changes in files that have been loaded in the snapshot. For example, if you accessed a `VirtualFile` for a directory but never loaded its contents using [VirtualFile.getChildren()](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java)<!--#L135-->, you may not get `fileCreated` notifications when files are created in that directory.
|
||||
Note that a refresh operation fires events only for changes in files that have been loaded in the snapshot. For example, if you accessed a `VirtualFile` for a directory but never loaded its contents using [`VirtualFile.getChildren()`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java)<!--#L135-->, you may not get `fileCreated` notifications when files are created in that directory.
|
||||
|
||||
If you loaded only a single file in a directory using `VirtualFile.findChild()`, you will get notifications for changes to that file, but you may not get created/deleted notifications for other files in the same directory.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.13'
|
||||
id 'org.jetbrains.intellij' version '0.4.15'
|
||||
}
|
||||
|
||||
group 'org.intellij.sdk'
|
||||
@ -20,7 +20,7 @@ dependencies {
|
||||
|
||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||
intellij {
|
||||
version '2019.1'
|
||||
version '2019.2.4'
|
||||
updateSinceUntilBuild = false
|
||||
}
|
||||
patchPluginXml {
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
22
code_samples/action_basics/gradlew
vendored
22
code_samples/action_basics/gradlew
vendored
@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@ -109,8 +125,8 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
18
code_samples/action_basics/gradlew.bat
vendored
18
code_samples/action_basics/gradlew.bat
vendored
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.13'
|
||||
id 'org.jetbrains.intellij' version '0.4.15'
|
||||
}
|
||||
|
||||
group 'org.intellij.sdk'
|
||||
@ -20,7 +20,7 @@ dependencies {
|
||||
|
||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||
intellij {
|
||||
version '2019.1'
|
||||
version '2019.2.4'
|
||||
updateSinceUntilBuild = false
|
||||
}
|
||||
patchPluginXml {
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
22
code_samples/editor_basics/gradlew
vendored
22
code_samples/editor_basics/gradlew
vendored
@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@ -109,8 +125,8 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
18
code_samples/editor_basics/gradlew.bat
vendored
18
code_samples/editor_basics/gradlew.bat
vendored
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.13'
|
||||
id 'org.jetbrains.intellij' version '0.4.15'
|
||||
}
|
||||
|
||||
group 'org.intellij.sdk'
|
||||
@ -18,7 +18,7 @@ dependencies {
|
||||
|
||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||
intellij {
|
||||
version '2019.1'
|
||||
version '2019.2.4'
|
||||
updateSinceUntilBuild = false
|
||||
|
||||
}
|
||||
@ -26,5 +26,3 @@ patchPluginXml {
|
||||
version = project.version
|
||||
}
|
||||
|
||||
// Force javadoc rebuild before jar is built
|
||||
jar.dependsOn javadoc
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
22
code_samples/facet_basics/gradlew
vendored
22
code_samples/facet_basics/gradlew
vendored
@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@ -109,8 +125,8 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
18
code_samples/facet_basics/gradlew.bat
vendored
18
code_samples/facet_basics/gradlew.bat
vendored
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.13'
|
||||
id 'org.jetbrains.intellij' version '0.4.15'
|
||||
}
|
||||
|
||||
group 'org.intellij.sdk'
|
||||
@ -18,14 +18,11 @@ dependencies {
|
||||
|
||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||
intellij {
|
||||
version '2019.1'
|
||||
version '2019.2.4'
|
||||
updateSinceUntilBuild = false
|
||||
plugins ['java']
|
||||
plugins 'java'
|
||||
}
|
||||
|
||||
patchPluginXml {
|
||||
version = project.version
|
||||
}
|
||||
|
||||
// Force javadoc rebuild before jar is built
|
||||
jar.dependsOn javadoc
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
22
code_samples/framework_basics/gradlew
vendored
22
code_samples/framework_basics/gradlew
vendored
@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m"'
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@ -109,8 +125,8 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
18
code_samples/framework_basics/gradlew.bat
vendored
18
code_samples/framework_basics/gradlew.bat
vendored
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m"
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
@ -1,8 +1,13 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id "org.jetbrains.intellij" version "0.4.13"
|
||||
id "org.jetbrains.intellij" version "0.4.15"
|
||||
}
|
||||
|
||||
group 'org.intellij.sdk'
|
||||
version '0.0.1'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
@ -14,11 +19,11 @@ dependencies {
|
||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||
intellij {
|
||||
// Define IntelliJ Platform API version to use for building this plugin
|
||||
version '2019.1'
|
||||
version '2019.2.4'
|
||||
}
|
||||
|
||||
patchPluginXml {
|
||||
untilBuild = '201.*'
|
||||
version = project.version
|
||||
}
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
|
Binary file not shown.
@ -1,6 +1,5 @@
|
||||
#Wed Oct 17 19:29:01 MSK 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
130
code_samples/gradle_plugin_demo/gradlew
vendored
130
code_samples/gradle_plugin_demo/gradlew
vendored
@ -1,4 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
@ -6,47 +22,6 @@
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
@ -61,9 +36,49 @@ while [ -h "$PRG" ] ; do
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
@ -90,7 +105,7 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
@ -110,10 +125,11 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
@ -154,11 +170,19 @@ if $cygwin ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
30
code_samples/gradle_plugin_demo/gradlew.bat
vendored
30
code_samples/gradle_plugin_demo/gradlew.bat
vendored
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -8,14 +24,14 @@
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
@ -46,10 +62,9 @@ echo location of your Java installation.
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
@ -60,11 +75,6 @@ set _SKIP=2
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.13'
|
||||
id 'org.jetbrains.intellij' version '0.4.15'
|
||||
}
|
||||
|
||||
group 'org.intellij.sdk'
|
||||
@ -18,7 +18,7 @@ dependencies {
|
||||
|
||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||
intellij {
|
||||
version '2019.1'
|
||||
version '2019.2.4'
|
||||
updateSinceUntilBuild = false
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
22
code_samples/inspection_basics/gradlew
vendored
22
code_samples/inspection_basics/gradlew
vendored
@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@ -109,8 +125,8 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
18
code_samples/inspection_basics/gradlew.bat
vendored
18
code_samples/inspection_basics/gradlew.bat
vendored
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.13'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.3.31'
|
||||
id 'org.jetbrains.intellij' version '0.4.15'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.3.60'
|
||||
}
|
||||
|
||||
group 'org.intellij.sdk'
|
||||
@ -26,7 +26,7 @@ sourceSets {
|
||||
|
||||
// See https://github.com/JetBrains/gradle-intellij-plugin/
|
||||
intellij {
|
||||
version '2019.1'
|
||||
version '2019.2.4'
|
||||
updateSinceUntilBuild = false
|
||||
}
|
||||
compileKotlin {
|
||||
@ -35,6 +35,3 @@ compileKotlin {
|
||||
compileTestKotlin {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
// Force javadoc rebuild before jar is built
|
||||
jar.dependsOn javadoc
|
Binary file not shown.
@ -1,6 +1,5 @@
|
||||
#Thu Jun 13 15:15:25 PDT 2019
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
|
||||
|
22
code_samples/kotlin_demo/gradlew
vendored
22
code_samples/kotlin_demo/gradlew
vendored
@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@ -109,8 +125,8 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
18
code_samples/kotlin_demo/gradlew.bat
vendored
18
code_samples/kotlin_demo/gradlew.bat
vendored
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
@ -28,31 +28,6 @@
|
||||
<!-- Resource bundle from which the text of plugin descriptions, action names and etc. will be loaded -->
|
||||
<resource-bundle>org.jetbrains.tutorials.sample.PluginSampleBundle</resource-bundle>
|
||||
|
||||
<!-- Plugin's application components -->
|
||||
<application-components>
|
||||
<component>
|
||||
<!-- Component's interface class -->
|
||||
<interface-class>org.jetbrains.tutorials.sample.DummyApplicationComponent</interface-class>
|
||||
<!-- Component's implementation class -->
|
||||
<implementation-class>org.jetbrains.tutorials.sample.DummyApplicationComponentImpl</implementation-class>
|
||||
</component>
|
||||
</application-components>
|
||||
|
||||
<!-- Plugin's project components -->
|
||||
<project-components>
|
||||
<component>
|
||||
<!-- Interface and implementation classes are the same -->
|
||||
<interface-class>org.jetbrains.tutorials.sample.DummyProjectComponent</interface-class>
|
||||
<implementation-class>org.jetbrains.tutorials.sample.DummyProjectComponentImpl</implementation-class>
|
||||
<!-- If the "workspace" option is set "true", the component saves its state to the .iws file
|
||||
instead of the .ipr file. Note that the <option> element is used only if the component implements the JDOMExternalizable interface. Otherwise, the use of the <option> element takes no effect.-->
|
||||
|
||||
<option name="workspace" value="true"/>
|
||||
<!-- If the "loadForDefaultProject" tag is present, the project component is instantiated also for the default project. -->
|
||||
<loadForDefaultProject/>
|
||||
</component>
|
||||
</project-components>
|
||||
|
||||
<!-- Actions -->
|
||||
<actions>
|
||||
<!-- The <action> element defines an action to register.
|
||||
|
@ -1,9 +0,0 @@
|
||||
package org.jetbrains.tutorials.sample;
|
||||
|
||||
import com.intellij.openapi.components.BaseComponent;
|
||||
|
||||
/**
|
||||
* @author Anna Bulenkova
|
||||
*/
|
||||
interface DummyApplicationComponent extends BaseComponent {
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package org.jetbrains.tutorials.sample;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Anna Bulenkova
|
||||
*/
|
||||
public class DummyApplicationComponentImpl implements DummyApplicationComponent {
|
||||
@Override
|
||||
public void initComponent() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeComponent() {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "DummyApplicationComponent";
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package org.jetbrains.tutorials.sample;
|
||||
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
|
||||
/**
|
||||
* @author Anna Bulenkova
|
||||
*/
|
||||
public interface DummyProjectComponent extends ProjectComponent {
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package org.jetbrains.tutorials.sample;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Anna Bulenkova
|
||||
*/
|
||||
public class DummyProjectComponentImpl implements DummyProjectComponent {
|
||||
@Override
|
||||
public void projectOpened() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void projectClosed() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initComponent() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeComponent() {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "DummyProjectComponent";
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* @author Anna Bulenkova
|
||||
*/
|
||||
public class DummyActionGroup extends ActionGroup {
|
||||
public class DummyActionGroup extends DefaultActionGroup {
|
||||
@NotNull
|
||||
@Override
|
||||
public AnAction[] getChildren(AnActionEvent anActionEvent) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.intellij' version '0.4.13'
|
||||
id 'org.jetbrains.intellij' version '0.4.15'
|
||||
}
|
||||
|
||||
group 'com.intellij.sdk'
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m"'
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@ -109,8 +125,8 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m"
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user