It seems that the treesitter implementation for Go does not correctly parse modules. The module is correctly parsed when inside the function declaration.
However, when a module is used in a function or method it instead becomes a type of variable.
Example Code:
package main
import (
"fmt"
"time"
)
// Here time is a module
func getTime(t time.Time) string {
return t.String()
}
func main() {
// Here, fmt and time are variables not modules
fmt.Println("The time is: ", getTime(time.Now()))
}
tree-sitter is not context-aware, that's what queries are for, so you can tag specific bits and correlate that with their usage later on within a scope.
It seems that the treesitter implementation for Go does not correctly parse modules. The module is correctly parsed when inside the function declaration.
However, when a module is used in a function or method it instead becomes a type of
variable
.Example Code:
Parsed Tree: