mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
Merge pull request #111 from JohnHake/ijsdk-85
ijsdk-85 - Revised setting up php environment in IntelliJ. Refreshed all images.
This commit is contained in:
commit
559ca15db5
@ -2,8 +2,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 steps:
|
||||
|
||||
Your plugin may depend on classes from other plugins, either bundled, third-party or your own. In order to express such
|
||||
dependencies (e.g. Kotlin), you need to perform the following steps:
|
||||
* If the plugin is not bundled, run the sandbox instance of your target IDE and install the plugin there.
|
||||
* Add the jars of the plugin you're depending on to the classpath of your *IntelliJ Platform SDK*.
|
||||
In order to do that, open the Project Structure dialog, select the SDK you're using, press the + button in the Classpath tab, and
|
||||
@ -17,7 +17,7 @@ In your plugin, you may depend on classes from other plugins, either bundled, th
|
||||
|
||||
> **warning** Do not 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.
|
||||
|
||||
* If you're using Gradle to build your plugin, instead of doing the above add it to the `plugins` parameter of the `intellij` block in your build.gradle, for example:
|
||||
* If you're using Gradle to build your plugin, then instead of doing the above add the dependency to the `plugins` parameter of the `intellij` block in your build.gradle, for example:
|
||||
|
||||
```groovy
|
||||
intellij {
|
||||
|
@ -1,7 +1,9 @@
|
||||
---
|
||||
title: Existing Third Party Plugins
|
||||
title: Example PhpStorm Third Party Plugins
|
||||
---
|
||||
|
||||
This page lists some example PhpStorm plugins created by third party developers.
|
||||
|
||||
## Symfony2 Plugin
|
||||
|
||||
Symfony2 plugin is a free plugin for Symfony2 framework developers.
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 53 KiB |
Binary file not shown.
Before Width: | Height: | Size: 48 KiB |
@ -2,10 +2,15 @@
|
||||
title: PhpStorm Plugin Development
|
||||
---
|
||||
|
||||
Plugins for PhpStorm are developed in Java using IntelliJ IDEA (Community Edition is sufficient in this case). You will also need a copy of PhpStorm to develop against. The [PsiViewer plugin](https://plugins.jetbrains.com/plugin/227-psiviewer) will also be useful.
|
||||
### Development and Testing Tools
|
||||
Plugins for PhpStorm are developed in Java using either edition of IntelliJ IDEA. The Community Edition of IntelliJ IDEA can
|
||||
be used for developing, but not testing, a PhpStorm plugin. Although IntelliJ IDEA Ultimate Edition (with the PHP plugin) can be
|
||||
used for testing PhpStorm plugins, the recommended approach is to use PhpStorm for testing.
|
||||
|
||||
The [PsiViewer plugin](https://plugins.jetbrains.com/plugin/227-psiviewer) is also recommended.
|
||||
|
||||
### PhpStorm Specifics
|
||||
|
||||
* [Setting-up the environment](setting_up_environment.md)
|
||||
* [PHP Open API](php_open_api.md)
|
||||
* [Existing 3rd party plugins](existing_plugins.md)
|
||||
* [Example Third Party PhpStorm plugins](existing_plugins.md)
|
||||
|
@ -2,42 +2,26 @@
|
||||
title: Setting-up the Environment for PhpStorm Plugin Development
|
||||
---
|
||||
|
||||
## General information
|
||||
Follow steps that are described at [Getting Started with Plugin Development](/basics/getting_started.md).
|
||||
### General information
|
||||
Please familiarize yourself with the [Getting Started with Plugin Development](/basics/getting_started.md)
|
||||
section of this guide.
|
||||
|
||||
There are two ways to develop plugins for PhpStorm:
|
||||
If you are using a [DevKit](/basics/getting_started/using_dev_kit.md)
|
||||
workflow to develop plugins for PhpStorm, the recommended approach is to base the plugin project SDK on an installation
|
||||
of PhpStorm. An alternative approach is to base the plugin project SDK on an installation of IntelliJ IDEA Ultimate with the PHP plugin.
|
||||
However, this runs the risk of accidentally using some APIs which are not available in PhpStorm.
|
||||
|
||||
1. Use IntelliJ IDEA Ultimate with the PHP plugin installed.
|
||||
2. Use PhpStorm as a targeted IDE in a first place.
|
||||
### How to use the PhpStorm OpenAPI Library for Plugin Development
|
||||
|
||||
The choice affects how you will configure SDK for the plugin. In the first case you need to specify current installation of IntelliJ IDEA as SDK and in the second case you need to specify current installation of PhpStorm. This step is described in [Getting Started with Plugin Development](/basics/getting_started.md).
|
||||
> **Note** The OpenAPI is available for PhpStorm 6 and above.
|
||||
|
||||
## How to use OpenAPI library
|
||||
The [Plugin Dependencies](/basics/plugin_structure/plugin_dependencies.md) page describes adding dependencies to the
|
||||
DevKit as well as Gradle development environments. Follow the instructions to:
|
||||
|
||||
> OpenAPI is available for PhpStorm 6 and above.
|
||||
* Add the PHP OpenAPI classes to the classpath of your plugin:
|
||||
* For Gradle-based plugin development, add the `com.jetbrains.php` plugin ID to your build.gradle file.
|
||||
* For DevKit-based plugin development, add the `php-openapi.jar` and `php.jar` libraries to the classpath of your project's SDK.
|
||||
These libraries are located in `<your_installation_of_PhpStorm>/plugins/php/lib` directory.
|
||||
|
||||
This section explains how to configure the IntelliJ Platform for using PhpStorm OpenAPI.
|
||||
|
||||
### Adding library to a module
|
||||
|
||||
1. Open Project Structure **File \| Project Structure**
|
||||
2. Select **Libraries**
|
||||
3. Press **Add** button
|
||||
4. Find and select `php-openapi.jar` and `php.jar`. They are located in `<your_installation_of_PhpStorm>/plugins/php/lib`.
|
||||
|
||||

|
||||
|
||||
5. Agree to add the libraries to your Module
|
||||
6. Open **Modules \| Dependencies** and change **Scope** to **Provided**. This step is necessary because otherwise `ClassCastException` will be thrown because two instances of the library will be loaded via different class loaders
|
||||
|
||||

|
||||
|
||||
### Adding dependencies to `plugin.xml`
|
||||
|
||||
1. Open `plugin.xml` in the directory `META-INF`
|
||||
2. Add two `<depends>` items to `plugin.xml`:
|
||||
|
||||
```xml
|
||||
<depends>com.jetbrains.php</depends>
|
||||
<depends>com.intellij.modules.platform</depends>
|
||||
```
|
||||
* Add the `com.jetbrains.php` and `com.intellij.modules.platform` dependencies
|
||||
to the your plugin project's `plugin.xml` file.
|
||||
|
Loading…
x
Reference in New Issue
Block a user