GoSublime v20.06.14 Release Notes

Release Date: 2020-06-14 // almost 4 years ago
  • 20.06.14

    ๐Ÿš€ This release contains a number of features and bug fixes that have been worked on over the last few months.

    You will need to restart Sublime Text for all changes to take effect

    โž• Add new GoCmd{} option Humanize to make go test and go re/play (in test mdoe) output more readable (using https://github.com/dustin/go-humanize).

    • large numbers are split up using commas
    • 123456 ns/op is converted to ยตs/op, etc.
    • 123456 B/op is converted to KiB/op, etc.

    To enabled it, use:

    &golang.GoCmd{
        Humanize: true,
    }
    

    e.g. output:

    goos: linux
    goarch: amd64
    pkg: margo.sh/vfs
    BenchmarkPoke/Miss-8 388,868 2.952 ยตs/op
    BenchmarkPoke/Hit-8 1,739,704 684 ns/op
    PASS
    

    Known bugs:

    - The output fields are not aligned

    โž• Add new reducer golang.GoGenerate

    ๐Ÿ“ฆ It adds a UserCmd (cord ctrl/cmd+.,ctrl/cmd+.c) named Go Generate that calls go generate in the closest go package (current dir or parent dirs).

    It can be enabled with:

    &golang.GoGenerate{
        Args: []string{"-v", "-x"},
    },
    

    Auto-completion now works when the line ends with a dot (.)

    โž• Add new reducer golang.AsmFmt

    It does code fmt'ing for .s files using https://github.com/klauspost/asmfmt

    It formats .s files when they are saved, or the fmt cord ctrl+.,ctrl.f is pressed.

    โž• Add new reducer &web.Prettier{}

    It does code fmt'ing using https://github.com/prettier/prettier
    0๏ธโƒฃ By default It fmt's CSS, HTML, JS, JSON, JSX, SVG, TS, TSX and XML files.

    To specify the list of langs to fmt set the Langs field:

    &web.Prettier{
        // Langs: []mg.Lang{mg.JS}, // only fmt .js files
        Langs: web.PrettierDefaultLangs,
    },
    

    ๐ŸŒ You might also need to import "margo.sh/web".

    You will need to install prettier separately.

    โž• Add new Lang constants: mg.HTML, mg.SVG and mg.XML

    โž• Add mgutil.SplitWriter a writer that writes to an underlying writer in split chunks e.g. lines somewhat similar to bufio.scanner

    โœ… go.play and go.replay (cord ctrl/cmd+.,ctrl/cmd+r) now works in in unsaved _test.go files.

    go.replay now runs the Benchmark* func surrounding the cursor.

    โœ… Compared to ctrl/cmd+shift+left-click, it also runs tests.

    Known bugs:

    - It currently ignores the TestArgs and BenchmarkArgs options of the golang.TestCmds reducer.

    ๐Ÿ‘ mg.CmdCtx supports a new option Verbose,

    ๐Ÿ–จ When cx.Verbose = truethe commands that are run are printed to the output prefixed with #.

    e.g. output:

    [`replay` | done]
    # go test -test.run=. -test.bench=^BenchmarkPoke$
    goos: linux
    [...]
    

    It's enabled for go.play and go.replay (cord ctrl/cmd+.,ctrl/cmd+r).

    0๏ธโƒฃ Issues without a valid tag are now defaulted to mg.Error instead of being ignored.

    ๐Ÿ›  This fixes some cases where the error palette shows errors, but the status and HUD doesn't.

    ๐Ÿ›  Fix some cases where issues are reported in the wrong file or incorrectly anchored to the current file.

    goutil.IsPkgDir() and other functions now use the VFS, so should touch the disk less.


Previous changes from v20.03.09

  • ๐Ÿš€ This release fixes a couple bugs:

    • ๐Ÿ— GO111MODULE=off is set after building, in cases where GO111MODULE wasn't already set by the user.
    • โšก๏ธ An update message is shown even when the local GoSublime version is greater than that reported by the server.