SemanticDB is a data model for semantic information such as symbols and types about programs in Scala and other languages. SemanticDB decouples production and consumption of semantic information, establishing documented means for communication between tools. https://scalameta.org/docs/semanticdb/guide.html https://scalacenter.github.io/scalafix/docs/developers/before-you-begin.html#is-your-rule-syntactic-or-semantic
Questions tagged [semanticdb]
6 questions
3
votes
0 answers
Relationship between ScalaMeta, ScalaFix, and SemanticDB
I have the following information:
Scalameta: has the ability to produce ASTs from a source file
SemanticDB: Contains information about symbols from a parsed source
file
ScalaFix: is based on ScalaMeta and SemanticDB so it has the ability to access…

Gakuo
- 845
- 6
- 26
1
vote
1 answer
How to get the type of a variable with scalameta if the decltpe is empty?
If I have the following type
Defn.Var(mods, pats, decltpe, rhs)
in scalameta it might happen that decltype is set to None for a variable like this:
var x = 10
I still want to know the exact type of the variable x which Scala has inferred without…

Baradé
- 1,290
- 1
- 15
- 35
1
vote
1 answer
Scalameta's Semantic API
In Scalameta's tutorial, it notes that the Semantic API can be used for name resolution (println => _root_.scala.Predef.println). The FAQ "How do I use the Semantic API?" links to scalafix, but I was unable to find a tutorial or concrete examples. …

Sledge
- 178
- 13
0
votes
1 answer
Is it possible to using macro to modify the generated code of structural-typing instance invocation?
For example as the following code:
object Test extends App
{
trait Class
{
val f1: Int
}
val c = new Class {
val f1: Int = 1
val f2: String = "Class"
}
println(c.f1)
println(c.f2)
}
I look into…

xiagao1982
- 1,077
- 1
- 13
- 25
0
votes
1 answer
How to use one or multiple SemanticRules with scalafix similar to scalameta's Transformer?
In the tutorial https://scalacenter.github.io/scalafix/docs/developers/tutorial.html I see how a SemanticRule is implemented for scalafix.
I would like to call it directly in the source code on a Scala file which I have read from the disk and…

Baradé
- 1,290
- 1
- 15
- 35
0
votes
1 answer
Obtaining a SemanticDocument from a Scala source file using ScalaFix
What are the steps of parsing a Scala source file into a SemanticDocument using ScalaFix?

Gakuo
- 845
- 6
- 26