I recently upgraded my IntelliJ version from 2018.3 to 2020.3. I now get an error when trying to run code involving data keys:
Editor editor = event.getData(CommonDataKeys.EDITOR);
String highlightedText = editor.getSelectionModel().getSelectedText();
ConsoleViewImpl console = ((ConsoleViewImpl) event.getData(LangDataKeys.CONSOLE_VIEW));
Both of the above code snippets give the following error:
java: cannot access com.intellij.openapi.actionSystem.DataKey
class file for com.intellij.openapi.actionSystem.DataKey not found
This code works fine in 2018.3 but not in 2020.3 and I have been unable to work out why, any help is appreciated.