Hello,
I’ve encountered a regression in the IntelliJ Platform SDK version 2026.1 (Build 261). My custom Macro implementation can no longer retrieve the Project instance from the DataContext when the macro is expanded during a Run Configuration execution.
In previous versions (2024.x, 2025.x), the following code worked correctly:
override fun expand(dataContext: DataContext): String? {
val project: Project? = CommonDataKeys.PROJECT.getData(dataContext)
// project is null here in 2026.1
val configService = project?.service<ConfigService>()
val database = configService?.selectedDatabase
if (!database.isNullOrEmpty()) {
return database
}
return ""
}
Is this a known change in the DataContext lifecycle for 2026.1, or should I be using a different key to access the project context during macro expansion?
It appears this is not limited to custom macros. Standard built-in macros like $FileName$ or $ProjectFileDir$ also fail to expand correctly or return empty values when used in the same context (Run Configuration arguments) in Build 261. This suggests a broader issue with MacroManager or DataContext propagation during the execution phase in the latest 2026.1.
Thanks for any help!