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. What is Internship at Merpay Expert Team? Introduction

  5. 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.
  6. My Output: Protocol Buffers Language Server Language Server for Protocol

    Buffers Almost nothing ever.
  7. What is Language Server Protocol?

  8. 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.
  9. Without LSP https://github.com/gophercon/2019-talks/blob/master/RebeccaStambler-GoPleaseStopBreakingMyEditor/slides.pdf

  10. With LSP https://code.visualstudio.com/api/language-extensions/language-server-extension-guide

  11. Implementations https://microsoft.github.io/language-server-protocol/implementors/servers

  12. Implementations https://microsoft.github.io/language-server-protocol/implementors/servers No Language Server for Protocol Buffers!

  13. What is Protocol Buffers?

  14. 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.
  15. Protocol Buffers https://www.youtube.com/watch?v=AW09fAsEb00

  16. What is Protocol Buffers Language Server? micnncim/protocol-buffers-language-server ↓ In progress...

  17. None
  18. Protocol Buffers Language Server Definition Supports `textDocument/definition`. Completion Supports `textDocument/completion`

    Text Sync Supports `textDocument/didOpen` `textDocument/didChange` `textDocument/didSave`
  19. 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
  20. 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
  21. https://github.com/gophercon/2019-talks/blob/master/RebeccaStambler-GoPleaseStopBreakingMyEditor/slides.pdf Implement All! Hard points

  22. 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
  23. THANK YOU! Twitter: @micnncim GitHub: @micnncim My Gophers from GopherCon

    and Go Conference Tokyo