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

Go, pls stop breaking my editor – Rebecca Stambler

Go, pls stop breaking my editor – Rebecca Stambler

GopherCon Russia

April 13, 2019
Tweet

More Decks by GopherCon Russia

Other Decks in Programming

Transcript

  1. Go,

  2. My editor isn’t working! • There are many different editors

    and many different features • Many features are slow
  3. My editor isn’t working! • There are many different editors

    and many different features • Many features are slow • New Go releases break features
  4. godef gopkgs go-outline go-symbols VSCode guru gorename gomodifytags goplay impl

    gotype-live gocode gogetdoc goimports goreturns goformat golint Go extension
  5. godef gopkgs go-outline go-symbols VSCode guru gorename gomodifytags goplay impl

    gotype-live gocode gogetdoc goimports goreturns goformat golint gotests gometalinter staticcheck golangci-lint revive fillstruct dlv godoctor Go extension
  6. godef gopkgs go-outline go-symbols guru gorename gomodifytags goplay impl gotype-live

    gocode gogetdoc goimports goreturns goformat golint gotests gometalinter staticcheck golangci-lint revive fillstruct dlv godoctor
  7. My editor isn’t working! • There are many different editors

    and many different features • Many features are slow
  8. Command-line tools • Most of these tools work on 1

    request per process • The tool has to parse your file and type-check your dependencies EVERY TIME!
  9. My editor isn’t working! • There are many different editors

    and many different features • Many features are slow • New Go releases break features
  10. An example: gocode • A tool for autocompletion • Go

    1.10 broke nsf/gocode • Fixed in mdempsky/gocode
  11. An example: gocode • A tool for autocompletion • Go

    1.10 broke nsf/gocode • Fixed in mdempsky/gocode • And then...Go modules
  12. An example: gocode • A tool for autocompletion • Go

    1.10 broke nsf/gocode • Fixed in mdempsky/gocode • And then...Go modules • Resulting in stamblerre/gocode
  13. Takeaways • At this rate, we will have a version

    of gocode for every version of Go
  14. Takeaways • At this rate, we will have a version

    of gocode for every version of Go • Your tools shouldn’t break when you upgrade
  15. Why did gocode keep breaking? • When Go changes, tools

    change • When go build changes, tools change more
  16. Why did gocode keep breaking? • When Go changes, tools

    change • When go build changes, tools change more • Tools copy the behavior of the Go compiler
  17. How will we fix your editor? 1. Stop tools from

    breaking every 6 months 2. Support a set of features for all editors
  18. go/packages • Reduces the maintenance burden • When a new

    Go release comes out, fix the driver, not the tools
  19. How will we fix your editor? 1. Stop tools from

    breaking every 6 months 2. Support a set of features for all editors
  20. godef gopkgs go-outline go-symbols guru gorename gomodifytags goplay impl gotype-live

    gocode gogetdoc goimports goreturns goformat golint gotests gometalinter staticcheck golangci-lint revive fillstruct dlv godoctor
  21. gopls • The Go language server • Owned and maintained

    by the Go team and community • Currently in alpha
  22. gopls • The Go language server • Owned and maintained

    by the Go team and community • Currently in alpha • Pronounced “Go please”
  23. gopls is faster • All features benefit from caching •

    Completion is noticeably faster (less than 1 ms)
  24. gopls is faster • All features benefit from caching •

    Completion is noticeably faster (less than 1 ms) • Remains fast with modules
  25. gopls is extensible • Adding new features is easier •

    Planned: ◦ References, rename ◦ More diagnostics (lint, custom, etc.)
  26. gopls is extensible • Adding new features is easier •

    Planned: ◦ References, rename ◦ More diagnostics (lint, custom, etc.) ◦ Quick fix suggestions
  27. Thank you • Go team members ◦ Ian Cottrell ◦

    Peter Weinberger ◦ Michael Matloob • Go community members ◦ Paul Jolly ◦ Ramya Rao ◦ Billie Cleek ◦ And many more!
  28. Image credits • Gopher image by Ashley McNamara • Fire

    extinguisher image via strikefirstusa.com • Icons via flaticon.com, made by Freepik