- Open "Project" sidebar
- Go to target/scala-<version>/src_managed
- Right-click the src_managed, "Mark Directory As"/"Generated Source Root"
- Subdirectories of src_managed are from a strange reason marked as source roots. You can disable it.
- Enjoy.
Note that javascript routes seem to be still ignored from a strange reason, so this is not a perfect solution. Nevertheless, it is better than nothing.