Documentation ¶
Overview ¶
Package schema defines constants used in the Kythe schema.
Index ¶
Constants ¶
const ( NodeKindFact = "/kythe/node/kind" SubkindFact = "/kythe/subkind" AnchorStartFact = "/kythe/loc/start" AnchorEndFact = "/kythe/loc/end" SnippetStartFact = "/kythe/snippet/start" SnippetEndFact = "/kythe/snippet/end" TextFact = "/kythe/text" TextEncodingFact = "/kythe/text/encoding" CompleteFact = "/kythe/complete" FormatFact = "/kythe/format" )
Kythe node fact labels
const ( AnchorKind = "anchor" FileKind = "file" NameKind = "name" DocKind = "doc" EnumKind = "enum" FunctionKind = "function" PackageKind = "package" RecordKind = "record" TAppKind = "tapp" VariableKind = "variable" )
Kythe node kinds
const ( ClassSubkind = "class" EnumClassSubkind = "enumClass" ImplicitSubkind = "implicit" )
Kythe node subkinds
const ( CallableAsEdge = EdgePrefix + "callableas" ChildOfEdge = EdgePrefix + "childof" NamedEdge = EdgePrefix + "named" OverridesEdge = EdgePrefix + "overrides" ParamEdge = EdgePrefix + "param" TypedEdge = EdgePrefix + "typed" )
Kythe edge kinds
const ( CompletesEdge = EdgePrefix + "completes" CompletesUniquelyEdge = EdgePrefix + "completes/uniquely" DefinesEdge = EdgePrefix + "defines" DefinesBindingEdge = EdgePrefix + "defines/binding" DocumentsEdge = EdgePrefix + "documents" RefEdge = EdgePrefix + "ref" RefCallEdge = EdgePrefix + "ref/call" )
Kythe edge kinds associated with anchors
const ( // AnchorLocFilter is a fact filter for anchor locations AnchorLocFilter = "/kythe/loc/*" // SnippetLocFilter is a fact filter for snippet locations SnippetLocFilter = "/kythe/snippet/*" )
const DefaultTextEncoding = "UTF-8"
DefaultTextEncoding is the assumed value of the TextEncodingFact if it is empty or missing from a node with a TextFact.
const EdgePrefix = "/kythe/edge/"
EdgePrefix is the standard Kythe prefix for all edge kinds.
Variables ¶
This section is empty.
Functions ¶
func Canonicalize ¶
Canonicalize will return the canonical, forward version of an edge kind.
func IsAnchorEdge ¶ added in v0.0.13
IsAnchorEdge returns if the given edge kind is associated with anchors.
func IsEdgeVariant ¶ added in v0.0.13
IsEdgeVariant returns if k1 is the same edge kind as k2 or a more specific variant (i.e. IsEdgeVariant("/kythe/edge/defines/binding", "/kythe/edge/defines") == true). Note that IsEdgeVariant(k1, k2) == IsEdgeVariant(MirrorEdge(k1), MirrorEdge(k2)).
func MirrorEdge ¶
MirrorEdge returns the reverse edge kind for a given forward edge kind and returns the forward edge kind for a given reverse edge kind.
Types ¶
type EdgeDir ¶
type EdgeDir bool
EdgeDir represents the inherent direction of an edge kind.
Forward edges are generally dependency edges and ensure that each node has a small out-degree in the Kythe graph. Reverse edges are the opposite.
func EdgeDirection ¶
EdgeDirection returns the edge direction of the given edge kind