ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
535 stars 126 forks source link

Apply settings of run configuration templates to new run configurations #166

Closed jansorg closed 2 years ago

jansorg commented 2 years ago

If you define EnvFile settings for run configuration templates, then these settings are properly read and written for the template. But as soon as you create a new run configuration of this type, then the template settings of EnvFile are not applied.

This PR fixes this problem. A new run configuration is created via com.intellij.execution.configurations.RunConfiguration#clone and com.intellij.openapi.util.UserDataHolderBase#clone is only copying the copyable user data mapping. UserDataHolderBase is a superclass of RunConfigurationBase and thus used by most configuration types.

Using putCopyableUserData and getCopyableUserData keeps the data in the copyable data and thus properly appliese the template settings.

ashald commented 2 years ago

Thanks for the contribution!