project.aemSettings?.aemSupportEnabled == true && file.isHtlFile(project) && licenseIsValid()
. I'm suspecting that settings is null or evaluates to false for some reason.I can also see some IDEA bugs in 2021.1 related to switching between branches. I recall that I even faced it with Maven dependencies not visible after switching branches. There is some update released recently, that fixes some related issues:
https://youtrack.jetbrains.com/issue/IDEA-264752#focus=Comments-27-4864543.0-0
Could you please update IDEA to the newest version (released on 28 of April) and check if it fixes the problem?