Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Protocol Buffers Language Server

September 13, 2019

Protocol Buffers Language Server

Mercari Summer Internship for Engineer 2019


September 13, 2019

More Decks by micnncim

Other Decks in Programming


  1. @ m i c n n c i m Protocol

    Buffers Language Server Mercari Summer Internship for Engineer 2019
  2. TABLE OF CONTENTS About Me What is Internship at Merpay

    Expert Team? What is Language Server Protocol? What is Protocol Buffers? What is Protocol Buffers Language Server? Future Work
  3. ABOUT ME @micnncim Team: Merpay Expert Team Twitter: @micnncim GitHub:

    @micnncim Interest: Go, Cloud Native, DevOps Blog: micnncim.github.io
  4. Internship at Merpay Expert Team 1 Go Anything written by

    Go. 2 OSS Anything related to OSS. Contributions to OSS or/and OSS from scratch.
  5. Language Server Protocol 1 Language Server Language-specific smarts inside a

    server. Communicate with client in editor / IDE. 2 Protocol A single Language Server can be re-used in multiple development tool. 3 Communication Development tools communicate with server over JSON-RPC.
  6. Protocol Buffers IDL Defines structure once, then you can use

    generated code by multiple languages. Serializer Serializes binary based data. Faster than JSON, etc. Pluggable Design Uses plugins like `protoc-gen-<plugin>` to be extensible.
  7. Protocol Buffers Language Server Definition Supports `textDocument/definition`. Completion Supports `textDocument/completion`

    Text Sync Supports `textDocument/didOpen` `textDocument/didChange` `textDocument/didSave`
  8. How to implement? Parse code All parsers of protobuf written

    by Go are incomplete so it's so hard to get desirable info. Follow Protocol LSP gives protocol of >50 methods for language features Run with JSON-RPC Implement communication with JSON-RPC
  9. Hard points All of language features e.g.) godef, gopkgs, gocode,

    guru, gorename, goimports, dlv, goformat, golint, ... Text Synchronization Manages files and status of files in many workplaces: Open, Change, Save
  10. Implement Other Functions textDocument/hover textDocument/publishDia gnostics textDocument/rename etc. Release Packages

    Homebrew Linuxbrew Snap etc. Improve Performance go-language-server/protocol go-language-server/jsonrpc2 Future Work