# No-op files in intellij

**URL:** <https://users.scala-lang.org/t/no-op-files-in-intellij/4359>\
**Category:** Question\
**Created:** [April 16, 2019, 2:52pm UTC](https://users.scala-lang.org/t/no-op-files-in-intellij/4359 "2019-04-16T14:52:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimka](https://users.scala-lang.org/user_avatar/users.scala-lang.org/jimka/32/646_2.png) [@jimka](https://users.scala-lang.org/u/jimka)\
**Post date:** [April 16, 2019, 2:52pm UTC](https://users.scala-lang.org/t/no-op-files-in-intellij/4359/1 "2019-04-16T14:52:59Z")

</div>

I have some files in my project which I don’t want to compile, for various reasons. Is there way in IntelliJ to mark certain files and dont-compile-dont-run ?

The motivation is that I am building compilable files, and along side them incorrect files which my students need to correct the errors in so they can compile.

I’ve considered creating a templates directory alongside scala and test. Do I need to invent something for this, or does a solution already exist?

---

<div class="post-metadata">

**Author:** ![tarsa](https://users.scala-lang.org/user_avatar/users.scala-lang.org/tarsa/32/596_2.png) [@tarsa](https://users.scala-lang.org/u/tarsa)\
**Post date:** [April 16, 2019, 4:10pm UTC](https://users.scala-lang.org/t/no-op-files-in-intellij/4359/2 "2019-04-16T16:10:04Z")

</div>

Change file name extension? From e.g. \*.scala to \*.scala.exercise. This way they will be skipped.

---

<div class="post-metadata">

**Author:** ![jimka](https://users.scala-lang.org/user_avatar/users.scala-lang.org/jimka/32/646_2.png) [@jimka](https://users.scala-lang.org/u/jimka)\
**Post date:** [April 17, 2019, 10:35am UTC](https://users.scala-lang.org/t/no-op-files-in-intellij/4359/3 "2019-04-17T10:35:53Z")

</div>

I created a directory parallel to scala named templates, and put the files there. That seems to work.

---

<div class="post-metadata">

**Author:** ![curoli](https://users.scala-lang.org/user_avatar/users.scala-lang.org/curoli/32/1753_2.png) [@curoli](https://users.scala-lang.org/u/curoli)\
**Post date:** [April 17, 2019, 4:28pm UTC](https://users.scala-lang.org/t/no-op-files-in-intellij/4359/4 "2019-04-17T16:28:17Z")

</div>

IntelliJ should only compile files in directories marked as source directories.

If this is an imported SBT project, then SBT settings determine the source directories. SBT default for Scala sources is src/main/scala, plus src/test/scala for tests.

To view or directly set source directories in IntelliJ, go to menu File \> Project Structure, and in the dialogue go to Project settings \> Modules.
