Skip to content

v1.0.0

Latest
Compare
Choose a tag to compare
@charlespascoe charlespascoe released this 14 Feb 17:07
· 2 commits to main since this release
v1.0.0

Added

  • Add goto statement highlighting
  • Add folding for interface and declaration blocks
  • Add support for embedded generic types in structs
    • Caveat: The type parameters cannot be spread across multiple lines
  • Add support for type parameter definitions in Godoc
  • Add option to highlight invalid format string indices (e.g. %[0]d).
    Controlled by g:go_highlight_format_string_errors, which is disabled by
    default.

Fixed

  • Properly handle explicit argument indexes for width and precision in string
    format sequences
    • E.g. %0[1]*[2]b and %[1]*d
  • Properly handle unnamed parameters in functions, e.g. func Foo(MyType)
  • Fix chan highlighting in multi return and function type parameters without names
    • E.g. in func Something() (bool, chan int) { ... }, bool and chan
      would be highlighted as though they were return variables of type int,
      and similarly in type Something func(bool, chan int).
  • Fix iota in const declaration blocks.
    • The compromise is that iota is matched in any expression. While not ideal,
      this avoids complex restructuring of the syntax code or performance
      degradation. It may be worth revisiting this at some point.
  • Fix issue with parentheses around slice type not being highlighted correctly.
    • E.g. the first ) in ([]int)(nil) was not highlighted correctly.