symbol

package
v0.0.0-...-53d1009 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2017 License: BSD-3-Clause Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLocation

func CreateLocation(filename string, line, col uint32) *flatbuffers.Builder

CreateLocation creates location data using flatbuffers binary.

func NewClangClient

func NewClangClient(cc *grpc.ClientConn) symbol.ClangClient

NewClangClient retern the new symbol.ClangClient.

func RegisterClangServer

func RegisterClangServer(s *grpc.Server, srv symbol.ClangServer)

RegisterClangServer register a service and its implementation to the gRPC server.

Types

type Caller

type Caller struct {
	// contains filtered or unexported fields
}

Caller represents a location of caller function.

table Caller {
  Location: Location (required);
  FuncCall: bool = false; // -> byte
}

func (*Caller) FuncCall

func (c *Caller) FuncCall() bool

FuncCall reports whether caller is function call.

func (*Caller) Location

func (c *Caller) Location() Location

Location return the location of caller function.

type CodeCompleteResults

type CodeCompleteResults struct {
	// contains filtered or unexported fields
}

CodeCompleteResults represents a list of vim complete-items dictionary.

table CodeCompleteResults {
  Results: [CompleteItem];
}

func NewCodeCompleteResults

func NewCodeCompleteResults(v *symbol.CodeCompleteResults) *CodeCompleteResults

NewCodeCompleteResults returns the flatbuffers binary of CodeCompleteResults.

func (*CodeCompleteResults) Marshal

Marshal returns the flatbuffers binary encoding of clang.CodeCompleteResults v.

func (*CodeCompleteResults) Results

func (c *CodeCompleteResults) Results() []CompleteItem

Results return the slice of CompleteItem.

type CompleteItem

type CompleteItem struct {
	// contains filtered or unexported fields
}

CompleteItem represents a vim complete-items dictionary.

table CompleteItem {
  Word: string (required); // -> []byte
  Abbr: string; // -> []byte
  Menu: string; // -> []byte
  Info: string; // -> []byte
  Kind: string; // -> []byte
  Icase: bool; // -> byte
  Dup: bool; // -> byte
}

func (*CompleteItem) Abbr

func (c *CompleteItem) Abbr() string

Abbr return the abbreviation of "word", when not empty it is used in the menu instead of "word".

func (*CompleteItem) Dup

func (c *CompleteItem) Dup() bool

Dup return the when non-zero this match will be added even when an item with the same word is already present.

func (*CompleteItem) Icase

func (c *CompleteItem) Icase() bool

Icase return the more information about the item, can be displayed in a preview window.

func (*CompleteItem) Info

func (c *CompleteItem) Info() string

Info return the more information about the item, can be displayed in a preview window.

func (*CompleteItem) Kind

func (c *CompleteItem) Kind() string

Kind return the single letter indicating the type of completion.

func (*CompleteItem) Marshal

Marshal returns the flatbuffers binary encoding of cs.

func (*CompleteItem) Menu

func (c *CompleteItem) Menu() string

Menu return the extra text for the popup menu, displayed after "word" or "abbr".

func (*CompleteItem) Word

func (c *CompleteItem) Word() string

Word return the text that will inserted, mandatory.

type File

type File struct {
	// contains filtered or unexported fields
}

File represents a C/C++ source file.

table File {
  Name: string;
  TranslationUnit: string;
  Symbols: [Info];
  Headers: [Header];
  Includes: [string];
}

func GetRootAsFile

func GetRootAsFile(buf []byte, offset flatbuffers.UOffsetT) *File

GetRootAsFile gets the root of flatbuffers binary.

func NewFile

func NewFile(name string, flags []string) *File

NewFile return the new File.

func (*File) AddCaller

func (f *File) AddCaller(sym, def Location, funcCall bool)

AddCaller add caller data into File.

func (*File) AddDecl

func (f *File) AddDecl(loc Location)

AddDecl add decl data into File.

func (*File) AddDefinition

func (f *File) AddDefinition(loc, def Location)

AddDefinition add definition data into File.

func (*File) AddHeader

func (f *File) AddHeader(includePath string, headerFile clang.File)

AddHeader add header data into File.

func (*File) AddTranslationUnit

func (f *File) AddTranslationUnit(buf []byte)

AddTranslationUnit add TranslationUnit data to File.

func (*File) Flags

func (f *File) Flags() []string

