Open donkirkby opened 5 months ago
Trying to reproduce the problem locally can't find the latest version of IDEA. I posted a question on the IntelliJ support forum.
Looks like I need to upgrade the IntelliJ platform gradle plugin to v2.0 to support newer versions of IDEA. That page also contains a migration guide.
A good source of help is the JetBrains slack, particularly the #intellij-platform-gradle-plugin
channel.
So far, I upgraded Gradle to v8.9, and started following the migration guide.
After the gradle and Plugin DevKit upgrades, I can reproduce the problem with these settings:
dependencies {
intellijPlatform {
intellijIdeaCommunity("2024.2.2")
plugin("PythonCore:243.15521.24")
pluginVerifier()
}
}
I can successfully run the old version with these settings:
dependencies {
intellijPlatform {
intellijIdeaCommunity("2023.2.7")
plugin("PythonCore:232.10300.40")
pluginVerifier()
instrumentationTools()
}
}
I did need to remove a couple of null
s to make that work, though.
I tried stepping through the source code of the old version and copying it into my plugin, but I couldn't import TextEditorImplKt.createAsyncEditorLoader
. For the record, here's what I tried:
return TasksKt.runWithModalProgressBlocking(
project,
"Opening " + file.getName(),
((coroutineScope, continuation) -> (
createEditorBuilder(project, file, asyncProvider, coroutineScope))));
}
private static Builder createEditorBuilder(
Project project,
VirtualFile file,
AsyncFileEditorProvider asyncProvider,
CoroutineScope coroutineScope) {
if ( ! (asyncProvider instanceof TextEditorProvider)) {
throw new IllegalArgumentException("Async editor provider is not a TextEditorProvider.");
}
var textEditorProvider = (TextEditorProvider) asyncProvider;
var asyncLoader = createAsyncEditorLoader(textEditorProvider, project, file, coroutineScope);
var fileDocumentManager = FileDocumentManager.getInstance();
var document = fileDocumentManager.getCachedDocument(file);
if (document == null) {
document = ApplicationManager.getApplication().runReadAction(
(Computable<? extends Document>) () -> fileDocumentManager.getDocument(file, project));
}
var factory = (EditorFactoryImpl)(EditorFactory.getInstance());
var highlighter = asyncLoader.createHighlighterAsync(document, file);
return new AsyncFileEditorProvider.Builder() {
public @NotNull FileEditor build() {
var editor = factory.createMainEditor(document, project, file);
var textEditor = new PsiAwareTextEditorImpl(project, file, editor, asyncLoader);
asyncLoader.start(textEditor, highlighter);
return textEditor;
}
};
}
The next thing to try is to step through the diff tool in the new version.
Looks like some good example code in the Markdown Navigator plugin.
Markdown Navigator has the same incompatibility issues that I do. :-(
The Markdown plugin seems out of date, so maybe the AsciiDoc plugin is a better choice.
JetBrains compatibility scans started complaining about version 2024.2:
Looks like the classes
PythonCommandLineState
andPythonRunConfiguration
have been replaced, so figure out what to use instead.