FileEditorManagerEx.openFile and updating Plugin project to latest version
First I would like to know how is it possible to develop plugin on EAP versions? I looked up version number, updated this in bulid.gradle.kts and it was unable to download it, (I also tried version 241 and I was also out of luck even though that is released version).
Ide plugin template still runs on ancient version, so I am not sure what is the latest version available to use, however my plugin depends on now removed function signature quite heavily, so I need to solve this somehow.
Now to the main issue, - I tried new version of Webstorm - 242 EAP to be precise, and I noticed that calling FileEditorManagerEx.openFile.openFile with FileEditorOpenOptions, throws an error as this method signature seems to be gone, unsurprisingly - I noticed that it was marked as to be removed in the future. So what are the options to achieve functionality that was available in prior versions?
I noticed this also affects TabShifter plugin.
请先登录再写评论。
Hi,
Please be more specific about the issue. The method
FileEditorManagerEx#openFile(VirtualFile, FileEditorOpenOptions)
is available, but is Kotlin-suspending. I checked the history and don't understand which one you mean.Regarding developing on EAP, in IntelliJ Platform Gradle Plugin 2.x, you can define a custom
runIde
task, which will be configured to use EAP:https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-testing-extension.html#intellijPlatformTesting
Example:
The version can be taken from https://www.jetbrains.com/idea/whatsnew/ page if EAP is available.
Hi, thank you for answer,
I am now looking into Gradle Plugin update, I believe this will solve my issue.
Regarding openFile method - this was meant to be used with window parameter and option object to for instance say I don't want to focus opened file right away.
However, after looking into Gradle 2 related stuff and noticing that upgrade is mandatory:
- my plugin worked at least partially in EAP upon noticing openFile error I just stopped testing further - so could the case I was observing be related to using old Gradle plugin that broke my plugin just partially?
- when I look into Intellij Platform git repo - is what I see in master branch the code that runs in EAP? because there it seems openFile with needed signature does indeed exist, which would certaInly point out that my obsolete Gradle 1 config caused this
- the snipped you provided - this looks like run task for ide, will this ensure that the bulid is done against that version?
No, the Gradle plugin version is unrelated to API presence.
No, EAP is built from so-called release branches. For example, the EAP I mentioned in the previous message (242.20224.159) was built from https://github.com/JetBrains/intellij-community/tree/242.20224. 159 is a build number.
No, it will be built against the product defined in
dependencies.intellijPlatform {}
. See https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.htmlThank you for useful info, this cleared some things.
I can see now that in EAP branch the required functionality is present, so I don't need to research this any longer, and I am sure I will be able to fix all the issues when next version is fully released.