Documentation
¶
Index ¶
Constants ¶
View Source
const DescSplit = "|,|"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct {
Src string `json:"src"`
Caller string `json:"caller"`
Arguments []string `json:"arguments"`
Span core.Span `json:"span"`
}
Call NON-PRECISE
func aFunc() {
a.b(c, d)
}
aFunc == Src
a.b == caller
[c, d] == arguments
func (*Call) GetIndexName ¶
type Clazz ¶
type Clazz struct {
Name string `json:"name" bson:"name"`
Module string `json:"module" bson:"module"`
// this span will include header and content
Span core.Span `json:"span" bson:"span"`
// which contains language-specific contents
Extras interface{} `json:"extras" bson:"extras,omitempty"`
// ptr to origin Unit
Unit *core.Unit `json:"-" bson:"-"`
// language
Lang core.LangType `json:"lang" bson:"lang"`
}
func (*Clazz) GetIndexName ¶
func (*Clazz) GetSignature ¶
func (c *Clazz) GetSignature() ClazzSignature
type ClazzSignature ¶
type ClazzSignature = string
type FuncSignature ¶
type FuncSignature = string
type Function ¶
type Function struct {
Name string `json:"name" bson:"name"`
Receiver string `json:"receiver" bson:"receiver"`
Namespace string `json:"namespace" bson:"namespace"`
Parameters []*ValueUnit `json:"parameters" bson:"parameters"`
Returns []*ValueUnit `json:"returns" bson:"returns"`
// where the definition actually happened
// avoid the impacts of annotations and decorations
DefLine int `json:"defLine" bson:"defLine"`
// this span will include header and content
Span core.Span `json:"span" bson:"span"`
// which includes only body
BodySpan core.Span `json:"bodySpan" bson:"bodySpan"`
// which contains language-specific contents
Extras interface{} `json:"extras" bson:"extras,omitempty"`
// ptr to origin Unit
Unit *core.Unit `json:"-" bson:"-"`
// language
Lang core.LangType `json:"lang" bson:"lang"`
}
func NewFunction ¶
func NewFunction() *Function
func (*Function) GetIndexName ¶
func (*Function) GetSignature ¶
func (f *Function) GetSignature() FuncSignature
type Symbol ¶
type Symbol struct {
Symbol string `json:"symbol"`
Kind string `json:"kind"`
Span core.Span `json:"span"`
FieldName string `json:"fieldName"`
// ptr to origin Unit
Unit *core.Unit `json:"-"`
}
Symbol Units are named identifiers driven by the ASTs
https://github.com/github/semantic/blob/main/docs/examples.md#symbols https://github.com/github/semantic/blob/main/proto/semantic.proto
message Unit {
string symbol = 1;
string kind = 2;
Span span = 4;
NodeType node_type = 6;
SyntaxType syntax_type = 7;
}
enum NodeType {
ROOT_SCOPE = 0;
JUMP_TO_SCOPE = 1;
EXPORTED_SCOPE = 2;
DEFINITION = 3;
REFERENCE = 4;
}
enum SyntaxType {
FUNCTION = 0;
METHOD = 1;
CLASS = 2;
MODULE = 3;
CALL = 4;
TYPE = 5;
INTERFACE = 6;
IMPLEMENTATION = 7;
}
func (*Symbol) GetIndexName ¶
Click to show internal directories.
Click to hide internal directories.