IDEA mentioning removed where not needed, changed to Platform

This commit is contained in:
Anna Bulenkova 2015-04-23 10:48:02 +02:00
parent a8b03e1f4a
commit 1a50d41d0a
19 changed files with 38 additions and 38 deletions

View File

@ -3,11 +3,11 @@ layout: editable
title: Architectural Overview
---
The goal of this topic is to describe the architecture of IntelliJ IDEA from a plugin developer's point of view. It will be organized in a
The goal of this topic is to describe the architecture of IntelliJ Platform from a plugin developer's point of view. It will be organized in a
task-based manner: rather than listing all the things that you can do with each object and describing how they are all implemented, it will try
to answer questions "what can I do with this object", "how do I get to this object" and so on.
This topic assumes that the reader is familiar with the basic concepts of IntelliJ IDEA plugin development. If you don't know anything at all about plugin development, you should start with the live demo and tutorials at
This topic assumes that the reader is familiar with the basic concepts of IntelliJ Platform plugin development. If you don't know anything at all about plugin development, you should start with the live demo and tutorials at
[http://www.jetbrains.com/idea/plugins/index.html](http://www.jetbrains.com/idea/plugins/index.html),
and then return to this document.

View File

@ -4,7 +4,7 @@ title: Documents
---
A document is an editable sequence of Unicode characters, which typically corresponds to the text contents of a virtual file.
Line breaks in a document are always normalized to \n. IntelliJ IDEA handles encoding and line break conversions when loading and saving documents transparently.
Line breaks in a document are always normalized to \n. IntelliJ Platform handles encoding and line break conversions when loading and saving documents transparently.
## How do I get one?

View File

@ -29,7 +29,7 @@ class. For example, to get the PSI tree for XML, use ```fileViewProvider.getPsi(
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](http://www.jetbrains.org/intellij/sdk/docs/plugin_extensions_and_extension_points.html)
available in the IntelliJ IDEA core.
available in the IntelliJ Platform core.
This extension point is declared using the
[FileTypeExtensionPoint](https://github.com/JetBrains/intellij-community/blob/master/platform/core-api/src/com/intellij/openapi/fileTypes/FileTypeExtensionPoint.java)
bean class.

View File

@ -3,7 +3,7 @@ layout: editable
title: General Threading Rules
---
In general, the data structures of IntelliJ IDEA are covered by a single "multiple readers / single writer" lock.
In general, the data structures of IntelliJ Platform are covered by a single "multiple readers / single writer" lock.
Reading data is allowed from any thread.
Reading data from the UI thread does not require any special effort, however, read operations performed from any other thread need to be wrapped in a read action by using ```ApplicationManager.getApplication().runReadAction()```.
Writing the data is only allowed from the UI thread, and write operations always need to be wrapped in a write action with ```ApplicationManager.getApplication().runWriteAction()```.

View File

@ -59,7 +59,7 @@ To hook into operations performed in the local file system (for example, if you
#### What are the rules for working with it?
See
[IntelliJ IDEA Virtual File System](http://www.jetbrains.org/intellij/sdk/docs/virtual_file_system.html)
[IntelliJ Platform Virtual File System](http://www.jetbrains.org/intellij/sdk/docs/virtual_file_system.html)
for a detailed description of the VFS architecture and usage rules.
#### Samples

View File

@ -5,6 +5,6 @@ title: Getting started
For developing IntelliJ IDEA plugins, you can use either IntelliJ IDEA Community Edition or IntelliJ IDEA Ultimate - both of them include the complete set of plugin development tools.
For developing plugins with IntelliJ Platform, you can use either IntelliJ IDEA Community Edition or IntelliJ IDEA Ultimate - both of them include the complete set of plugin development tools.
<!--TODO rework this copy-paste-->

View File

@ -26,14 +26,14 @@ For example:
If a plugin does not include any module dependency tags in its
<!--TODO link to sample_plugin file-->
[plugin.xml](),
it's assumed to be a legacy plugin and it's loaded only in IntelliJ IDEA.
it's assumed to be a legacy plugin and it's loaded only in IntelliJ Platform based product.
If the
<!--TODO link to sample_plugin file-->
[plugin.xml]()
includes one or more of such tags, the plugin is loaded if the product contains all of the modules on which the plugin depends.
The following modules are currently available in all products based on the IntelliJ platform:
The following modules are currently available in all products based on the IntelliJ Platform:
* *com.intellij.modules.platform*
@ -74,7 +74,7 @@ If your plugin works with all products but provides some Java-specific functiona
</depends>
```
Before marking a plugin as compatible with all products, you need to verify that it doesn't use any APIs which are specific to IntelliJ IDEA.
Before marking a plugin as compatible with all products, you need to verify that it doesn't use any APIs which are specific to IntelliJ Platform.
In order to do that, you can create an IntelliJ Platform SDK pointing to an installation of RubyMine/PyCharm/..., compile your plugin against that SDK and verify that everything compiles.

View File

@ -6,7 +6,7 @@ title: Running and Debugging a Plugin
*IntelliJ IDEA* allows you to run and debug a plugin without leaving the IDE.
*IntelliJ Platform* allows you to run and debug a plugin without leaving the IDE.
To run or debug the plugin from within *IntelliJ IDEA*, you need a configured special profile (a Run/Debug configuration) that specifies the class to run, VM parameters and other specific options.
In most cases, you can use default *Run\/Debug* configuration profiles for your plugin projects.
For information on how to change the Run/Debug configuration profile, refer to

View File

@ -58,7 +58,7 @@ Note that application-level components must be registered in the ```<application
#### Quick creation of application components
*IntelliJ IDEA* suggests a simplified way of creating application components, with all the required infrastructure.
The IDEA interface will help you declare the application component's implementation class and automatically makes appropriate changes to the ```<application-components>``` section of the *plugin.xml* file.
The IntelliJ interface will help you declare the application component's implementation class and automatically makes appropriate changes to the ```<application-components>``` section of the *plugin.xml* file.
**To create and register an application component:**

View File

@ -6,8 +6,8 @@ title: Plugin Dependencies
In your plugin, you may depend on classes from other plugins, either bundled, third-party or your own.
In order to do so, you need to perform the following two steps:
* Add the jars of the plugin you're depending on to the classpath of your IntelliJ IDEA SDK.
(**Note**: Don't add the plugin jars as a library: this will fail at runtime because IntelliJ IDEA will load two separate copies of the dependency plugin classes.)
* Add the jars of the plugin you're depending on to the classpath of your *IntelliJ Platform SDK*.
**Note**: Don't add the plugin jars as a library: this will fail at runtime because IntelliJ Platform will load two separate copies of the dependency plugin classes.
* Add a <depends> tag to your plugin.xml, adding the ID of the plugin you're depending on as the contents of the tag.
For example:

View File

@ -98,7 +98,7 @@ To clarify this procedure, consider the following sample section of the plugin.x
## How to Get the Extension Points List?
To get a list of extension points available in the *IntelliJ IDEA* core, consult the _\<extensionPoints\>_ section of the following XML configuration files:
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](https://github.com/JetBrains/intellij-community/blob/master/platform/platform-resources/src/META-INF/LangExtensionPoints.xml)

View File

@ -3,14 +3,14 @@ layout: editable
title: Plugin Services
---
*IntelliJ IDEA* provides the concept of _services_.
*IntelliJ Platform* provides the concept of _services_.
A _service_ is a plugin component loaded on demand, when your plugin calls the ```getService``` method of the
[ServiceManager](https://github.com/JetBrains/intellij-community/blob/master/platform/core-api/src/com/intellij/openapi/components/ServiceManager.java)
class.
*IntelliJ IDEA* ensures that only one instance of a service is loaded even though the service is called several times.
*IntelliJ Platform* ensures that only one instance of a service is loaded even though the service is called several times.
A service must have the interface and implementation classes specified in the plugin.xml file.
The service implementation class is used for service instantiation.
*IntelliJ IDEA* offers three types of services: _application level_ services, _project level_ services and _module level_ services.
*IntelliJ Platform* offers three types of services: _application level_ services, _project level_ services and _module level_ services.
## How to Declare a Service?

View File

@ -5,7 +5,7 @@ title: Project Structure
<!--TODO split into parts accordingly to the table of contents-->
This topic considers the concept of **IntelliJ IDEA** projects and related subjects, such as _modules_, _facets_, _libraries_, _SDK_.
This topic considers the concept of projects based on **IntelliJ Platform** and related subjects, such as _modules_, _facets_, _libraries_, _SDK_.
The project structure and Java classes you can use to manage projects and modules have been considered.
## Project and Its Components
@ -20,8 +20,8 @@ in **IntelliJ IDEA** Web Help.
#### Project
In **IntelliJ IDEA**, a _project_ encapsulates all your source code, libraries, build instructions into a single organizational unit.
Everything you do in **IntelliJ IDEA**, is done within the context of a project. A project defines some collections referred to as _modules_ and _libraries_.
In **IntelliJ Platform**, a _project_ encapsulates all your source code, libraries, build instructions into a single organizational unit.
Everything you do using **IntelliJ Platform SDK**, is done within the context of a project. A project defines some collections referred to as _modules_ and _libraries_.
Depending on the logical and functional requirements to the project, you can create a _single-module_ or a _multi-module_ project.
#### Module
@ -30,7 +30,7 @@ A _module_ is a discrete unit of functionality that can be run, tested, and debu
#### Library
A _library_ is an archive of compiled code (such as JAR files) that your modules depend on. **IntelliJ IDEA** supports three types of libraries:
A _library_ is an archive of compiled code (such as JAR files) that your modules depend on. **IntelliJ Platform** supports three types of libraries:
* **Module Library**: the library classes are visible only in this module and the library information is recorded in the module \**.iml file.
* **Project Library**: the library classes are visible within the project and the library information is recorded in the project \**.ipr file or in _.idea/libraries_.
* **Global Library**: the library information is recorded in the _applicationLibraries.xml_ file into the _<User Home>/.IntelliJIdea/config/options_ directory. Global libraries are similar to project libraries, but are visible for the different projects.
@ -80,7 +80,7 @@ The Java classes and interfaces that you can use to explore and change the proje
#### How to Work with Project Files?
**IntelliJ IDEA** stores the project configuration data in XML files. The list of those files depends on the plugin
**IntelliJ Platform** stores the project configuration data in XML files. The list of those files depends on the plugin
[project format](http://www.jetbrains.com/idea/webhelp/project.html).
For _file-based_ format projects, the information core to the project itself (e.g. location of the component modules, compiler settings, etc.) is stored in the _<%project name%>.IPR_ file.
@ -126,7 +126,7 @@ Messages.showInfoMessage("Source roots for the " + projectName + " plugin:\n" +
#### How do I check whether a file is related to a project?
**IntelliJ IDEA** provides the ```ProjectFileIndex``` interface you can use to verify whether a file or directory is related to the specified IDEA project.
**IntelliJ Platform** provides the ```ProjectFileIndex``` interface you can use to verify whether a file or directory is related to the specified IDEA project.
This section explains how you can use this interface.
##### How do I get an instance of the ProjectFileIndex interface?
@ -185,7 +185,7 @@ Note that by default, the project modules use the project SDK. Optionally, you c
## Working with Modules
*IntelliJ IDEA* provides a number of Java classes and interfaces you can use to work with modules:
*IntelliJ Platform* provides a number of Java classes and interfaces you can use to work with modules:
* [ModuleManager](http://git.jetbrains.org/?p=idea/community.git;a=blob;f=platform/projectModel-api/src/com/intellij/openapi/module/ModuleManager.java;hb=HEAD) abstract class.
* [Module](http://git.jetbrains.org/?p=idea/community.git;a=blob;f=platform/core-api/src/com/intellij/openapi/module/Module.java;hb=HEAD) interface.

View File

@ -4,7 +4,7 @@ title: PSI Cookbook
---
This page gives a list of recipes for the most common operations for working with the PSI (Program Structure Interface) in IntelliJ IDEA. Unlike [Developing Custom Language Plugins for IntelliJ IDEA], it talks about working with the PSI of existing languages (such as Java).
This page gives a list of recipes for the most common operations for working with the PSI (Program Structure Interface) of IntelliJ Platform. Unlike [Developing Custom Language Plugins for IntelliJ IDEA], 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?

View File

@ -4,7 +4,7 @@ title: Testing Plugins
---
Before discussing the specific details of the IntelliJ IDEA plugin test framework, it's worth looking at the general approach that the IntelliJ IDEA team uses for testing the IDE code.
Before discussing the specific details of the IntelliJ Platform plugin test framework, it's worth looking at the general approach that the IntelliJ IDEA team uses for testing the IDE code.
Our intention here is not so much to be prescriptive, and more to set the expectations we have good tools to support the approach that we use, and less good (or no) tools for approaches that we don't use.
Most of the tests in the IntelliJ IDEA codebase are *model-level functional tests*. What this means is the following:
@ -23,7 +23,7 @@ In a product with 10+ years of lifetime that has gone through a large number of
Another consequence of our testing approach is what our test framework does not provide:
* 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 IDEA components that your plugin class will need to have, and we recommend working with real components instead.
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](http://fest.easytesting.org/) or

View File

@ -3,7 +3,7 @@ layout: editable
title: Light and Heavy Tests
---
As mentioned above, plugin tests run in a real, rather than mocked, IntelliJ IDEA environment, and use real implementations for most of the application and project components. Loading the project components for a project is a fairly expensive operation, and we want to avoid doing it for each test.
As mentioned above, plugin tests run in a real, rather than mocked, IntelliJ Platform environment, and use real implementations for most of the application and project components. Loading the project components for a project is a fairly expensive operation, and we want to avoid doing it for each test.
Because of that, we distinguish between *heavy* tests, which create a new project for each test, and *light* tests, which reuse a project from the previous test run when possible. Light and heavy tests use different base classes or fixture classes, as described below.
**Note:** Because of the performance difference, we recommend plugin developers to write light tests whenever possible.

View File

@ -9,13 +9,13 @@ The files for the test project physically exist either in a temporary directory
```LightPlatformCodeInsightFixtureTestCase``` uses an in-memory implementation; if you set up the test environment by calling ```IdeaTestFixtureFactory.createCodeInsightFixture```, you can specify the implementation to use.
Note that 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.
In that case, you need to try running the test again, and if that doesn't help, delete the "system" subdirectory under the sandbox directory specified in the IntelliJ IDEA SDK settings.
In that case, you need to try running the test again, and if that doesn't help, delete the "system" subdirectory under the sandbox directory specified in the IntelliJ Platform SDK settings.
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).
To specify the location of testdata, you must override the ```LightPlatformCodeInsightFixtureTestCase.getTestDataPath()``` method (the default implementation assumes running as part of the IntelliJ IDEA source tree and is not appropriate for third-party plugins).
To specify the location of testdata, you must override the ```LightPlatformCodeInsightFixtureTestCase.getTestDataPath()``` method (the default implementation assumes running as part of the IntelliJ Platform source tree and is not appropriate for third-party plugins).
Note that a very common pattern in IntelliJ IDEA tests is to use the name of the test method being executed as the base for building the testdata file paths.
Note that a very common pattern in IntelliJ Platform tests is to use the name of the test method being executed as the base for building the testdata file paths.
This allows to reuse most of the code between different test methods that test different aspects of the same feature, and this approach is also recommended for third-party plugin tests.
The name of the test method can be retrieved using ```UsefulTestCase.getTestName()```.

View File

@ -9,5 +9,5 @@ In fact, the IntelliJ IDEA team uses both JUnit, TestNG and Cucumber for testing
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.
With the former approach, you can use classes such as ```LightPlatformCodeInsightFixtureTestCase``` (despite being one of the longest and ugliest class names you'll run into in the IntelliJ IDEA API, it's actually the recommended approach for writing tests).
With the former approach, you can use classes such as ```LightPlatformCodeInsightFixtureTestCase``` (despite being one of the longest and ugliest class names you'll run into in the IntelliJ Platform API, it's actually the recommended approach for writing tests).
With the latter approach, you use the ```IdeaTestFixtureFactory``` 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.

View File

@ -4,7 +4,7 @@ title: Virtual File System
---
The virtual file system (VFS) is a component of IntelliJ IDEA that encapsulates most of its activity for working with files. It serves the following main purposes:
The virtual file system (VFS) is a component of IntelliJ Platform that encapsulates most of its activity for working with files. It serves the following main purposes:
* Providing a universal API for working with files regardless of their actual location (on disk, in archive, on a HTTP server etc.);
* Tracking file modifications and providing both old and new versions of the file content when a modification is detected;
@ -22,11 +22,11 @@ The snapshot is updated from disk during _refresh operations_, which generally h
A refresh operation synchronizes the state of a part of the VFS with the actual disk contents. Refresh operations are explicitly invoked from the IntelliJ IDEA or plugin code - i.e. when a file is changed on disk while IntelliJ IDEA is running, the change will not be immediately picked up by the VFS; the VFS will be updated during the next refresh operation which includes the file in its scope.
IntelliJ IDEA refreshes the entire project contents asynchronously on startup. Also, by default, it performs a refresh operation when the user switches to it from another app, but users can turn this off via Settings \| Synchronize files on frame activation.
IntelliJ Platform refreshes the entire project contents asynchronously on startup. Also, by default, it performs a refresh operation when the user switches to it from another app, but users can turn this off via Settings \| Synchronize files on frame activation.
On Windows, Mac and Linux IntelliJ IDEA starts a native file watcher process that receives file change notifications from the file system and reports them to IntelliJ IDEA. If a file watcher is available, a refresh operation looks only at the files that have been reported as changed by the file watcher. If no file watcher is present (pr it is disabled), a refresh operation walks through all directories and files in the refresh scope.
On Windows, Mac and Linux IntelliJ Platform starts a native file watcher process that receives file change notifications from the file system and reports them to IntelliJ Platform. If a file watcher is available, a refresh operation looks only at the files that have been reported as changed by the file watcher. If no file watcher is present (pr it is disabled), a refresh operation walks through all directories and files in the refresh scope.
Refresh operations are based on file timestamps. If the contents of a file was changed but its timestamp remained the same, IntelliJ IDEA will not pick up the updated contents.
Refresh operations are based on file timestamps. If the contents of a file was changed but its timestamp remained the same, IntelliJ Platform will not pick up the updated contents.
There is currently no facility for removing files from the snapshot. If a file was loaded there once, it remains there forever (unless it was deleted from the disk and a refresh operation was called on one of its parent directories).
@ -38,7 +38,7 @@ During the lifetime of IDEA, multiple VirtualFile instances may correspond to th
From the point of view of the caller, refresh operations can be either synchronous or asynchronous. In fact, the refresh operations are executed according to their own threading policy, and the synchronous flag simply means that the calling thread will be blocked until the refresh operation (which will most likely run on a different thread) is completed.
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 IDEA Architectural Overview] for more details on the threading model and read/write actions). The same threading requirements also apply to functions like LocalFileSystem.refreshAndFindFileByPath(), which perform a partial refresh if the file with the specified path is not found in the snapshot.
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] for more details on the threading model and read/write actions). The same threading requirements also apply to functions like LocalFileSystem.refreshAndFindFileByPath(), 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() or VirtualFile.refresh()). Synchronous refreshes can cause deadlocks in some cases, depending on which locks are held by the thread invoking the refresh operation.