0

I would like to use scalameta to parse ALL source code files from an SBT based Scala project and transform them. As the documentation states (https://scalameta.org/docs/trees/guide.html#from-programs-with-multiple-top-level-statements) I can parse SBT files with scalameta but how do I get the corresponding source code files of the project? Do I have to filter for all .scala files in the src/main/scala folder manually?

Baradé
  • 1,290
  • 1
  • 15
  • 35

1 Answers1

0

As written in documentation about SemanticDB they added a function to work with all .semanticdb files to internal package. I guess you can do similar thing with .scala or .sbt files. Well, basically, yes, it's on your own.

https://github.com/scalameta/scalameta/issues/1566

https://github.com/scalameta/scalameta/blob/master/semanticdb/semanticdb/src/main/scala/scala/meta/internal/semanticdb/Locator.scala


Here is example how to handle all source files in a directory with sbt + Scalameta https://github.com/DmytroMitin/scalameta-demo

Dmytro Mitin
  • 48,194
  • 3
  • 28
  • 66