Slide 21
Slide 21 text
Souzoh confidential and proprietary
// Completion implements symbol.ClangServer Completion interface.
func (s *server) Completion(ctx context.Context, loc *symbol.SymbolLocation) (*flatbuffers.Builder,
error) {
f := string(loc.FileName())
if s.filename != f {
.
.
.
file := symbol.GetRootAsFile(buf, 0) // デシリアライズ。`buf` はDBから取ってきた[]byte
if cErr := s.idx.ParseTranslationUnit2(file.Name(), file.Flags(), nil,
uint32(clang.TranslationUnit_KeepGoing), &s.tu); clang.ErrorCode(cErr) != clang.Error_Success {
log.Fatal(cErr)
}
}
codeCompleteResults := new(symbol.CodeCompleteResults)
.
flatbuffers Go コードサンプル
21