Changelog History
Page 1
-
v20.06.14 Changes
June 14, 202020.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 makego test
andgo 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
) namedGo Generate
that callsgo 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/asmfmtIt formats
.s
files when they are saved, or the fmt cordctrl+.
,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
andgo.replay
(cordctrl/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 = true
the 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
andgo.replay
(cordctrl/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.
-
v20.03.09 Changes
March 09, 2020๐ 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.
-
v20.03.01 Changes
March 01, 2020๐ This release fixes a margo build failure when upgrading to go1.14.
-
v20.02.01 Changes
February 01, 2020๐ This release focuses on fixing a performance issue due to a failure to resetting all cached data prematurely.
Cache some files in memory to avoid re-reading from disk every time.
๐ The
&nodejs.PackageScripts{}
reducer now usesyarn
instead ofnpm
if theyarn.lock
file is present. -
v20.01.01 Changes
January 01, 2020๐ This release mainly focuses on under-the-hood improvements for module support.
- ๐ฆ The default auto-completion import mode has been changed to
Kim-Porter
, our solution for auto-completion and package/module going forward.
One side-effect of this change is that unimported-packages support is less reliable but we feel this is a small drawback when compared to the much improved auto-completion support.
We plan to remove support for switching import modes in the future, but if you would like to revert to the previous default (bearing in mind auto-completion might stop working), configure the
MarGocodeCtl
reducer as follows:&golang.MarGocodeCtl{ ImporterMode: golang.SrcImporterWithFallback, }
- ๐ The Go/TypeCheck linter is now more complete and should be able to type-check (without failure) all packages for which auto-completion is available.
This linter offers typechecking (like the gotype tool) but can work on unsaved files and while you type and is faster a full
go install
lint.
To enable add the following reducer to your
margo.go
file:&golang.TypeCheck{},
- Some HTTP handler snippets have been added and are offered in files that
import "net/http"
.
- ๐ฆ The default auto-completion import mode has been changed to
-
v19.10.22 Changes
October 22, 2019API BREAKAGE:
๐ ParseWithMode and ParseWithMode now takes a*mg.Ctx
instead of amg.KVStore
.โ Add experimental support for auto-completion and type-checking in go modules.
โ Add experimental reducer
&golang.TypeCheck{}
.
๐ It's a linter that does a full type-check as you type (even in unsaved files).
It can be thought of as a replacement for thegotype
binary of old.๐ฆ NOTE: This is purely an experiment used primarily for testing the package importer
and type-checking and will probably break randomly, if it works at all.With that said, the plan is to clean it up and develop it further in the future.
The Ariana color scheme has been tweaked to improve readability.
โ Add a
โฃ
prefix to status items and reduce the space between them.โ Add langs
mg.GoMod
andmg.GoSum
forgo.mod
andgo.sum
files, respectively.
For convenience,goutil.Langs
now holds the list of all Go-related langs
๐ and Go linters are now available ingo.mod
andgo.sum
.๐ The tasks count styled has been changed to
Tasks โโโ
.
The status animates betweenTasks โโโ
andTasks โโโ
while there are tasks less than 16s old.๐ The issue count styled has been changed to
Error โ๊๐
.โช NOTE: The meanings of the numbers have been reverted.
Previously, given
1/2 Errors
, there was 1 issue with tagError
in this view, and there was a total 2 errors in all views.
The new meaningsError โ๊๐
is: โ is the number issues in the current view and ๐ is the number issues in other views.Only first number is highlighted if there are issues in the current view.
Likewise, when there are issues, but none in the current view, only the second number is highlighted.Don't show the
func
prefix in the calltip status. The parens already make it obviously a function. -
v19.06.16 Changes
June 16, 2019- ๐ Fix a deadlock/freeze (seen on Mac OS) when starting up with multiple windows open.
- ๐ Fix an issue where the active window loses focus when starting up.
-
v18.11.28 Changes
November 28, 2018๐ This release introduces the HUD and comes with many improvements to snippets and a tweaked version of the Mariana color schemed named Ariana.
- The HUD is an output panel that's automatically populated with info traditionally found in the status bar and various pop-ups/tool-tips.
Currently, the following info will be displayed there:
The
Issues
status, including the error messages for the current line.The
GocodeCalltips
status, including positional highlighting of params and return statement.
It's bound to the keys
ctrl+.
,ctrl+0
.You can manually bind it to another key. e.g. via
Preferences > Key Bindings
:{ "keys": ["ctrl+0"], "command": "margo_show_hud", },
Several new snippets have been added and old ones improved.
- AppendSnippet:
name = |
suggests: name = append(name, ...)
slice = append(slice[:len(slice):len(slice)], ...)
- DeferSnippet:
defer func() {}()
defer f()
- ReturnSnippet:
return
- MutexSnippet:
mu.|
suggests: mu.Lock(); defer mu.Unlock(); |
mu.Lock(); |; mu.Unlock()
- PackageNameSnippet:
package main; func main() { | }
- DocSnippet: suggest function names, field names, etc. inside the corresponding documentation comment
- AppendSnippet:
๐ Fix the golang.Gocode{} reducer changing View.Pos
๐ฆ The
(Add)UnimportedPackages
feature no longer adds circular imports๐ฑ Show the tasks animation after 500ms instead of 1s to (hopefully) make things feel more responsive
GOROOT and GOPATH are scanned in parallel at startup
๐ฆ All packages in GOROOT and GOPATH are available for the unimported packages feature, not just those in GOROOT and the package cache.
โ Add better named alias
pkg-list
forunimported-packages
and show the directory where the package isAPI BREAKAGE: Most users should not be affected, but there were some API changes/breakages.
- removed CursorScope.Any and CursorScope.All
- make CursorCtx.Pos the int offset instead of token.Pos
CursorNode
andParseCursorNode
were removedCursorCtx.Ctx
is no longer embedded
-
v18.11.06 Changes
- ๐ Fix
UnimportedPackages
support for stdlib packages in go1.10 and earlier versions.
- ๐ Fix
-
v18.11.04 Changes
- API BREAKAGE: Rename
mg.Reducer.Reducer*
tomg.Reducer.R*
.
Most users should be unaffected. If you've called any of these methods directly, you will need to rename the following method calls:
- ReducerLabel -> RLabel
- ReducerInit -> RInit
- ReducerConfig -> RConfig
- ReducerCond -> RCond
- ReducerMount -> RMount
- Reducerduce -> Rduce
ReducerUnmount -> RUnmount
- API BREAKAGE: mg.RunCmdData has been un-exported
- The following fields in the
&golang.GoCode{}
and&golang.GocodeCalltips{}
reducers are now ignored.
Source: this is now the default
ProposeBuiltins: this is now the default
ProposeTests: use
&golang.MarGocodeCtl{}
Autobuild: we now use the source code so there are no plans to implement this
UnimportedPackages: this is now the default
See
&golang.MarGocodeCtl{}
(below).โ Add support for 'unimported' packages.
- auto-completing
json.
will now try to importencoding/json
- known bugs: when adding the import, the view will scroll
- known limitation: we don't scan GOPATH and we don't support the vendor directory
- auto-completing
Use
NoUnimportedPackages
(below) to disable this.โ Add support for preloading imported packages when a view is activated.
- This aims to keep the cache warm to speed up auto-completion.
Use
NoPreloading
(below) to disable this.โ Add support for adding
unimported
packages to the file.- Use
AddUnimportedPackages
(below) to enabled this
- Use
๐ง All the above can be configured using the
&golang.MarGocodeCtl{}
reducer
&golang.MarGocodeCtl{ // whether or not to include Test*, Benchmark* and Example* functions in the auto-completion list // gs: this replaces the `autocomplete_tests` setting ProposeTests: false, // Don't try to automatically import packages when auto-compeltion fails // e.g. when `json.` is typed, if auto-complete fails // "encoding/json" is imported and auto-complete attempted on that package instead // See AddUnimportedPackages NoUnimportedPackages: false, // If a package was imported internally for use in auto-completion, // insert it in the source code // See NoUnimportedPackages // e.g. after `json.` is typed, `import "encoding/json"` added to the code AddUnimportedPackages: false, // Don't preload packages to speed up auto-completion, etc. NoPreloading: false, // Don't suggest builtin types and functions // gs: this replaces the `autocomplete_builtins` setting NoBuiltins: false, },
โ Add new lang conststants for
mg.JSX
,mg.TS
,mg.TSX
and renameR
toRlang
Don't treat an empty non-nil slice as matching in
LangIs()
andActionIs()
๐ Fix an infinite loop when auto-completing inside packages with cyclic dependencies
- API BREAKAGE: Rename