Tooltitude is a productivity extension for the Go programming language. It helps you write better code faster. The extension is being actively developed so stay tuned for new features (Twitter is the best place to do so https://twitter.com/tooltitude).
CodeLens providers
We have CodeLens providers which help you navigate code and see what's going on in the code base
We also have a CodeLens provider to generate method stubs for interface implementation. Just click on the "Implement..." text at the top of the type declaration.
Inspections
Inspections look into your code and find potential problems. For example, we have deprecated symbols inspections, and shadowed symbols inspections.
Code Actions
We have more than 20 code actions (and counting). To use code action, put a caret on an applicable code element. If there're code actions, a light bulb icon will apear. You could click on it with a mouse, press Ctrl+. (on Windows and Linux) or Cmd+. (on Mac). The menu will appear where you choose actions. Actions from this extension have (tt) market on the right to distinguish them from code actions from other extensions.
Handle Error
Feature list
- CodeLens providers
- Reference counts for functions, method, structs, interfaces, struct fields, and interface methods
- Implementation counts for interfaces and interface methods
- Implemented interfaces counts for types
- Implemented interface mehtods counts for methods
- Implement interface
- Run or debug main packages
- Debug table driven tests
- Inspections
- Unused assignments/initializations
- Unreachable code
- Unhandled errors
- Variable shadows
- Deprecated symbols (only if vscode-go isn't installed)
- Postfix completions
- postfix completion for string function in strings and strconv packages, i.e. you could write "abc".ToLower and transform it to strings.ToLower("abc)
- postfix completion for float64, and math package
- postfix completion for rune and unciode, and strconv packages
- .if for "if expr {}"
- .ifn for "if !expr {}"
- .ifnil for "if expr == nil {}"
- .ifnnil for "if expr != nil {}"
- .parens for "(expr)"
- .func for "func(expr)" where func is print, println, panic, len, cap, close, new, delete, append or make
- .for for "for expr {}"
- .for_range for automatic filling of range variables
- .switch for "switch expr {}"
- .return for "return expr"
- .defer for "defer expr"
- .& for &expr
- .! for !expr
- .* for *expr
- .<- for <-expr
- .var for "var id = expr"
- .const for "const id = expr"
- .= for "id = expr"
- .:= for "id := expr"
- Code Actions
- Handle error (with panic, return err, wrapped error)
- Extract variable
- Inline variable
- Apply De Morgan Laws
- Merge String Literals
- Flip comma
- Remove unreachable statement
- Remove unused assignment
- Convert unused initialization to var
- Invert if conditions
- Convert else { if { to else if {
- Unwrap else code action (return in the if-true block)
- Iterate over collection
- Convert raw string <-> string literal
- Convert separated decimal literal <-> non separated decimal literal (i.e. 1000000 <-> 1_000_000)
- Add/remove octal prefix in octal literals (i.e. 0100 <-> 0o100)
- Convert defer to "multiline" defer (via closure)
- Add else to if
- Add channel receive result to assignment
- Remove redundant parenthesis
- Convert interface {} to any
- Convert assignment to unresovled variable to short var decl
- Flip binary operation, i.e. a + b -> b + a and a > b to b < a
- Convert x += a to x = x + a and back, as well as with other operations
- Anonymous func single line to/from multiline func
- Add var type
- Rune literal to/from string literal
- Var to/from short var declaration
- Split field
- Merge imports
- Remove unused initialization
- Remove unused write
- Generate getter/setter
- Generate stub interface for a type
Data
We collect anonymous usage data in order to improve the extension. To opt-out of data collections, turn off application-wide telemetry setting in VS Code as directed by the VS Code documentation before installing the extension, or at any time after the installation: https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting Our extension respects this global setting as directed by extension guidelines published by Microsoft.
Support Resources
Other Links