Custom Macro fails to resolve Project in Run Configurations (regression in 2026.1)

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!

Seriously, what’s the point of this website? I reported a serious issue and received no response or feedback.

This website is a community effort, and people may be on vacation :wink:
Be patient and don’t be insulting, otherwise you should expect nothing from us.

We also would be glad to receive issues where they belong - issue tracker https://youtrack.jetbrains.com/issues/IJPL

This is how problems become visible to the development team

I did report this issue via the issue report, but I haven’t received any response yet.