title: IntelliJ Idea can't resolve symbol that inside Scala managed sources (sbt-buildinfo)
body: <p>I think it could be a problem that appeared in new versions, and can't be resolved as old versions, I got a Play Java project with <code>sbt-buildinfo</code> plugin the problem is really common is that IntelliJ keep saying it can't resolve that symbol</p>
  <p><a href="https://i.stack.imgur.com/6j4sa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6j4sa.png" alt="InjettiJ can't resolve symbol" /></a></p>
  <p>And here is the file:</p>
  <p><a href="https://i.stack.imgur.com/M0auI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M0auI.png" alt="Generated file" /></a></p>
  <p>Some solutions can be found <a href="https://stackoverflow.com/questions/23957955/intellij-idea-sbt-managed-source-file">IntelliJ Idea sbt managed source file</a> and here <a href="https://stackoverflow.com/questions/40227891/sbt-buildinfo-generated-object-cannot-be-referenced">sbt-buildinfo generated object cannot be referenced</a> but none of the solutions provided were helpful for me:</p>
  <p><a href="https://i.stack.imgur.com/zNMaW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zNMaW.png" alt="InjelliJ settings" /></a></p>
  <p>The really strange thing is if I &quot;Unmark the directory as a generated source&quot; and then move that <code>BuildInfo.scala</code> file to the package folder manually to <code>buildpkg</code> (my custom package) instead of <code>sbt-buildinfo</code> package, IntelliJ see that file, but this change is useless because the file will be generated again and all changes will be discarded:</p>
  <p><a href="https://i.stack.imgur.com/bP50J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bP50J.png" alt="Wow!" /></a></p>
  <p>Here is my <strong>build.sbt</strong>:</p>
  <pre><code>lazy val root = (project in file(&quot;.&quot;)).enablePlugins(PlayJava, BuildInfoPlugin)
    .settings(
      buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion, buildInfoBuildNumber,
        &quot;hostname&quot; -&gt; java.net.InetAddress.getLocalHost.getHostName,
        &quot;gitHash&quot; -&gt; sys.env.getOrElse(&quot;BITBUCKET_COMMIT&quot;, &quot;No BITBUCKET_COMMIT set&quot;)
      ),
      buildInfoPackage := &quot;buildpkg&quot;,
      buildInfoOptions += BuildInfoOption.ToJson,
      buildInfoOptions += BuildInfoOption.BuildTime
    )
  
  scalaVersion := &quot;2.12.3&quot;
  </code></pre>
  <p>and my <strong>plugins.sbt</strong> :</p>
  <pre><code>// The Play plugin
  addSbtPlugin(&quot;com.typesafe.play&quot; % &quot;sbt-plugin&quot; % &quot;2.6.5&quot;)
  
  addSbtPlugin(&quot;com.eed3si9n&quot; % &quot;sbt-buildinfo&quot; % &quot;0.7.0&quot;)
  </code></pre>
  <p>So what I'm missing, what the solution for this</p>