Flags return the compiler flags.

func (*File) Headers

func (f *File) Headers() []*Header

Headers return the C/C++ files included header files.

func (*File) Name

func (f *File) Name() string

Name return the filename.

func (*File) Serialize

func (f *File) Serialize() *flatbuffers.Builder

Serialize serializes the File.

func (*File) Symbols

func (f *File) Symbols() []*Info

Symbols return the C/C++ files symbols.

func (*File) TranslationUnit

func (f *File) TranslationUnit() []byte

TranslationUnit return the libclang translation unit data.

func (*File) Unmarshal

func (f *File) Unmarshal()

Unmarshal parses the flatbuffers representation in f.

type FileID

type FileID [blake2b.Size]byte

FileID id of filename with blake2b hash.

func ToFileID

func ToFileID(s string) FileID

ToFileID converts the string to blake2b sum512 hash.

func (FileID) Bytes

func (id FileID) Bytes() []byte

Bytes reterun the FileID byte slice.

func (FileID) IsEmpty

func (id FileID) IsEmpty() bool

IsEmpty reports whether id is empty.

func (FileID) String

func (id FileID) String() string
type Header struct {
	// contains filtered or unexported fields
}

Header represents a location of include header file.

table Header {
  FileID: string (id: 0, required, key); // -> []byte
  Mtime: long (id: 1); // time.Time.Unix(): int64
}

func (*Header) FileID

func (h *Header) FileID() FileID

FileID return the header FileID.

func (*Header) Mtime

func (h *Header) Mtime() int64

Mtime return the header modified time.

type ID

type ID [blake2b.Size]byte

ID id of cursor.USR with blake2b hash.

func ToID

func ToID(s string) ID

ToID converts the string to blake2b sum512 hash.

func (ID) Bytes

func (id ID) Bytes() []byte

Bytes reterun the ID byte slice.

func (ID) IsEmpty

func (id ID) IsEmpty() bool

IsEmpty reports whether id is empty.

func (ID) String

func (id ID) String() string

type Info

type Info struct {
	// contains filtered or unexported fields
}

Info represents a location of C/C++ cursor symbol information.

table Info {
  ID: string;
  Decls: [Location];
  Def: Location;
}

func (*Info) Callers

func (info *Info) Callers() []*Caller

Callers return the symbol callers information.

func (*Info) Decls

func (info *Info) Decls() []Location

Decls return the symbol declarations information.

func (*Info) Def

func (info *Info) Def() Location

Def return the symbol definition information.

func (*Info) ID

func (info *Info) ID() ID

ID return the symbol ID which hashed blake2b.

type Location

type Location struct {
	// contains filtered or unexported fields
}

Location location of symbol. TODO(zchee): method receiver is pointer for location?

table Location {
  FileName: string;
  Line: uint;
  Col: uint = 0;
  Offset: uint;
  USR: string;
}

func FromCursor

func FromCursor(cursor clang.Cursor) Location

FromCursor return the location of symbol from cursor.

func (*Location) Col

func (l *Location) Col() uint32

Col return the column number of symbol location.

func (*Location) FileName

func (l *Location) FileName() string

FileName return the filename of location.

func (*Location) Line

func (l *Location) Line() uint32

Line return the line number of symbol location.

func (*Location) Offset

func (l *Location) Offset() uint32

Offset return the byte offset of symbol location.

func (*Location) USR

func (l *Location) USR() string

USR return the Unified Symbol Resolution of symbol.

type SymbolCaller

type SymbolCaller = symbol.Caller

SymbolCaller type alias of symbol.Caller.

type SymbolCodeCompleteResults

type SymbolCodeCompleteResults = symbol.CodeCompleteResults

SymbolCodeCompleteResults type alias of symbol.CodeCompleteResults.

type SymbolCompleteItem

type SymbolCompleteItem = symbol.CompleteItem

SymbolCompleteItem type alias of symbol.CompleteItem.

type SymbolFile

type SymbolFile = symbol.File

SymbolFile type alias of symbol.File.

type SymbolHeader

type SymbolHeader = symbol.Header

SymbolHeader type alias of symbol.Header.

type SymbolInfo

type SymbolInfo = symbol.Info

SymbolInfo type alias of symbol.Info.

type SymbolLocation

type SymbolLocation = symbol.Location

SymbolLocation type alias of symbol.Location.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL