+
+ true
+ true
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..f823ea3
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,1007 @@
+
+
+# IntelliJ Platform Plugin Template Changelog
+
+## [Unreleased]
+
+### Added
+
+- Add operator function for resource bundle key access in `MyBundle`
+
+### Changed
+
+- Upgrade Gradle Wrapper to `9.5.0`
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.16.0`
+- Dependencies - upgrade IntelliJ IDEA to `2025.2.6.2`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `v7`
+- Dependencies (GitHub Actions) - upgrade `gradle/actions/setup-gradle` to `v6`
+- GitHub Actions - simplify plugin artifact upload in GitHub Actions workflow
+
+### Removed
+
+- Remove changelog configuration from `build.gradle.kts` as it is preconfigured now in the IntelliJ Platform Gradle Plugin
+- Remove `intellijPlatform.pluginConfiguration.description` default configuration from `build.gradle.kts`.
+- Remove `run-ui-tests.yml` workflow for outdated UI testing setup
+
+### Fixed
+
+- Update Run Plugin configuration to fix sandbox log file path
+- Remove `settings.gradle.kts` for cleanup of unused project configuration.
+- Update Run Plugin configuration to fix sandbox log file path
+
+## [2.5.0] - 2026-04-17
+
+### Changed
+
+- Migrate IntelliJ Platform repository configuration to `settings.gradle.kts`
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.14.0`
+- Update `group` property in `gradle.properties` and remove redundant `pluginGroup` configuration from `build.gradle.kts`
+- Update `version` property in `gradle.properties` and remove redundant `pluginVersion` configuration from `build.gradle.kts`
+- Inline `junit` dependency version in `build.gradle.kts` and remove it from `libs.versions.toml`.
+- Remove `platformVersion` property and inline its value in `build.gradle.kts` for cleaner configuration.
+- Remove `libs.versions.toml` and inline plugin versions in build scripts for simpler configuration.
+
+### Removed
+
+- Remove (empty) plugin and module dependency configurations from `build.gradle.kts` and `gradle.properties`.
+- Remove `opentest4j` dependency from `build.gradle.kts` and `libs.versions.toml`, redundant since IntelliJ Platform 251+
+- Remove `gradleVersion` property and wrapper configuration as Gradle Wrapper should be updated with `./gradlew wrapper --gradle-version=9.4.1 && ./gradlew wrapper`
+- Remove Qodana configuration, dependencies, and related workflow steps.
+- Remove Kover configuration, dependencies, and related workflow steps.
+- Remove redundant Kotlin JVM toolchain configuration from `build.gradle.kts`
+- Remove redundant `intellijPlatform.pluginConfiguration.ideaVersion.sinceBuild` configuration from `build.gradle.kts`
+- Remove redundant `pluginSinceBuild` property from `gradle.properties`
+- Remove redundant `intellijPlatform.signing` configuration from `build.gradle.kts`
+- Remove redundant `intellijPlatform.publishing.token` configuration from `build.gradle.kts`
+- Remove redundant `intellijPlatform.pluginVerification` configuration from `build.gradle.kts`
+- Remove redundant `java` plugin declaration from `build.gradle.kts`
+- Remove `pluginVersion` configuration from `build.gradle.kts`.
+- Remove `pluginName` property from `gradle.properties` and `build.gradle.kts` as it is already set in the `plugin.xml`
+- Remove `intellijPlatform.publishing.channels` configuration from `build.gradle.kts`.
+- Remove `runIdeForUiTests` obsolete task from `build.gradle.kts`.
+
+## [2.4.1] - 2026-03-20
+
+### Fixed
+
+- GitHub Actions: handle empty releases list in draft cleanup step using `xargs -r`
+
+### Changed
+
+- Upgrade Gradle Wrapper to `9.4.1`
+- Set empty `versionPrefix` for changelog in Gradle build file.
+- Update `platformVersion` to `2025.2.6.1`
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.13.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `2.3.20`
+- Dependencies - upgrade `org.jetbrains.qodana` to `2025.3.2`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.9.7`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `v6`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `v6`
+- GitHub Actions: Setup Java and Gradle actions for the `releaseDraft` build step
+
+## [2.4.0] - 2025-11-25
+
+### Fixed
+
+- Use the GitHub event release body for a condition when creating the Release Draft
+
+### Changed
+
+- Use `intellijIdea(version)` dependency helper instead of `create(type, version)`
+- Upgrade Gradle Wrapper to `9.2.1`
+- Update `platformVersion` to `2025.2.5`
+- Change since build to `252` (2025.2)
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.10.5`
+- Dependencies - upgrade `org.jetbrains.changelog` to `2.5.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `2.2.21`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.9.3`
+- Dependencies - upgrade `org.jetbrains.qodana` to `2025.2.2`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `v5`
+- Dependencies (GitHub Actions) - upgrade `actions/setup-java` to `v5`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `v5`
+- Dependencies (GitHub Actions) - upgrade `gradle/actions/setup-gradle` to `v5`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2025.2.2`
+
+### Removed
+
+- Remove the `platformType` Gradle property
+
+## [2.3.1] - 2025-08-09
+
+### Added
+
+- Add `platformBundledModules` to `gradle.properties` along with `bundledModules()` helper to the Gradle build file
+
+### Changed
+
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.7.1`
+
+### Fixed
+
+- GitHub: Fixed the missing `$RELEASE_NOTE ` parent directory in the Release workflow
+
+## [2.3.0] - 2025-08-09
+
+### Added
+
+- Added `.DS_Store` directory to `.gitignore`
+
+### Changed
+
+- GitHub Actions: simplify changelog handling
+- Dependencies - upgrade `org.jetbrains.changelog` to `2.4.0`
+
+## [2.2.0] - 2025-08-05
+
+### Added
+
+- GitHub Actions: set Gradle cache to read-only for non-build jobs
+- GitHub Actions: add `jlumbroso/free-disk-space` action to build related steps to maximize build environment storage
+- Added `.kotlin` directory to `.gitignore` for Kotlin 2.0
+
+### Removed
+
+- Remove `pluginUntilBuild` obsolete property
+- GitHub Actions: Remove obsolete Plugin Verifier cache directory configuration
+
+### Changed
+
+- Upgrade Gradle Wrapper to `8.14.3`
+- Update `platformVersion` to `2024.3.6`
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.7.0`
+- Dependencies - upgrade `org.jetbrains.changelog` to `2.3.0`
+- Dependencies - upgrade `org.jetbrains.qodana` to `2025.1.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `2.2.0`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2025.1.1`
+- Dependencies (GitHub Actions) - upgrade `ad-m/github-push-action` to `v0.8.0`
+- Dependencies (GitHub Actions) - upgrade `jlumbroso/free-disk-space` to `v1.3.1`
+- Gradle - upgrade `org.gradle.toolchains.foojay-resolver-convention` to `1.0.0`
+- Change since build to `243` (2024.3)
+- Update codecov configuration based on new required upload token
+
+## [2.1.0] - 2025-03-28
+
+### Added
+
+- Example code – `ProjectActivity`
+- Added `opentest4j` test dependency, see: [Missing opentest4j dependency in Test Framework](https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#missing-opentest4j-dependency-in-test-framework)
+
+### Removed
+
+- Example code – `MyApplicationActivationListener`
+- Remove redundant IntelliJ Platform dependency helpers: `instrumentationTools()`, `pluginVerifier()`, `zipSigner()`
+- GitHub Actions: Remove `gradle/actions/wrapper-validation` because validation is performed by default in `gradle/actions/setup-gradle@v4`
+
+### Changed
+
+- Change JVM version to `21`
+- Upgrade Gradle Wrapper to `8.13`
+- Update `platformVersion` to `2024.2.5`
+- Change since/until build to `242-252.*` (2024.2-2025.2.*)
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.5.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `2.1.20`
+- Dependencies - upgrade `org.jetbrains.qodana` to `2024.3.4`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.9.1`
+- Dependencies (GitHub Actions) - upgrade `gradle/actions/wrapper-validation` to `v4`
+- Dependencies (GitHub Actions) - upgrade `codecov/codecov-action` to `v5`
+
+## [2.0.2] - 2024-10-07
+
+### Changed
+
+- Upgrade Gradle Wrapper to `8.10.2`
+- Update `platformVersion` to `2023.3.8`
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.1.0`
+- Dependencies - upgrade `org.jetbrains.qodana` to `2024.2.3`
+- Dependencies (GitHub Actions) - upgrade `gradle/actions/setup-gradle` to `v4`
+- Add back the `org.gradle.toolchains.foojay-resolver-convention` Gradle settings plugin
+
+### Fixed
+
+- Fixed _Run Plugin_ run configuration logs location
+
+### Removed
+
+- Removed _Run Qodana_ and _Run UI for UI Tests_ run configurations
+
+## [2.0.1] - 2024-08-09
+
+### Changed
+
+- Update `platformVersion` to `2023.3.7`
+- Change since/until build to `233-242.*` (2023.3-2024.2.*)
+- Cleanup registering the `runIdeForUiTests` task
+- Dependencies - upgrade `org.jetbrains.intellij.platform` to `2.0.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.9.25`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.8.3`
+- Dependencies - upgrade `org.jetbrains.qodana` to `2024.1.9`
+
+## [2.0.0] - 2024-07-30
+
+### Changed
+
+- Migrate to [IntelliJ Platform Gradle Plugin 2.0](https://blog.jetbrains.com/platform/2024/07/intellij-platform-gradle-plugin-2-0/).
+
+## [1.14.2] - 2024-07-12
+
+### Changed
+
+- Upgrade Gradle Wrapper to `8.9`
+
+### Removed
+
+- Remove default plugin icon (`pluginIcon.svg`)
+
+## [1.14.1] - 2024-06-19
+
+### Changed
+
+- Update `platformVersion` to `2023.2.7`
+- Upgrade Gradle Wrapper to `8.8`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.17.4`
+- Dependencies - downgrade `org.jetbrains.kotlin.jvm` to `1.9.24`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.8.1`
+
+## [1.14.0] - 2024-05-30
+
+### Changed
+
+- Update `platformVersion` to `2023.2.6`
+- Change since/until build to `232-242.*` (2023.2-2024.2.*)
+- Upgrade Gradle Wrapper to `8.7`
+- Update Kover configuration
+- Replace `org.jetbrains:annotations` library with an `com.example:exampleLibrary` placeholder
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.17.3`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `2.0.0`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.8.0`
+- Dependencies - upgrade `org.jetbrains.qodana` to `2024.1.5`
+- Dependencies (GitHub Actions) - replace `gradle/wrapper-validation-action@v2` with `gradle/actions/wrapper-validation@v3`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2024.1.5`
+- Dependencies (GitHub Actions) - upgrade `jtalk/url-health-check-action` to `v4`
+
+## [1.13.0] - 2024-03-11
+
+### Changed
+
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.9.23`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.7.6`
+- Dependencies - upgrade `org.jetbrains.qodana` to `2023.3.2`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `4`
+- Dependencies (GitHub Actions) - upgrade `codecov/codecov-action` to `4`
+- Dependencies (GitHub Actions) - upgrade `gradle/wrapper-validation-action` to `2`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `4`
+- Gradle - upgrade `org.gradle.toolchains.foojay-resolver-convention` to `0.8.0`
+- Gradle - cleanup the `jvmToolchain` setup
+- Run Configurations - `Run Qodana` runs the `qodanaScan` Gradle task
+
+### Fixed
+
+- Fixed calculation of the plugin publication channel
+- Run Configurations - `Run Tests` uses the `RunAsTest` IDE feature
+- Replace the whole `IntelliJ Platform Plugin Template` with the new project name when running the GitHub Actions Cleanup workflow
+
+### Removed
+
+- GitHub Actions: Remove the `Setup Java` step from the `releaseDraft` build step
+- Gradle - Removed Qodana Gradle Plugin configuration to rely on defaults
+
+## [1.12.0] - 2024-02-20
+
+### Added
+
+- GitHub Actions: Reduce the number of concurrent builds
+
+### Changed
+
+- Change since/until build to `223-241.*` (2022.3-2024.1.*)
+- Upgrade Gradle Wrapper to `8.6`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.17.2`
+- Dependencies (GitHub Actions) - upgrade `gradle/gradle-build-action@v2` to `gradle/actions/setup-gradle@v3`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2023.3.1`
+
+### Fixed
+
+- Adjusted obtaining the value for `publishPlugin.channels` property in `build.gradle.kts`
+- Fixed bash variable access in the Create Release Draft step.
+
+### Removed
+
+- Remove Gradle Kotlin DSL Lazy Property Assignment because it's default now
+
+## [1.11.3] - 2023-12-01
+
+### Changed
+
+- Upgrade Gradle Wrapper to `8.5`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.16.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.9.21`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.7.5`
+- Dependencies - upgrade `annotations` to `24.1.0`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2023.2.8`
+- Dependencies (GitHub Actions) - upgrade `actions/setup-java` to `4`
+
+## [1.11.2] - 2023-10-06
+
+### Changed
+
+- Upgrade Gradle Wrapper to `8.4`
+- Gradle - use JetBrains Runtime
+- Gradle - upgrade `org.gradle.toolchains.foojay-resolver-convention` to `0.7.0`
+- Change since/until build to `223-233.*` (2022.3-2023.3.*)
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.16.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.9.10`
+- Dependencies - upgrade `org.jetbrains.changelog` to `2.2.0`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `4`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2023.2.6`
+
+## [1.11.1] - 2023-08-17
+
+### Fixed
+
+- GitHub Actions: publish workflow fails due to the existing `release changelog` label
+
+### Changed
+
+- Upgrade Gradle Wrapper to `8.3`
+
+## [1.11.0] - 2023-08-07
+
+### Changed
+
+- GitHub Actions: move the `Maximize Build Space` step from the `Build` job to `Inspect code` and `Verify plugin` jobs
+- Update `platformVersion` to `2022.3.3`
+- Change since/until build to `223-232.*` (2022.3-2023.2.*)
+- `MyBundle`: remove `SpreadOperator` suppression
+- `MyBundle.properties`: remove unused `name` property
+
+## [1.10.0] - 2023-08-04
+
+### Added
+
+- [Foojay Toolchains Plugin](https://github.com/gradle/foojay-toolchains) integration
+- GitHub Actions: set `gradle-home-cache-cleanup: true` flag to the Gradle Build Action
+- GitHub Actions: use `jlumbroso/free-disk-space` to free disk space
+
+### Changed
+
+- GitHub Actions: rearrange the Build workflow
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.7.3`
+- Dependencies (GitHub Actions) - upgrade `gradle/wrapper-validation-action` to `v1.1.0`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2023.2.1`
+
+### Fixed
+
+- GitHub Actions: Fixed Kover report path when uploading the code coverage report
+
+## [1.9.0] - 2023-07-11
+
+### Added
+
+- GitHub Actions — use Java `17` explicitly
+
+### Changed
+
+- Upgrade Gradle Wrapper to `8.2.1`
+- Dependencies — upgrade `org.jetbrains.changelog` to `2.1.2`
+- GitHub Actions — rearrange the Build workflow
+
+### Fixed
+
+- Fixed copying files issue when running the `Template Cleanup` workflow
+
+## [1.8.0] - 2023-07-07
+
+### Changed
+
+- GitHub Actions: Build workflow refactoring
+- Upgrade Gradle Wrapper to `8.2`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.9.0`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.15.0`
+- Dependencies - upgrade `org.jetbrains.changelog` to `2.1.1`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.7.2`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2023.1.5`
+
+### Fixed
+
+- Dependabot workflow points to `next` branch in a newly created project
+
+### Removed
+
+- Removed workaround for Kotlin Compiler `OutOfMemoryError` as the issue is gone with Kotlin `1.9.0`
+
+## [1.7.0] - 2023-06-07
+
+### Added
+
+- GitHub Actions — enable caching
+- Specify `projectJDK: 17` in `qodana.yml`
+- Specify `linter` property in `qodana.yml`
+
+### Changed
+
+- Use Java `17` for JVM Toolchain
+- Change since/until build to `222-232.*` (2022.2–2023.2.*)
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.14.1`
+- Dependencies - upgrade `org.jetbrains.changelog` to `2.1.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.8.21`
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.7.1`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2023.1.0`
+- Upgrade Gradle Wrapper to `8.1.1`
+- GitHub Actions — switch to Java 17
+- Update Run Configuration entries
+- Adjust Kover configuration
+
+### Fixed
+
+- Example code — Fixed deprecated usage of `ContentFactory` in `MyToolWindowFactory`
+- Example code — Migrate from the deprecated `FrameStateListener.onFrameActivated()` to `ApplicationActivationListener.applicationActivated(IdeFrame)`
+
+### Removed
+
+- Remove `gradleJvm` property from the `.idea/gradle.xml` file
+- GitHub Actions — Drop unused `name` output from the `Build` workflow
+
+## [1.6.0] - 2023-04-13
+
+### Added
+
+- Temporary workaround for Kotlin Compiler `OutOfMemoryError` -> https://jb.gg/intellij-platform-kotlin-oom
+- Gradle version catalog integration
+- Gradle Kotlin DSL Lazy Property Assignment
+- Enable Gradle Build Cache
+
+### Changed
+
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.13.3`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.8.20`
+- Upgrade Gradle Wrapper to `8.1`
+- Remove `UnusedProperty` suppression in `gradle.properties` file
+- Rename `org.gradle.unsafe.configuration-cache` to `org.gradle.configuration-cache` in `gradle.properties`
+
+## [1.5.0] - 2023-03-10
+
+### Added
+
+- Migrate to Gradle Provider API improving configuration cache compatibility
+- Example code - `FrameStateListener` application listener
+- Example code - `MyToolWindowFactory` tool window basic implementation
+
+### Changed
+
+- Update `platformVersion` to `2022.1.4`
+- Change since/until build to `221-231.*` (2022.1-2023.1.*)
+- Example code - registered project service changed into a lightweight one
+- GitHub Actions — pass changelog release notes as a multi-line content
+- GitHub Actions — provide `plugin.verifier.home.dir` variable as a system property instead of project property
+- Template Cleanup: remove default `pluginIcon.svg` icon
+- Upgrade Gradle Wrapper to `8.0.2`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.8.10`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.13.2`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2022.3.4`
+- Dependencies (GitHub Actions) - upgrade `gradle/wrapper-validation-action` to `v1.0.6`
+
+### Fixed
+
+- Resolving the content for the `patchPluginXML.changeNotes` property
+
+### Removed
+
+- Example code — application service
+- Example code — deprecated `ProjectManagerListener` application listener
+
+## [1.4.0] - 2023-01-13
+
+### Changed
+
+- GitHub Actions — use `GITHUB_OUTPUT` environment file instead of `::set-output`.
+- Upgrade Gradle Wrapper to `7.6`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.8.0`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.12.0`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2022.3.0`
+
+### Fixed
+
+- Fallback to the unreleased change notes when the plugin in current was not released yet
+
+## [1.3.0] - 2022-11-17
+
+### Added
+
+- [Kover](https://github.com/Kotlin/kotlinx-kover) integration
+- Enable [Gradle Configuration Cache](https://docs.gradle.org/current/userguide/configuration_cache.html) in `gradle.properties`
+- GitHub Actions — mark the pull request created with _Publish Plugin_ workflow with `release changelog` label
+- GitHub Actions — send code coverage reports to [CodeCov](https://codecov.io)
+- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.6.1`
+
+### Changed
+
+- Update `changelog` extension configuration in `build.gradle.kts` file
+- Update `pluginUntilBuild` to include `223.*` (2022.3.*)
+- Use `kotlin.jvmToolchain(11)` shorthand in Gradle configuration
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.10.0`
+- Dependencies - upgrade `org.jetbrains.changelog` to `2.0.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.7.21`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2022.2.3`
+- Dependencies (GitHub Actions) - upgrade `gradle/wrapper-validation-action` to `v1.0.5`
+- Dependencies (GitHub Actions) - upgrade `jtalk/url-health-check-action` to `v3`
+- Use `file` instead of `projectDir.resolve` in Gradle configuration file
+
+### Fixed
+
+- Update broken link in `gradle.properties`
+- GitHub Actions — use `$BRANCH` for creating changelog pull request
+
+## [1.2.0] - 2022-08-07
+
+### Added
+
+- Use JVM toolchain for configuring source/target compilation compatibility
+- Make sure GitHub Actions release jobs have write permissions
+- Example implementation: Add `TODO()` with a hint to remove stale sample code
+- Exclude `.qodana` directory from Qodana analysis
+- Maximize disk space on GitHub Actions
+
+### Changed
+
+- Upgrade Gradle Wrapper to `7.5.1`
+- Update `platformVersion` to `2021.3.3`
+- Change since/until build to `213-222.*` (2021.3-2022.2)
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.8.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.7.10`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `3`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `3`
+- Dependencies (GitHub Actions) - upgrade `actions/setup-java` to `3`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `3`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `v2022.2.1`
+
+### Fixed
+
+- Pass Plugin Signing secrets as environment variables in the Release workflow
+
+### Removed
+
+- Removed Gradle caching from GitHub Actions
+
+## [1.1.2] - 2022-02-11
+
+### Changed
+
+- Update `platformVersion` to `2021.1.3` for compatibility with Apple M1
+- Change since/until build to `211-213.*` (2021.1-2021.3)
+- Upgrade Gradle Wrapper to `7.4`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.4.0`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `4.2.5`
+
+## [1.1.1] - 2022-01-24
+
+### Changed
+
+- GitHub Actions — fixed duplicated `.zip` extension in artifact file's name of the build flow
+- Upgrade Gradle Wrapper to `7.3.3`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.3.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.6.10`
+- Dependencies (GitHub Actions) - upgrade `JetBrains/qodana-action` to `4.2.3`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `2.1.7`
+
+## [1.1.0] - 2021-11-16
+
+### Added
+
+- GitHub Actions: Collect Qodana/Tests/Plugin Verifier results as artifacts
+
+### Changed
+
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.3.0`
+- Dependencies - upgrade `org.jetbrains.changelog` to `1.3.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.6.0`
+- Dependencies (GitHub Actions) - upgrade `jtalk/url-health-check-action` to `2`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `2.3.5`
+- GitHub Actions general performance refactoring
+- GitHub Actions — prepare plugin archive content to be archived at once
+- GitHub Actions — patch changelog only if change notes are provided
+- Update `pluginUntilBuild` to include `213.*` (2021.3.*)
+- Upgrade Gradle Wrapper to `7.3`
+
+### Fixed
+
+- Fixed passing change notes from `CHANGELOG.md` to the Release Draft
+- Fixed passing updated change notes from the Release Draft to `patchChangelog` Gradle task
+- Fixed `QODANA_SHOW_REPORT` environment variable resolving for Gradle `6.x`
+
+### Removed
+
+- Removed the `pluginVerifierIdeVersions` configuration to use a default IDEs list provided by the `listProductsReleases` task for `runPluginVerifier`
+- Removed `platformDownloadSources` from Gradle configuration to use default value
+- Removed `updateSinceUntilBuild.set(true)` from Gradle configuration to use default value
+
+## [1.0.0] - 2021-09-07
+
+### Added
+
+- Plugin Signing
+- Qodana integration
+- Functional tests
+- Compatibility with Java 11
+- `Run Qodana` and `Run IDE for UI Tests` run configurations
+- Use Gradle `wrapper` task to handle Gradle updates
+- JVM compatibility version extracted to `gradle.properties` file
+- Suppress `UnusedProperty` inspection for the `kotlin.stdlib.default.dependency` in `gradle.properties`
+
+### Changed
+
+- GitHub Actions: Switch to Java 11
+- GitHub Actions: Update Build and Release flows
+- GitHub Actions: Use Gradle cache provided with `actions/setup-java`
+- Update `pluginVerifierIdeVersions` to `2020.3.4, 2021.1.3, 2021.2.1`
+- Change since/until build to `203-212.*`
+- Upgrade Gradle Wrapper to `7.2`
+- Gradle – Changelog plugin configuration update
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.5.30`
+- Dependencies - upgrade `org.jetbrains.changelog` to `1.3.0`
+- Dependencies - upgrade `org.jetbrains.intellij` to `1.1.6`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `v2.2.4`
+
+### Fixed
+
+- Use `DynamicBundle` instead of `AbstractBundle` in `MyBundle.kt`
+
+### Removed
+
+- Removed `detekt`/`ktlint` integration
+
+## [0.10.1] - 2021-05-31
+
+### Added
+
+- Introduced `next` branch in the root repository to make `main` always a stable one
+
+### Changed
+
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `v2.1.6`
+- Trigger GitHub Actions `Build` workflows only on pushes to `main` branch or pull request to avoid duplicated checks
+
+## [0.10.0] - 2021-05-27
+
+### Changed
+
+- Remove reference to the `jcenter()` from Gradle configuration file
+- Update `pluginVerifierIdeVersions` to `2020.2.4, 2020.3.4, 2021.1.2`
+- Update `pluginUntilBuild` to include `211.*` (2021.1.*)
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.5.10`
+- Dependencies - upgrade `detekt-formatting from` to `1.17.1`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.17.1`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `v2.1.5`
+- Dependencies (GitHub Actions) - upgrade `actions/checkout` to `v2.3.4`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-release-asset` to `v1.0.2`
+- Dependencies (GitHub Actions) - upgrade `actions/create-release` to `v1.1.4`
+- Upgrade Gradle Wrapper to `7.0.2`
+
+## [0.9.0] - 2021-03-29
+
+### Added
+
+- `properties` shorthand function for accessing `gradle.properties` in a cleaner way
+- Dependabot check for GitHub Actions used in [workflow files](.github/workflows)
+
+### Changed
+
+- Dependencies - upgrade `detekt-formatting from` to `1.16.0`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.16.0`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.32`
+- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `v2.2.2`
+- Dependencies (GitHub Actions) - upgrade `actions/cache` to `v2.1.4`
+
+### Fixed
+
+- Fix `README.md` file resolution in the `build.gradle.kts`
+
+## [0.8.3] - 2021-02-23
+
+### Changed
+
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.7.2`
+- Dependencies - upgrade `org.jlleitschuh.gradle.ktlint` to `10.0.0`
+- Update `platformVersion` to `2020.2.4` for compatibility with macOS Big Sur
+- Upgrade Gradle Wrapper to `6.8.3`
+
+## [0.8.2] - 2021-02-09
+
+### Changed
+
+- Use `-bin` distribution of the Gradle Wrapper
+- Upgrade Gradle Wrapper to `6.8.2`
+- Update `pluginVerifierIdeVersions` in `gradle.properties` files
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.30`
+- Dependencies - upgrade `org.jetbrains.changelog` to `1.1.1`
+- Configure the `changelog` Gradle plugin
+
+## [0.8.1] - 2021-01-12
+
+### Added
+
+- README: Dependencies management section
+
+### Changed
+
+- Upgrade Gradle Wrapper to `6.8`
+- Dependencies - upgrade `org.jetbrains.changelog` to `1.0.0`
+
+### Fixed
+
+- Template Cleanup: Escape GitHub username to avoid incorrect characters in class package name
+- Template Cleanup: Run `ktlintFormat` task to fix imports order
+- GitHub Actions: Use the correct property in the "Upload artifact" step
+
+## [0.8.0] - 2020-12-21
+
+### Added
+
+- Dependabot integration
+- Show `idea.log` logs of the run IDE in the Run console
+- README: FAQ section
+
+### Changed
+
+- `build.gradle.kts`: simpler syntax for configuring `KotlinCompile`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.21`
+- Dependencies - upgrade `detekt-formatting` to `1.15.0`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.15.0`
+- README: Clarifying the Java usage in the project
+- `pluginVerifierIdeVersions` - upgrade to `2020.1.4, 2020.2.3, 2020.3.1`
+
+### Fixed
+
+- Return `Supplier<@Nls String>` instead of `String` in `MyBundle.messagePointer`
+
+## [0.7.1] - 2020-12-02
+
+### Changed
+
+- Upgrade Gradle Wrapper to `6.7.1`
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.5`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.20`
+- Update the base platform version to 2020.1
+- Change since/until build to `201-203.*`
+
+## [0.7.0] - 2020-11-16
+
+### Added
+
+- Predefined Run/Debug Configurations
+- Project icon for development purposes
+
+### Changed
+
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.3`
+
+## [0.6.1] - 2020-11-05
+
+### Added
+
+- GitHub Actions — use hash based on `pluginVerifierIdeVersions` in `Setup Plugin Verifier IDEs Cache` step
+
+### Changed
+
+- Use [Kotlin extension function](https://plugins.jetbrains.com/docs/intellij/plugin-services.html#retrieving-a-service) to retrieve the `MyProjectService` in the `MyProjectManagerListener`
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.2`
+- Update `pluginVerifierIdeVersions` in the `gradle.properties` files
+
+## [0.6.0] - 2020-10-29
+
+### Added
+
+- Integration with [IntelliJ Plugin Verifier](https://github.com/JetBrains/intellij-plugin-verifier) through the [Gradle IntelliJ Plugin](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#runpluginverifier-task) `runPluginVerifier` task
+- Cache downloaded IDEs used by Plugin Verifier for the verification
+
+### Changed
+
+- Switch Gradle Wrapper to `-all` to improve the IntelliSense
+- Update detekt config to be in line with IJ settings
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.14.2`
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.6.1`
+- GitHub Actions — `gradleValidation` update to `gradle/wrapper-validation-action@v1.0.3`
+- GitHub Actions — `releaseDraft` update to `actions/download-artifact@v2`
+
+### Removed
+
+- Remove Third-party IntelliJ Plugin Verifier GitHub Action
+
+## [0.5.1] - 2020-10-15
+
+### Added
+
+- Missing properties in the `gradle.properties` template file
+
+### Changed
+
+- Upgrade Gradle Wrapper to `6.7`
+- Dependencies - upgrade `org.jetbrains.changelog` to `0.6.2`
+
+## [0.5.0] - 2020-10-12
+
+### Added
+
+- Introduced `platformPlugins` property in `gradle.properties` for configuring dependencies to bundled/external plugins
+
+### Changed
+
+- Disable "Release Draft" job for pull requests in the "Build" GitHub Actions Workflow
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.5.0`
+- Dependencies - upgrade `org.jetbrains.changelog` to `0.6.1`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.14.1`
+- Dependencies - upgrade `org.jlleitschuh.gradle.ktlint` to `9.4.1`
+- Remove LICENSE file during the Template Cleanup workflow
+
+## [0.4.0] - 2020-10-02
+
+### Added
+
+- Fix default to opt-out of bundling Kotlin standard library in plugin distribution
+
+### Changed
+
+- GitHub Actions: allow releasing plugin even for the base project
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.10`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.13.1`
+
+### Fixed
+
+- `pluginName` variable name collision with `intellij` closure getter in Gradle configuration #29
+
+## [0.3.2] - 2020-08-09
+
+### Changed
+
+- Simplify and optimize GitHub Actions
+- Gradle Wrapper upgrade to `6.6.1`
+- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.4.0`
+- Dependencies - upgrade `org.jetbrains.intellij` to `0.4.22`
+- Dependencies - upgrade `org.jetbrains.changelog` to `0.5.0`
+- Dependencies - upgrade `io.gitlab.arturbosch.detekt` to `1.12.0`
+- Dependencies - upgrade `org.jlleitschuh.gradle.ktlint` to `9.4.0`
+- Rename `master` branch to `main`
+
+### Fixed
+
+- GitHub Actions — cache Gradle dependencies and wrapper separately
+
+## [0.3.1] - 2020-07-31
+
+### Added
+
+- Better handling of the Gradle plugin description extraction from the README file
+- GitHub Actions — cache Gradle Wrapper
+
+### Changed
+
+- Gradle - remove kotlin("stdlib-jdk8") dependency to decrease the plugin artifact size
+- Dependencies - bump ktlint to `9.3.0`
+- GitHub Actions — make *Update Changelog* job dependent on the *Publish Plugin*
+- GitHub Actions — run plugin verifier against `2019.3` `2020.1` `2020.2`
+
+### Fixed
+
+- Resolve ktlint reports
+- GitHub Actions — Plugin Verifier broken for artifacts with spaces in name
+
+## [0.3.0] - 2020-07-07
+
+### Added
+
+- Set the publishing channel depending on the plugin version, i.e. `1.0.0-beta` -> `beta` channel
+
+### Changed
+
+- Update `org.jetbrains.changelog` dependency to `v0.3.3`
+- Update Gradle Wrapper to `v6.5.1`
+- Run GitHub Actions Release workflow on `prereleased` event
+- GitHub Actions — Release, separate changelog-related job from the release
+
+### Fixed
+
+- Remove vendor website from `plugin.xml`
+- Update Template Cleanup workflow test to avoid running it on forks
+
+## [0.2.0] - 2020-07-02
+
+### Added
+
+- JetBrains Plugin badges and TODO list for the end users
+- `ktlint` integration
+
+### Changed
+
+- `pluginUntilBuild` set to the correct format: `201.*`
+- Bump detekt dependency to `1.10.0`
+
+### Fixed
+
+- GitHub Actions — Template Cleanup, fixed adding files to git
+- Update Template plugin name on cleanup
+- Set `buildUponDefaultConfig = true` in detekt configuration
+
+## [0.1.0] - 2020-06-26
+
+### Added
+
+- `settings.gradle.kts` for the [performance purposes](https://docs.gradle.org/current/userguide/organizing_gradle_projects.html#always_define_a_settings_file)
+- `#REMOVE-ON-CLEANUP#` token to mark content to be removed with **Template Cleanup** workflow
+
+### Changed
+
+- README proofreading
+- GitHub Actions — Update IDE versions for the Plugin Verifier
+- Update platformVersion to `2020.1.2`
+
+## [0.0.2] - 2020-06-22
+
+### Added
+
+- [Gradle Changelog Plugin](https://github.com/JetBrains/gradle-changelog-plugin) integration
+
+### Changed
+
+- Bump Detekt version
+- Change pluginSinceBuild to 193
+
+## [0.0.1]
+
+### Added
+
+- Initial project scaffold
+- GitHub Actions to automate testing and deployment
+- Kotlin support
+
+[Unreleased]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.4.1...HEAD
+[2.4.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.4.0...2.4.1
+[2.4.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.3.1...2.4.0
+[2.3.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.3.0...2.3.1
+[2.3.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.2.0...2.3.0
+[2.2.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.1.0...2.2.0
+[2.1.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.0.2...2.1.0
+[2.0.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.0.1...2.0.2
+[2.0.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/2.0.0...2.0.1
+[2.0.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.14.2...2.0.0
+[1.14.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.14.1...1.14.2
+[1.14.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.14.0...1.14.1
+[1.14.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.13.0...1.14.0
+[1.13.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.12.0...1.13.0
+[1.12.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.11.3...1.12.0
+[1.11.3]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.11.2...1.11.3
+[1.11.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.11.1...1.11.2
+[1.11.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.11.0...1.11.1
+[1.11.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.10.0...1.11.0
+[1.10.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.9.0...1.10.0
+[1.9.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.8.0...1.9.0
+[1.8.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.7.0...1.8.0
+[1.7.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.6.0...1.7.0
+[1.6.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.5.0...1.6.0
+[1.5.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.4.0...1.5.0
+[1.4.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.3.0...1.4.0
+[1.3.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.2.0...1.3.0
+[1.2.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.1.2...1.2.0
+[1.1.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.1.1...1.1.2
+[1.1.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.1.0...1.1.1
+[1.1.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/1.0.0...1.1.0
+[1.0.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.10.1...1.0.0
+[0.10.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.10.0...0.10.1
+[0.10.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.9.0...0.10.0
+[0.9.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.8.3...0.9.0
+[0.8.3]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.8.2...0.8.3
+[0.8.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.8.1...0.8.2
+[0.8.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.8.0...0.8.1
+[0.8.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.7.1...0.8.0
+[0.7.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.7.0...0.7.1
+[0.7.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.6.1...0.7.0
+[0.6.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.6.0...0.6.1
+[0.6.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.5.1...0.6.0
+[0.5.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.5.0...0.5.1
+[0.5.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.4.0...0.5.0
+[0.4.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.3.2...0.4.0
+[0.3.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.3.1...0.3.2
+[0.3.1]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.3.0...0.3.1
+[0.3.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.2.0...0.3.0
+[0.2.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.1.0...0.2.0
+[0.1.0]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.0.2...0.1.0
+[0.0.2]: https://github.com/JetBrains/intellij-platform-plugin-template/compare/0.0.1...0.0.2
+[0.0.1]: https://github.com/JetBrains/intellij-platform-plugin-template/commits/0.0.1
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..85ed20d
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,4 @@
+## Code of Conduct
+
+This project and the corresponding community is governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it.
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..77057df
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2000-2021 JetBrains s.r.o.
+
+ 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
+
+ http://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.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..50bfd1b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,538 @@
+# IntelliJ Platform Plugin Template
+
+[][jb:github]
+[](https://x.com/JBPlatform)
+[][gh:build]
+
+![IntelliJ Platform Plugin Template][file:intellij-platform-plugin-template-dark]
+![IntelliJ Platform Plugin Template][file:intellij-platform-plugin-template-light]
+
+> [!NOTE]
+> Click the Use this template button and clone it in IntelliJ IDEA.
+
+**IntelliJ Platform Plugin Template** is a repository that provides a pure template to make it easier to create a new plugin project (check the [Creating a repository from a template][gh:template] article).
+
+The main goal of this template is to speed up the setup phase of plugin development for both new and experienced developers by preconfiguring the project scaffold and CI, linking to the proper documentation pages, and keeping everything organized.
+
+[gh:template]: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template
+
+If you're still not quite sure what this is all about, read our introduction: [What is the IntelliJ Platform?][docs:intro]
+
+> [!NOTE]
+> Click the Watch button on the top to be notified about releases containing new features and fixes.
+
+### Table of contents
+
+In this README, we will highlight the following elements of template-project creation:
+
+- [Getting started](#getting-started)
+- [Gradle configuration](#gradle-configuration)
+- [Plugin template structure](#plugin-template-structure)
+- [Plugin configuration file](#plugin-configuration-file)
+- [Sample code](#sample-code):
+ - startup activity – project-open sample
+ - services – project-level service
+ - tool window – sample UI entry point
+- [Testing](#testing)
+ - [Functional tests](#functional-tests)
+ - [UI tests](#ui-tests)
+- [Predefined Run/Debug configurations](#predefined-rundebug-configurations)
+- [Continuous integration](#continuous-integration) based on GitHub Actions
+ - [Dependencies management](#dependencies-management) with Dependabot
+ - [Changelog maintenance](#changelog-maintenance) with the Gradle Changelog Plugin
+ - [Release flow](#release-flow) using GitHub Releases
+ - [Plugin signing](#plugin-signing) with Marketplace signing
+ - [Publishing the plugin](#publishing-the-plugin) with the IntelliJ Platform Gradle Plugin
+- [FAQ](#faq)
+- [Useful links](#useful-links)
+
+
+## Getting started
+
+Before we dive into plugin development and everything related to it, it's worth mentioning the benefits of using GitHub Templates.
+By creating a new project using the current template, you start with no history or reference to this repository.
+This allows you to create a new repository easily without copying and pasting previous content, cloning repositories, or clearing the history manually.
+
+All you have to do is click the Use this template button (you must be logged in with your GitHub account).
+
+![Use this template][file:use-this-template.png]
+
+After using the template to create your blank project, the [Template Cleanup][file:template_cleanup.yml] workflow will be triggered to override or remove any template-specific configurations, such as the plugin name, current changelog, etc.
+Once this is complete, open the newly created project's _Settings | Actions | General_ page and enable option _Allow GitHub Actions to create and approve pull requests_.
+
+Now the project is ready to be cloned to your local environment and opened with [IntelliJ IDEA][jb:download-ij].
+
+The most convenient way for getting your new project from GitHub is the Get from VCS action available on the Welcome Screen, where you can filter your GitHub repository by its name.
+
+![Get from Version Control][file:get-from-version-control]
+
+The next step, after opening your project in IntelliJ IDEA, is to set the proper SDK to Java in version `21` within the [Project Structure settings][docs:project-structure-settings].
+
+![Project Structure — SDK][file:project-structure-sdk.png]
+
+For the last step, review the project metadata in [`gradle.properties`][file:gradle.properties] and [`plugin.xml`][file:plugin.xml], then *optionally* move sources from the generated package to the one that works best for you.
+Then you can get to work implementing your ideas.
+
+> [!NOTE]
+> To use Java in your plugin, create the `/src/main/java` directory.
+
+
+## Gradle configuration
+
+The recommended method for plugin development involves using the [Gradle][gradle] setup with the [intellij-platform-gradle-plugin][gh:intellij-platform-gradle-plugin] installed.
+The IntelliJ Platform Gradle Plugin makes it possible to run the IDE with your plugin and publish your plugin to JetBrains Marketplace.
+
+> [!NOTE]
+> Make sure to always upgrade to the latest version of IntelliJ Platform Gradle Plugin.
+
+A project built using the IntelliJ Platform Plugin Template includes a Gradle configuration already set up.
+Feel free to read through the [Using Gradle][docs:using-gradle] articles to understand your build better and learn how to customize it.
+
+The most significant parts of the current configuration are:
+- Integration with the [intellij-platform-gradle-plugin][gh:intellij-platform-gradle-plugin] for smoother development.
+- Repository configuration moved to [`settings.gradle.kts`][file:settings.gradle.kts] using the IntelliJ Platform repositories extension.
+- Configuration written with [Gradle Kotlin DSL][gradle:kotlin-dsl].
+- Support for Kotlin and Java implementation.
+- Plugin and dependency versions are declared directly in the Gradle build files.
+- Integration with the [gradle-changelog-plugin][gh:gradle-changelog-plugin], which automatically patches the change notes based on the `CHANGELOG.md` file.
+- [Plugin publishing][docs:publishing] through the `publishPlugin` task and GitHub Actions workflows.
+
+For more details regarding Kotlin integration, please see [Kotlin for Plugin Developers][docs:kotlin] in the IntelliJ Platform Plugin SDK documentation.
+
+### Gradle properties
+
+The project-specific configuration file [`gradle.properties`][file:gradle.properties] starts with values expected to vary between repositories created from this template:
+
+| Property name | Description |
+|-----------------------|------------------------------------------------------------------------------------------------------|
+| `group` | Project group and default base package for the sample sources. |
+| `version` | Current plugin version in [SemVer][semver] format. |
+| `pluginRepositoryUrl` | Repository URL used for generating URLs by the [Gradle Changelog Plugin][gh:gradle-changelog-plugin] |
+
+The remaining plugin metadata lives closer to where it is used:
+- [`settings.gradle.kts`][file:settings.gradle.kts] declares Gradle plugin versions and repository management.
+- [`build.gradle.kts`][file:build.gradle.kts] declares the target IntelliJ Platform version and project dependencies.
+- [`plugin.xml`][file:plugin.xml] contains the plugin `id`, `name`, `vendor`, `description`, and extension registrations.
+
+It also configures Gradle build behavior flags, such as:
+
+| Property name | Value | Description |
+|--------------------------------------------------|---------|------------------------------------------------------------------------------------------------|
+| `kotlin.stdlib.default.dependency` | `false` | Opt-out flag for bundling [Kotlin standard library][docs:kotlin-stdlib] |
+| `org.gradle.configuration-cache` | `true` | Enable [Gradle Configuration Cache][gradle:configuration-cache] |
+| `org.gradle.caching` | `true` | Enable [Gradle Build Cache][gradle:build-cache] |
+
+### Environment variables
+
+Some values used during signing and publishing should not be stored in project files.
+
+Provide them through local *Run/Debug Configurations* or on CI, for example in GitHub under `Settings > Secrets and variables > Actions`.
+
+The current template uses the following variables for the [plugin signing](#plugin-signing) and [publishing](#publishing-the-plugin) flow:
+
+| Environment variable name | Description |
+|---------------------------|--------------------------------------------------------------------------------------------------------------|
+| `PRIVATE_KEY` | Certificate private key, should contain: `-----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY-----` |
+| `PRIVATE_KEY_PASSWORD` | Password used for encrypting the certificate file. |
+| `CERTIFICATE_CHAIN` | Certificate chain, should contain: `-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----` |
+| `PUBLISH_TOKEN` | Publishing token generated in your JetBrains Marketplace profile dashboard. |
+
+For more details on how to generate proper values, check the relevant sections mentioned above.
+
+To configure GitHub secret environment variables, go to the `⚙️ Settings > Secrets and variables > Actions` section of your project repository:
+
+![Settings > Secrets][file:settings-secrets.png]
+
+## Plugin template structure
+
+A generated IntelliJ Platform Plugin Template repository contains the following content structure:
+
+```
+.
+├── .github/ GitHub Actions workflows and Dependabot configuration files
+├── .run/ Predefined Run/Debug Configurations
+├── gradle
+│ └── wrapper/ Gradle Wrapper
+├── src Plugin sources
+│ ├── main
+│ │ ├── kotlin/ Kotlin production sources
+│ │ └── resources/ Resources - plugin.xml, icons, messages
+│ └── test
+│ ├── kotlin/ Kotlin test sources
+│ └── testData/ Test data used by tests
+├── .gitignore Git ignoring rules
+├── build.gradle.kts Gradle configuration
+├── CHANGELOG.md Full change history
+├── gradle.properties Gradle configuration properties
+├── gradlew *nix Gradle Wrapper script
+├── gradlew.bat Windows Gradle Wrapper script
+├── LICENSE License, MIT by default
+├── README.md README
+└── settings.gradle.kts Gradle project settings and repositories
+```
+
+In addition to the configuration files, the most crucial part is the `src` directory, which contains our implementation and the manifest for our plugin – [plugin.xml][file:plugin.xml].
+
+> [!NOTE]
+> To use Java in your plugin, create the `/src/main/java` directory.
+
+
+## Plugin configuration file
+
+The plugin configuration file is a [plugin.xml][file:plugin.xml] file located in the `src/main/resources/META-INF` directory.
+It provides general information about the plugin, its dependencies, and its extensions.
+Maintain the plugin description directly in this file, using HTML wrapped in CDATA when needed.
+
+> [!NOTE]
+> When using this template for a real plugin, replace the placeholder description with content that describes the final plugin.
+
+```xml
+
+ org.jetbrains.plugins.template
+ IntelliJ Platform Plugin Template
+ JetBrains
+ Plugin description in HTML.
\n" +
+ " \n" +
+ "");
+ writeFile(new File(ideaDir, "vcs.xml"),
+ "\n" +
+ "\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "");
+ writeFile(new File(projectDir, "remote.iml"),
+ "\n" +
+ "\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "");
+ }
+
+ private static void writeFile(File file, String content) throws IOException {
+ try (Writer writer = new FileWriter(file)) {
+ writer.write(content);
+ }
+ }
+
+ private static String sanitize(String input) {
+ return input.replaceAll("[^a-zA-Z0-9.-]", "_");
+ }
+
+
+ public static void syncProject(SshServer server, String localPath, ProgressIndicator indicator) throws Exception {
+ JSch jsch = new JSch();
+ Session session = jsch.getSession(server.user, server.host, server.port);
+ session.setPassword(SshServerManager.getInstance().getPassword(server.id));
+ java.util.Properties config = new java.util.Properties();
+ config.put("StrictHostKeyChecking", "no");
+ session.setConfig(config);
+ session.connect(5000);
+
+ ChannelSftp sftp = (ChannelSftp) session.openChannel("sftp");
+ sftp.connect(3000);
+
+ try {
+ File localDir = new File(localPath);
+ if (!localDir.exists()) localDir.mkdirs();
+ syncDir(sftp, server.remoteProjectPath, localDir, indicator);
+ } finally {
+ sftp.disconnect();
+ session.disconnect();
+ }
+ }
+
+ private static void syncDir(ChannelSftp sftp, String remoteDir, File localDir, ProgressIndicator indicator) {
+ try {
+ @SuppressWarnings("unchecked")
+ Vector entries = sftp.ls(remoteDir);
+ for (ChannelSftp.LsEntry entry : entries) {
+ if (indicator.isCanceled()) break;
+
+ String filename = entry.getFilename();
+ if (filename.equals(".") || filename.equals("..")) continue;
+
+ String remotePath = remoteDir + "/" + filename;
+ try {
+ if (entry.getAttrs().isDir()) {
+ File subDir = new File(localDir, filename);
+ if (!subDir.exists()) subDir.mkdirs();
+ syncDir(sftp, remotePath, subDir, indicator);
+ } else {
+ File localFile = new File(localDir, filename);
+ boolean needDownload = !localFile.exists();
+ if (!needDownload && localFile.isFile()) {
+ long remoteSize = entry.getAttrs().getSize();
+ long remoteMtime = entry.getAttrs().getMTime();
+ if (localFile.length() != remoteSize || localFile.lastModified() / 1000L != remoteMtime) {
+ needDownload = true;
+ }
+ }
+ if (needDownload) {
+ indicator.setText("Syncing: " + filename);
+ sftp.get(remotePath, localFile.getAbsolutePath());
+ if (entry.getAttrs().getMTime() > 0) {
+ localFile.setLastModified(entry.getAttrs().getMTime() * 1000L);
+ }
+ }
+ }
+ } catch (Exception e) {
+ // Логируем и пропускаем файл, который не удалось скачать/записать
+ System.err.println("Skip entry: " + remotePath + " - " + e.getMessage());
+ }
+ }
+ } catch (SftpException e) {
+ System.err.println("Cannot list directory: " + remoteDir + " - " + e.getMessage());
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/ProjectMappingService.java b/src/main/java/com/example/plugin/ProjectMappingService.java
new file mode 100644
index 0000000..b37f23d
--- /dev/null
+++ b/src/main/java/com/example/plugin/ProjectMappingService.java
@@ -0,0 +1,47 @@
+package com.example.plugin;
+
+import com.intellij.openapi.components.PersistentStateComponent;
+import com.intellij.openapi.components.State;
+import com.intellij.openapi.components.Storage;
+import com.intellij.util.xmlb.XmlSerializerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@State(
+ name = "ProjectMappingService",
+ storages = { @Storage("ssh-project-mapping.xml") }
+)
+public class ProjectMappingService implements PersistentStateComponent {
+ public static class State {
+ public Map hostPathToLocalPath = new HashMap<>();
+ }
+
+ private State myState = new State();
+
+ @Nullable
+ @Override
+ public State getState() {
+ return myState;
+ }
+
+ @Override
+ public void loadState(@NotNull State state) {
+ XmlSerializerUtil.copyBean(state, myState);
+ }
+
+ public void setLocalPathFor(String host, String remotePath, String localPath) {
+ myState.hostPathToLocalPath.put(host + ":" + remotePath, localPath);
+ }
+
+ public String getLocalPath(String host, String remotePath) {
+ return myState.hostPathToLocalPath.get(host + ":" + remotePath);
+ }
+
+ public static ProjectMappingService getInstance() {
+ return com.intellij.openapi.application.ApplicationManager.getApplication()
+ .getService(ProjectMappingService.class);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/ProjectServerMapping.java b/src/main/java/com/example/plugin/ProjectServerMapping.java
new file mode 100644
index 0000000..38c9350
--- /dev/null
+++ b/src/main/java/com/example/plugin/ProjectServerMapping.java
@@ -0,0 +1,53 @@
+package com.example.plugin;
+
+import com.intellij.openapi.components.PersistentStateComponent;
+import com.intellij.openapi.components.State;
+import com.intellij.openapi.components.Storage;
+import com.intellij.util.xmlb.XmlSerializerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@State(
+ name = "ProjectServerMapping",
+ storages = { @Storage("ssh-project-server-mapping.xml") }
+)
+public class ProjectServerMapping implements PersistentStateComponent {
+
+ public static class State {
+ // projectBasePath -> serverId
+ public Map mappings = new HashMap<>();
+ }
+
+ private State myState = new State();
+
+ @Nullable
+ @Override
+ public State getState() {
+ return myState;
+ }
+
+ @Override
+ public void loadState(@NotNull State state) {
+ XmlSerializerUtil.copyBean(state, myState);
+ }
+
+ public String getServerIdForProject(String projectBasePath) {
+ return myState.mappings.get(projectBasePath);
+ }
+
+ public void setServerIdForProject(String projectBasePath, String serverId) {
+ myState.mappings.put(projectBasePath, serverId);
+ }
+
+ public void removeProject(String projectBasePath) {
+ myState.mappings.remove(projectBasePath);
+ }
+
+ public static ProjectServerMapping getInstance() {
+ return com.intellij.openapi.application.ApplicationManager.getApplication()
+ .getService(ProjectServerMapping.class);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/RefreshFromServerAction.java b/src/main/java/com/example/plugin/RefreshFromServerAction.java
new file mode 100644
index 0000000..c46e23d
--- /dev/null
+++ b/src/main/java/com/example/plugin/RefreshFromServerAction.java
@@ -0,0 +1,69 @@
+package com.example.plugin;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+
+import java.nio.file.Paths;
+import java.util.Optional;
+
+public class RefreshFromServerAction extends AnAction {
+ @Override
+ public void actionPerformed(@NotNull AnActionEvent e) {
+ Project project = e.getProject();
+ if (project == null) return;
+
+ String projectPath = project.getBasePath();
+ if (projectPath == null) return;
+
+ String serverId = ProjectServerMapping.getInstance().getServerIdForProject(projectPath);
+ if (serverId == null) {
+ Messages.showErrorDialog("No server associated with this project.", "Error");
+ return;
+ }
+
+ Optional maybeServer = SshServerManager.getInstance().findServer(serverId);
+ if (maybeServer.isEmpty()) {
+ Messages.showErrorDialog("Server not found.", "Error");
+ return;
+ }
+ SshServer server = maybeServer.get();
+
+ ProgressManager.getInstance().run(new Task.Modal(project, "Refreshing from " + server.name, true) {
+ @Override
+ public void run(@NotNull ProgressIndicator indicator) {
+ try {
+ String localRoot = Paths.get(System.getProperty("user.home"), "ssh-remote-projects",
+ sanitize(server.host), sanitize(server.remoteProjectPath))
+ .toString().replace('\\', '/');
+ ConnectToRemoteAction.syncProject(server, localRoot, indicator);
+
+ // Обновляем виртуальную файловую систему, чтобы IDE увидела изменения
+ ApplicationManager.getApplication().invokeLater(() -> {
+ VirtualFile rootDir = LocalFileSystem.getInstance().findFileByPath(localRoot);
+ if (rootDir != null) {
+ VfsUtil.markDirtyAndRefresh(true, true, true, rootDir);
+ }
+ Messages.showInfoMessage("Project refreshed from " + server.name, "Refresh Complete");
+ });
+ } catch (Exception ex) {
+ ApplicationManager.getApplication().invokeLater(() ->
+ Messages.showErrorDialog("Refresh failed: " + ex.getMessage(), "Error"));
+ }
+ }
+ });
+ }
+
+ private String sanitize(String input) {
+ return input.replaceAll("[^a-zA-Z0-9.-]", "_");
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/RemoteCommandAction.java b/src/main/java/com/example/plugin/RemoteCommandAction.java
new file mode 100644
index 0000000..3791bd3
--- /dev/null
+++ b/src/main/java/com/example/plugin/RemoteCommandAction.java
@@ -0,0 +1,59 @@
+package com.example.plugin;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.jcraft.jsch.*;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.Optional;
+
+public class RemoteCommandAction extends AnAction {
+ @Override
+ public void actionPerformed(@NotNull AnActionEvent e) {
+ Project project = e.getProject();
+ if (project == null) return;
+ String serverId = ProjectServerMapping.getInstance().getServerIdForProject(project.getBasePath());
+ if (serverId == null) {
+ Messages.showErrorDialog("No server associated with this project", "Error");
+ return;
+ }
+ Optional maybeServer = SshServerManager.getInstance().findServer(serverId);
+ if (maybeServer.isEmpty()) return;
+ SshServer server = maybeServer.get();
+
+ String command = Messages.showInputDialog("Enter command to run on " + server.host, "Remote Command", null);
+ if (command == null || command.isEmpty()) return;
+
+ try {
+ String output = executeCommand(server, command);
+ Messages.showInfoMessage(output, "Command output");
+ } catch (Exception ex) {
+ Messages.showErrorDialog("Command error: " + ex.getMessage(), "Error");
+ }
+ }
+
+ private String executeCommand(SshServer server, String command) throws Exception {
+ JSch jsch = new JSch();
+ Session session = jsch.getSession(server.user, server.host, server.port);
+ session.setPassword(SshServerManager.getInstance().getPassword(server.id));
+ session.setConfig("StrictHostKeyChecking", "no");
+ session.connect(5000);
+
+ Channel channel = session.openChannel("exec");
+ ((ChannelExec) channel).setCommand(command);
+ BufferedReader reader = new BufferedReader(new InputStreamReader(channel.getInputStream()));
+ channel.connect();
+
+ StringBuilder output = new StringBuilder();
+ String line;
+ while ((line = reader.readLine()) != null) output.append(line).append("\n");
+
+ channel.disconnect();
+ session.disconnect();
+ return output.toString();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/SftpSessionManager.java b/src/main/java/com/example/plugin/SftpSessionManager.java
new file mode 100644
index 0000000..8064f36
--- /dev/null
+++ b/src/main/java/com/example/plugin/SftpSessionManager.java
@@ -0,0 +1,56 @@
+package com.example.plugin;
+
+import com.intellij.openapi.project.Project;
+import com.jcraft.jsch.*;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class SftpSessionManager {
+ private final ConcurrentHashMap channels = new ConcurrentHashMap<>();
+ private final ConcurrentHashMap sessions = new ConcurrentHashMap<>();
+ private final Object lock = new Object();
+
+ public ChannelSftp getChannel(SshServer server) throws Exception {
+ ChannelSftp channel = channels.get(server.id);
+ if (channel != null && channel.isConnected() && !channel.isClosed()) {
+ return channel;
+ }
+ synchronized (lock) {
+ channel = channels.get(server.id);
+ if (channel != null && channel.isConnected() && !channel.isClosed()) return channel;
+
+ JSch jsch = new JSch();
+ Session session = jsch.getSession(server.user, server.host, server.port);
+ session.setPassword(SshServerManager.getInstance().getPassword(server.id));
+ java.util.Properties config = new java.util.Properties();
+ config.put("StrictHostKeyChecking", "no");
+ session.setConfig(config);
+ session.connect(5000);
+
+ ChannelSftp newChannel = (ChannelSftp) session.openChannel("sftp");
+ newChannel.connect(3000);
+
+ sessions.put(server.id, session);
+ channels.put(server.id, newChannel);
+ return newChannel;
+ }
+ }
+
+ public void disconnect() {
+ synchronized (lock) {
+ for (ChannelSftp ch : channels.values()) {
+ if (ch.isConnected()) ch.disconnect();
+ }
+ for (Session s : sessions.values()) {
+ if (s.isConnected()) s.disconnect();
+ }
+ channels.clear();
+ sessions.clear();
+ }
+ }
+
+ public static SftpSessionManager getInstance(Project project) {
+ return project.getService(SftpSessionManager.class);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/SshConnectionState.java b/src/main/java/com/example/plugin/SshConnectionState.java
new file mode 100644
index 0000000..0a46068
--- /dev/null
+++ b/src/main/java/com/example/plugin/SshConnectionState.java
@@ -0,0 +1,51 @@
+package com.example.plugin;
+
+import com.intellij.credentialStore.CredentialAttributes;
+import com.intellij.ide.passwordSafe.PasswordSafe;
+import com.intellij.openapi.components.PersistentStateComponent;
+import com.intellij.openapi.components.State;
+import com.intellij.openapi.components.Storage;
+import com.intellij.util.xmlb.XmlSerializerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@State(
+ name = "SshConnectionState",
+ storages = { @Storage("ssh-connection.xml") }
+)
+public class SshConnectionState implements PersistentStateComponent {
+ public String host = "";
+ public int port = 22;
+ public String user = "";
+ public String remoteProjectPath = "/home/user/project";
+
+ public String getPassword() {
+ CredentialAttributes attributes = createCredentialAttributes();
+ return PasswordSafe.getInstance().getPassword(attributes);
+ }
+
+ public void setPassword(String password) {
+ CredentialAttributes attributes = createCredentialAttributes();
+ PasswordSafe.getInstance().setPassword(attributes, password);
+ }
+
+ private CredentialAttributes createCredentialAttributes() {
+ return new CredentialAttributes("SshRemotePlugin." + host + "." + user);
+ }
+
+ @Nullable
+ @Override
+ public SshConnectionState getState() {
+ return this;
+ }
+
+ @Override
+ public void loadState(@NotNull SshConnectionState state) {
+ XmlSerializerUtil.copyBean(state, this);
+ }
+
+ public static SshConnectionState getInstance() {
+ return com.intellij.openapi.application.ApplicationManager.getApplication()
+ .getService(SshConnectionState.class);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/SshServer.java b/src/main/java/com/example/plugin/SshServer.java
new file mode 100644
index 0000000..25613ee
--- /dev/null
+++ b/src/main/java/com/example/plugin/SshServer.java
@@ -0,0 +1,39 @@
+package com.example.plugin;
+
+import java.util.Objects;
+import java.util.UUID;
+
+public class SshServer {
+ public String id;
+ public String name;
+ public String host;
+ public int port = 22;
+ public String user;
+ public String remoteProjectPath;
+
+ public SshServer() {
+ this.id = UUID.randomUUID().toString();
+ }
+
+ public SshServer(String id, String name, String host, int port, String user, String remoteProjectPath) {
+ this.id = id != null ? id : UUID.randomUUID().toString();
+ this.name = name;
+ this.host = host;
+ this.port = port;
+ this.user = user;
+ this.remoteProjectPath = remoteProjectPath;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ SshServer server = (SshServer) o;
+ return Objects.equals(id, server.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/SshServerConfigurable.java b/src/main/java/com/example/plugin/SshServerConfigurable.java
new file mode 100644
index 0000000..d11c681
--- /dev/null
+++ b/src/main/java/com/example/plugin/SshServerConfigurable.java
@@ -0,0 +1,217 @@
+package com.example.plugin;
+
+import com.intellij.openapi.options.Configurable;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.ui.ValidationInfo;
+import com.intellij.ui.ToolbarDecorator;
+import com.intellij.ui.table.JBTable;
+import com.intellij.util.ui.JBUI;
+import org.jetbrains.annotations.Nls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import javax.swing.table.AbstractTableModel;
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class SshServerConfigurable implements Configurable {
+
+ private JPanel mainPanel;
+ private JBTable table;
+ private ServerTableModel tableModel;
+ private boolean modified = false;
+
+ @Nls(capitalization = Nls.Capitalization.Title)
+ @Override
+ public String getDisplayName() {
+ return "SSH Remote Project";
+ }
+
+ @Nullable
+ @Override
+ public JComponent createComponent() {
+ List servers = SshServerManager.getInstance().getServers();
+ tableModel = new ServerTableModel(new ArrayList<>(servers));
+ table = new JBTable(tableModel);
+ table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+
+ ToolbarDecorator decorator = ToolbarDecorator.createDecorator(table)
+ .setAddAction(button -> addServer())
+ .setEditAction(button -> editServer())
+ .setRemoveAction(button -> removeServer());
+ mainPanel = new JPanel(new BorderLayout());
+ mainPanel.add(decorator.createPanel(), BorderLayout.CENTER);
+ mainPanel.setBorder(JBUI.Borders.empty(10));
+ return mainPanel;
+ }
+
+ private void addServer() {
+ SshServer newServer = new SshServer();
+ ServerDialog dialog = new ServerDialog(mainPanel, "Add Server", newServer);
+ if (dialog.showAndGet()) {
+ SshServerManager.getInstance().addServer(dialog.getServer());
+ tableModel.servers.add(dialog.getServer());
+ tableModel.fireTableDataChanged();
+ modified = true;
+ }
+ }
+
+ private void editServer() {
+ int row = table.getSelectedRow();
+ if (row < 0) return;
+ SshServer server = tableModel.servers.get(row);
+ ServerDialog dialog = new ServerDialog(mainPanel, "Edit Server", server);
+ if (dialog.showAndGet()) {
+ SshServer updated = dialog.getServer();
+ SshServerManager.getInstance().updateServer(updated);
+ tableModel.servers.set(row, updated);
+ tableModel.fireTableRowsUpdated(row, row);
+ modified = true;
+ }
+ }
+
+ private void removeServer() {
+ int row = table.getSelectedRow();
+ if (row < 0) return;
+ SshServer server = tableModel.servers.get(row);
+ int result = Messages.showYesNoDialog(mainPanel,
+ "Удалить сервер \"" + server.name + "\"?", "Подтверждение", null);
+ if (result == Messages.YES) {
+ SshServerManager.getInstance().removeServer(server.id);
+ tableModel.servers.remove(row);
+ tableModel.fireTableRowsDeleted(row, row);
+ modified = true;
+ }
+ }
+
+ @Override
+ public boolean isModified() {
+ return modified;
+ }
+
+ @Override
+ public void apply() throws ConfigurationException {
+ // все изменения уже применены в SshServerManager
+ modified = false;
+ }
+
+ @Override
+ public void reset() {
+ tableModel.servers.clear();
+ tableModel.servers.addAll(SshServerManager.getInstance().getServers());
+ tableModel.fireTableDataChanged();
+ modified = false;
+ }
+
+ // ----- Таблица -----
+ private static class ServerTableModel extends AbstractTableModel {
+ private final String[] columns = {"Name", "Host", "User", "Remote Path"};
+ public final List servers;
+
+ ServerTableModel(List servers) {
+ this.servers = servers;
+ }
+
+ @Override public int getRowCount() { return servers.size(); }
+ @Override public int getColumnCount() { return columns.length; }
+ @Override public String getColumnName(int col) { return columns[col]; }
+ @Override public Object getValueAt(int row, int col) {
+ SshServer s = servers.get(row);
+ switch (col) {
+ case 0: return s.name;
+ case 1: return s.host;
+ case 2: return s.user;
+ case 3: return s.remoteProjectPath;
+ default: return "";
+ }
+ }
+ }
+}
+
+// ----- Диалог редактирования сервера -----
+class ServerDialog extends DialogWrapper {
+ private final JTextField nameField = new JTextField(20);
+ private final JTextField hostField = new JTextField(20);
+ private final JTextField portField = new JTextField("22", 5);
+ private final JTextField userField = new JTextField(20);
+ private final JPasswordField passwordField = new JPasswordField(20);
+ private final JTextField remotePathField = new JTextField(30);
+ private SshServer server;
+
+ protected ServerDialog(Component parent, String title, SshServer server) {
+ super(parent, true);
+ setTitle(title);
+ this.server = server;
+ init();
+ // Заполняем поля
+ nameField.setText(server.name);
+ hostField.setText(server.host);
+ portField.setText(String.valueOf(server.port));
+ userField.setText(server.user);
+ remotePathField.setText(server.remoteProjectPath);
+ // Пароль загружаем из хранилища
+ String savedPassword = SshServerManager.getInstance().getPassword(server.id);
+ if (savedPassword != null) passwordField.setText(savedPassword);
+ }
+
+ @Override
+ protected @Nullable JComponent createCenterPanel() {
+ JPanel panel = new JPanel(new GridBagLayout());
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.fill = GridBagConstraints.HORIZONTAL;
+ gbc.insets = JBUI.insets(4);
+ gbc.gridx = 0; gbc.gridy = 0; panel.add(new JLabel("Name:"), gbc);
+ gbc.gridx = 1; panel.add(nameField, gbc);
+ gbc.gridx = 0; gbc.gridy++; panel.add(new JLabel("Host:"), gbc);
+ gbc.gridx = 1; panel.add(hostField, gbc);
+ gbc.gridx = 0; gbc.gridy++; panel.add(new JLabel("Port:"), gbc);
+ gbc.gridx = 1; panel.add(portField, gbc);
+ gbc.gridx = 0; gbc.gridy++; panel.add(new JLabel("User:"), gbc);
+ gbc.gridx = 1; panel.add(userField, gbc);
+ gbc.gridx = 0; gbc.gridy++; panel.add(new JLabel("Password:"), gbc);
+ gbc.gridx = 1; panel.add(passwordField, gbc);
+ gbc.gridx = 0; gbc.gridy++; panel.add(new JLabel("Remote Path:"), gbc);
+ gbc.gridx = 1; panel.add(remotePathField, gbc);
+ return panel;
+ }
+
+ @Override
+ protected @NotNull List doValidateAll() {
+ List result = new ArrayList<>();
+ if (nameField.getText().trim().isEmpty()) result.add(new ValidationInfo("Name required", nameField));
+ if (hostField.getText().trim().isEmpty()) result.add(new ValidationInfo("Host required", hostField));
+ if (userField.getText().trim().isEmpty()) result.add(new ValidationInfo("User required", userField));
+ try { Integer.parseInt(portField.getText()); } catch (NumberFormatException e) {
+ result.add(new ValidationInfo("Invalid port", portField));
+ }
+ if (remotePathField.getText().trim().isEmpty()) result.add(new ValidationInfo("Remote path required", remotePathField));
+ return result;
+ }
+
+ @Override
+ protected void doOKAction() {
+ if (doValidateAll().isEmpty()) {
+ server.name = nameField.getText().trim();
+ server.host = hostField.getText().trim();
+ server.port = Integer.parseInt(portField.getText().trim());
+ server.user = userField.getText().trim();
+ server.remoteProjectPath = remotePathField.getText().trim();
+
+ // Сохраняем пароль, только если он не пустой
+ String pass = new String(passwordField.getPassword());
+ if (!pass.isEmpty()) {
+ SshServerManager.getInstance().setPassword(server.id, pass);
+ }
+ // Если поле пустое – оставляем старый пароль (если есть) нетронутым
+ super.doOKAction();
+ }
+ }
+
+ public SshServer getServer() {
+ return server;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/SshServerManager.java b/src/main/java/com/example/plugin/SshServerManager.java
new file mode 100644
index 0000000..68892dd
--- /dev/null
+++ b/src/main/java/com/example/plugin/SshServerManager.java
@@ -0,0 +1,106 @@
+package com.example.plugin;
+
+import com.intellij.credentialStore.CredentialAttributes;
+import com.intellij.ide.passwordSafe.PasswordSafe;
+import com.intellij.openapi.components.PersistentStateComponent;
+import com.intellij.openapi.components.State;
+import com.intellij.openapi.components.Storage;
+import com.intellij.util.xmlb.XmlSerializerUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+@State(
+ name = "SshServerManager",
+ storages = { @Storage("ssh-servers.xml") }
+)
+public class SshServerManager implements PersistentStateComponent {
+
+ public static class State {
+ public List servers = new ArrayList<>();
+ public String currentServerId;
+ }
+
+ private State myState = new State();
+
+ @Nullable
+ @Override
+ public State getState() {
+ return myState;
+ }
+
+ @Override
+ public void loadState(@NotNull State state) {
+ XmlSerializerUtil.copyBean(state, myState);
+ }
+
+ // ---------- CRUD ----------
+
+ public List getServers() {
+ return myState.servers;
+ }
+
+ public Optional findServer(String id) {
+ return myState.servers.stream().filter(s -> s.id.equals(id)).findFirst();
+ }
+
+ public void addServer(SshServer server) {
+ myState.servers.add(server);
+ }
+
+ public void removeServer(String id) {
+ myState.servers.removeIf(s -> s.id.equals(id));
+ if (id.equals(myState.currentServerId)) {
+ myState.currentServerId = null;
+ }
+ // Удаляем сохранённый пароль
+ PasswordSafe.getInstance().setPassword(createCredentialAttributes(id), null);
+ }
+
+ public void updateServer(SshServer updated) {
+ for (int i = 0; i < myState.servers.size(); i++) {
+ if (myState.servers.get(i).id.equals(updated.id)) {
+ myState.servers.set(i, updated);
+ break;
+ }
+ }
+ }
+
+ // ---------- Текущий сервер ----------
+
+ public String getCurrentServerId() {
+ return myState.currentServerId;
+ }
+
+ public void setCurrentServerId(String id) {
+ myState.currentServerId = id;
+ }
+
+ public Optional getCurrentServer() {
+ return Optional.ofNullable(myState.currentServerId).flatMap(this::findServer);
+ }
+
+ // ---------- Пароль ----------
+
+ public String getPassword(String serverId) {
+ return PasswordSafe.getInstance().getPassword(createCredentialAttributes(serverId));
+ }
+
+ public void setPassword(String serverId, String password) {
+ PasswordSafe.getInstance().setPassword(createCredentialAttributes(serverId), password);
+ }
+
+ private CredentialAttributes createCredentialAttributes(String serverId) {
+ return new CredentialAttributes("SshRemotePlugin.server." + serverId);
+ }
+
+ // ---------- Singleton ----------
+
+ public static SshServerManager getInstance() {
+ return com.intellij.openapi.application.ApplicationManager.getApplication()
+ .getService(SshServerManager.class);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/SshSyncStartupActivity.java b/src/main/java/com/example/plugin/SshSyncStartupActivity.java
new file mode 100644
index 0000000..cd54f59
--- /dev/null
+++ b/src/main/java/com/example/plugin/SshSyncStartupActivity.java
@@ -0,0 +1,174 @@
+package com.example.plugin;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.project.ProjectManager;
+import com.intellij.openapi.project.ProjectManagerListener;
+import com.intellij.openapi.startup.StartupActivity;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.*;
+import com.jcraft.jsch.*;
+import org.jetbrains.annotations.NotNull;
+
+import java.nio.file.Paths;
+import java.util.Optional;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@SuppressWarnings("deprecation")
+public class SshSyncStartupActivity implements StartupActivity {
+
+ private static final ExecutorService uploadExecutor = Executors.newSingleThreadExecutor();
+
+ @Override
+ public void runActivity(@NotNull Project project) {
+ // При закрытии проекта разрываем SFTP-подключение
+ project.getMessageBus().connect().subscribe(ProjectManager.TOPIC, new ProjectManagerListener() {
+ @Override
+ public void projectClosed(@NotNull Project closedProject) {
+ if (closedProject.equals(project)) {
+ SftpSessionManager.getInstance(project).disconnect();
+ }
+ }
+ });
+
+ // Слушатель изменений файлов для синхронизации
+ VirtualFile baseDir = project.getBaseDir();
+ if (baseDir != null) {
+ VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileListener() {
+ @Override
+ public void contentsChanged(@NotNull VirtualFileEvent event) {
+ syncFile(event.getFile(), project);
+ }
+
+ @Override
+ public void fileCreated(@NotNull VirtualFileEvent event) {
+ syncFile(event.getFile(), project);
+ }
+
+ private void syncFile(VirtualFile file, Project project) {
+ if (!file.isDirectory()) {
+ uploadFile(file, project);
+ }
+ }
+ }, project);
+ }
+
+ // === Автосинхронизация при открытии проекта ===
+ String projectPath = project.getBasePath();
+ if (projectPath != null) {
+ String serverId = ProjectServerMapping.getInstance().getServerIdForProject(projectPath);
+ if (serverId != null) {
+ Optional maybeServer = SshServerManager.getInstance().findServer(serverId);
+ if (maybeServer.isPresent()) {
+ SshServer server = maybeServer.get();
+ // Модальный диалог – блокирует IDE до завершения синхронизации
+ ApplicationManager.getApplication().invokeLater(() -> {
+ ProgressManager.getInstance().run(new Task.Modal(project, "Synchronizing with " + server.name, true) {
+ @Override
+ public void run(@NotNull ProgressIndicator indicator) {
+ try {
+ String localRoot = Paths.get(System.getProperty("user.home"), "ssh-remote-projects",
+ sanitize(server.host), sanitize(server.remoteProjectPath))
+ .toString().replace('\\', '/');
+ ConnectToRemoteAction.syncProject(server, localRoot, indicator);
+
+ // Обновляем виртуальную файловую систему, чтобы IDE увидела изменения
+ ApplicationManager.getApplication().invokeLater(() -> {
+ VirtualFile rootDir = LocalFileSystem.getInstance().findFileByPath(localRoot);
+ if (rootDir != null) {
+ VfsUtil.markDirtyAndRefresh(true, true, true, rootDir);
+ }
+ });
+ } catch (Exception e) {
+ ApplicationManager.getApplication().invokeLater(() ->
+ Messages.showErrorDialog("Sync failed: " + e.getMessage(), "Sync Error"));
+ }
+ }
+ });
+ });
+ }
+ }
+ }
+ }
+
+ private void uploadFile(VirtualFile localFile, Project project) {
+ String projectPath = project.getBasePath();
+ if (projectPath == null) return;
+
+ // Определяем привязанный сервер
+ String serverId = ProjectServerMapping.getInstance().getServerIdForProject(projectPath);
+ if (serverId == null) return;
+
+ Optional maybeServer = SshServerManager.getInstance().findServer(serverId);
+ if (maybeServer.isEmpty()) return;
+ SshServer server = maybeServer.get();
+
+ // Вычисляем локальный корень проекта (как он был сохранен при создании)
+ String localRoot = Paths.get(System.getProperty("user.home"), "ssh-remote-projects",
+ sanitize(server.host), sanitize(server.remoteProjectPath))
+ .toString().replace('\\', '/');
+
+ String localFilePath = localFile.getPath(); // всегда с прямыми слешами
+
+ // Игнорируем служебные файлы IDE
+ if (localFilePath.contains("/.idea/") || localFile.getName().equals("remote.iml")) {
+ return;
+ }
+
+ // Проверяем, что файл принадлежит проекту
+ if (!localFilePath.startsWith(localRoot)) {
+ return;
+ }
+
+ // Относительный путь и удалённый путь
+ String relativePath = localFilePath.substring(localRoot.length());
+ if (relativePath.startsWith("/")) {
+ relativePath = relativePath.substring(1);
+ }
+ String remoteFilePath = server.remoteProjectPath + "/" + relativePath;
+
+ // Отправляем файл в отдельном потоке через общее SFTP-соединение
+ uploadExecutor.submit(() -> {
+ try {
+ ChannelSftp sftp = SftpSessionManager.getInstance(project).getChannel(server);
+ String remoteParent = remoteFilePath.substring(0, remoteFilePath.lastIndexOf('/'));
+ createRemoteDirs(sftp, remoteParent);
+ sftp.put(localFilePath, remoteFilePath);
+ } catch (Exception e) {
+ ApplicationManager.getApplication().invokeLater(() ->
+ com.intellij.openapi.ui.Messages.showErrorDialog(
+ "Sync error " + localFile.getName() + ": " + e.getMessage(),
+ "SFTP Error"
+ )
+ );
+ }
+ });
+ }
+
+ private void createRemoteDirs(ChannelSftp sftp, String dir) throws SftpException {
+ if (dir.isEmpty() || dir.equals("/")) return;
+ String[] parts = dir.split("/");
+ StringBuilder path = new StringBuilder();
+ for (String part : parts) {
+ if (part.isEmpty()) continue;
+ path.append("/").append(part);
+ try {
+ sftp.stat(path.toString());
+ } catch (SftpException e) {
+ if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) {
+ sftp.mkdir(path.toString());
+ } else {
+ throw e;
+ }
+ }
+ }
+ }
+
+ private String sanitize(String input) {
+ return input.replaceAll("[^a-zA-Z0-9.-]", "_");
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/plugin/SwitchServerAction.java b/src/main/java/com/example/plugin/SwitchServerAction.java
new file mode 100644
index 0000000..95f8a0e
--- /dev/null
+++ b/src/main/java/com/example/plugin/SwitchServerAction.java
@@ -0,0 +1,75 @@
+package com.example.plugin;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.project.ProjectManager;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.ui.popup.JBPopupFactory;
+import com.intellij.openapi.wm.WindowManager;
+import org.jetbrains.annotations.NotNull;
+
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+public class SwitchServerAction extends AnAction {
+
+ @Override
+ public void actionPerformed(@NotNull AnActionEvent e) {
+ Project project = e.getProject();
+ if (project == null) return;
+
+ List servers = SshServerManager.getInstance().getServers();
+ if (servers.isEmpty()) {
+ Messages.showInfoMessage("No servers configured. Add them in Settings -> SSH Remote Project.", "No Servers");
+ return;
+ }
+
+ List names = new ArrayList<>();
+ for (SshServer s : servers) names.add(s.name);
+
+ JBPopupFactory.getInstance()
+ .createPopupChooserBuilder(names)
+ .setTitle("Switch Remote Server")
+ .setItemChosenCallback(selected -> {
+ for (SshServer server : servers) {
+ if (server.name.equals(selected)) {
+ switchToServer(server, project);
+ return;
+ }
+ }
+ })
+ .createPopup()
+ .showInFocusCenter();
+ }
+
+ private void switchToServer(SshServer server, Project currentProject) {
+ SshServerManager.getInstance().setCurrentServerId(server.id);
+
+ String localPath = Paths.get(System.getProperty("user.home"), "ssh-remote-projects",
+ sanitize(server.host), sanitize(server.remoteProjectPath))
+ .toString().replace('\\', '/');
+
+ // Проверяем, открыт ли уже проект с этим путём
+ for (Project openProject : ProjectManager.getInstance().getOpenProjects()) {
+ if (openProject.getBasePath() != null && openProject.getBasePath().equals(localPath)) {
+ ApplicationManager.getApplication().invokeLater(() ->
+ WindowManager.getInstance().getFrame(openProject).toFront());
+ return;
+ }
+ }
+
+ // Закрываем текущий проект и открываем новый
+ if (currentProject != null && !currentProject.isDisposed()) {
+ ProjectManager.getInstance().closeProject(currentProject);
+ }
+
+ ConnectToRemoteAction.openProjectForServer(server);
+ }
+
+ private String sanitize(String input) {
+ return input.replaceAll("[^a-zA-Z0-9.-]", "_");
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/org/jetbrains/plugins/template/MyBundle.kt b/src/main/kotlin/org/jetbrains/plugins/template/MyBundle.kt
new file mode 100644
index 0000000..ed5dd8b
--- /dev/null
+++ b/src/main/kotlin/org/jetbrains/plugins/template/MyBundle.kt
@@ -0,0 +1,23 @@
+package org.jetbrains.plugins.template
+
+import com.intellij.DynamicBundle
+import org.jetbrains.annotations.NonNls
+import org.jetbrains.annotations.PropertyKey
+
+@NonNls
+private const val BUNDLE = "messages.MyBundle"
+
+object MyBundle : DynamicBundle(BUNDLE) {
+
+ operator fun get(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
+ getMessage(key, *params)
+
+ @JvmStatic
+ fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
+ getMessage(key, *params)
+
+ @Suppress("unused")
+ @JvmStatic
+ fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
+ getLazyMessage(key, *params)
+}
diff --git a/src/main/kotlin/org/jetbrains/plugins/template/services/MyProjectService.kt b/src/main/kotlin/org/jetbrains/plugins/template/services/MyProjectService.kt
new file mode 100644
index 0000000..1ea70bc
--- /dev/null
+++ b/src/main/kotlin/org/jetbrains/plugins/template/services/MyProjectService.kt
@@ -0,0 +1,17 @@
+package org.jetbrains.plugins.template.services
+
+import com.intellij.openapi.components.Service
+import com.intellij.openapi.diagnostic.thisLogger
+import com.intellij.openapi.project.Project
+import org.jetbrains.plugins.template.MyBundle
+
+@Service(Service.Level.PROJECT)
+class MyProjectService(project: Project) {
+
+ init {
+ thisLogger().info(MyBundle["projectService", project.name])
+ thisLogger().warn("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.")
+ }
+
+ fun getRandomNumber() = (1..100).random()
+}
diff --git a/src/main/kotlin/org/jetbrains/plugins/template/startup/MyProjectActivity.kt b/src/main/kotlin/org/jetbrains/plugins/template/startup/MyProjectActivity.kt
new file mode 100644
index 0000000..87e9e65
--- /dev/null
+++ b/src/main/kotlin/org/jetbrains/plugins/template/startup/MyProjectActivity.kt
@@ -0,0 +1,12 @@
+package org.jetbrains.plugins.template.startup
+
+import com.intellij.openapi.diagnostic.thisLogger
+import com.intellij.openapi.project.Project
+import com.intellij.openapi.startup.ProjectActivity
+
+class MyProjectActivity : ProjectActivity {
+
+ override suspend fun execute(project: Project) {
+ thisLogger().warn("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.")
+ }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/org/jetbrains/plugins/template/toolWindow/MyToolWindowFactory.kt b/src/main/kotlin/org/jetbrains/plugins/template/toolWindow/MyToolWindowFactory.kt
new file mode 100644
index 0000000..4f38940
--- /dev/null
+++ b/src/main/kotlin/org/jetbrains/plugins/template/toolWindow/MyToolWindowFactory.kt
@@ -0,0 +1,45 @@
+package org.jetbrains.plugins.template.toolWindow
+
+import com.intellij.openapi.components.service
+import com.intellij.openapi.diagnostic.thisLogger
+import com.intellij.openapi.project.Project
+import com.intellij.openapi.wm.ToolWindow
+import com.intellij.openapi.wm.ToolWindowFactory
+import com.intellij.ui.components.JBLabel
+import com.intellij.ui.components.JBPanel
+import com.intellij.ui.content.ContentFactory
+import org.jetbrains.plugins.template.MyBundle
+import org.jetbrains.plugins.template.services.MyProjectService
+import javax.swing.JButton
+
+
+class MyToolWindowFactory : ToolWindowFactory {
+
+ init {
+ thisLogger().warn("Don't forget to remove all non-needed sample code files with their corresponding registration entries in `plugin.xml`.")
+ }
+
+ override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
+ val myToolWindow = MyToolWindow(toolWindow)
+ val content = ContentFactory.getInstance().createContent(myToolWindow.getContent(), null, false)
+ toolWindow.contentManager.addContent(content)
+ }
+
+ override fun shouldBeAvailable(project: Project) = true
+
+ class MyToolWindow(toolWindow: ToolWindow) {
+
+ private val service = toolWindow.project.service()
+
+ fun getContent() = JBPanel>().apply {
+ val label = JBLabel(MyBundle["randomLabel", "?"])
+
+ add(label)
+ add(JButton(MyBundle["shuffle"]).apply {
+ addActionListener {
+ label.text = MyBundle["randomLabel", service.getRandomNumber()]
+ }
+ })
+ }
+ }
+}
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
new file mode 100644
index 0000000..c171ba4
--- /dev/null
+++ b/src/main/resources/META-INF/plugin.xml
@@ -0,0 +1,67 @@
+
+ com.example.ssh.remote.plugin
+ SSH Remote Sync
+ Your Name
+ SSH Remote Sync
+
Работайте с кодом на удалённых серверах так же удобно, как с локальным проектом. Плагин автоматически синхронизирует файлы при сохранении, поддерживает список виртуальных машин и переключение между ними.
+
+
Основные возможности
+
+
Менеджер серверов – добавляйте несколько ВМ с адресами, пользователями и паролями. Пароли надёжно хранятся в системном хранилище IDE.
+
Открытие удалённого проекта – плагин скачивает проект с сервера в локальную папку и открывает его в IDE как обычный проект.
+
Автосинхронизация при сохранении – каждое нажатие Ctrl+S мгновенно отправляет изменённый файл на сервер.
+
Обновление с сервера – кнопка Refresh загружает все изменения с сервера, даже если они были сделаны кем-то другим.
+
Выполнение команд – можно запустить любую команду на привязанном сервере прямо из IDE.
+
Переключение между серверами – быстрое переключение между проектами разных ВМ без ручного поиска файлов.
+
+
+
Как начать
+
+
Откройте File → Settings → SSH Remote Project и добавьте сервер (хост, порт, логин, пароль, путь к проекту).
+
Выберите Tools → SSH Remote Manager → Switch Remote Server и укажите нужный сервер. Проект откроется в отдельном окне.
+
Редактируйте файлы – при сохранении они автоматически уйдут на сервер.
+
Чтобы подтянуть изменения с сервера, используйте Tools → SSH Remote Manager → Refresh from Server.
+
+
+
Плагин работает в Community Edition и совместим с IntelliJ IDEA 2024.1.7 и новее.
+ ]]>
+
+ com.intellij.modules.platform
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/messages/MyBundle.properties b/src/main/resources/messages/MyBundle.properties
new file mode 100644
index 0000000..2e041d8
--- /dev/null
+++ b/src/main/resources/messages/MyBundle.properties
@@ -0,0 +1,3 @@
+projectService=Project service: {0}
+randomLabel=The random number is: {0}
+shuffle=Shuffle
diff --git a/src/test/kotlin/org/jetbrains/plugins/template/MyPluginTest.kt b/src/test/kotlin/org/jetbrains/plugins/template/MyPluginTest.kt
new file mode 100644
index 0000000..3945372
--- /dev/null
+++ b/src/test/kotlin/org/jetbrains/plugins/template/MyPluginTest.kt
@@ -0,0 +1,39 @@
+package org.jetbrains.plugins.template
+
+import com.intellij.ide.highlighter.XmlFileType
+import com.intellij.openapi.components.service
+import com.intellij.psi.xml.XmlFile
+import com.intellij.testFramework.TestDataPath
+import com.intellij.testFramework.fixtures.BasePlatformTestCase
+import com.intellij.util.PsiErrorElementUtil
+import org.jetbrains.plugins.template.services.MyProjectService
+
+@TestDataPath("\$CONTENT_ROOT/src/test/testData")
+class MyPluginTest : BasePlatformTestCase() {
+
+ fun testXMLFile() {
+ val psiFile = myFixture.configureByText(XmlFileType.INSTANCE, "bar")
+ val xmlFile = assertInstanceOf(psiFile, XmlFile::class.java)
+
+ assertFalse(PsiErrorElementUtil.hasErrors(project, xmlFile.virtualFile))
+
+ assertNotNull(xmlFile.rootTag)
+
+ xmlFile.rootTag?.let {
+ assertEquals("foo", it.name)
+ assertEquals("bar", it.value.text)
+ }
+ }
+
+ fun testRename() {
+ myFixture.testRename("foo.xml", "foo_after.xml", "a2")
+ }
+
+ fun testProjectService() {
+ val projectService = project.service()
+
+ assertNotSame(projectService.getRandomNumber(), projectService.getRandomNumber())
+ }
+
+ override fun getTestDataPath() = "src/test/testData/rename"
+}
diff --git a/src/test/testData/rename/foo.xml b/src/test/testData/rename/foo.xml
new file mode 100644
index 0000000..b21e9f2
--- /dev/null
+++ b/src/test/testData/rename/foo.xml
@@ -0,0 +1,3 @@
+
+ 1>Foo
+
diff --git a/src/test/testData/rename/foo_after.xml b/src/test/testData/rename/foo_after.xml
new file mode 100644
index 0000000..980ca96
--- /dev/null
+++ b/src/test/testData/rename/foo_after.xml
@@ -0,0 +1,3 @@
+
+ Foo
+