Luasnip and Treesitter for Smarter Snippets

TL;DR A context-aware snippet for Go error handling code, returning the right types, with the default values. Demo Snippet EDIT(2024-02-23): TJ DeVries made a video explaining an improved version of this snippet. You may still find the discussion on Go errors in this post interesting. Introduction Golang’s error handling is notoriously verbose. It was also the top pain point in the Go Developer Survey Q2 2022. Numerous proposals to simplify error handling have been written, but at the time of writing, none have been accepted....

August 30, 2023 · 10 min