Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides semantic Go code navigation, refactoring, and diagnostics through the gopls language server's MCP tools, LSP tool, or CLI.
70% 87%+17 ptsof test cases passed
Passed 20 of 23 test cases with the skill, and 16 of 23 without it.
3 of 3 safety checks passed
Not used yet
Source: tip.golang.org/gopls/features. Each entry names the LSP request or CodeAction kind so a specific behavior can be looked up in the upstream docs by exact term.
Definition (textDocument/definition, CLI gopls definition) — jumps to a symbol's declaration. Handles more than plain identifiers: on an import path it lists the imported package's declarations; on a go:linkname directive it finds the linked symbol; on a go:embed pattern it finds the embedded file; on a doc-comment link it follows the reference; on a non-Go function it can return the assembly implementation; on return it locates the named result variables; on goto/break/continue it finds the target label or block. Already at the declaration → most clients reinterpret the request as "find references" instead.
Type Definition (textDocument/typeDefinition, no CLI equivalent) — jumps to the named type underlying a symbol, unwrapping pointer, array, slice, channel, and map constructors first. For x chan []*T, this reports the definition of T. Only works on symbols, not arbitrary expressions. No agent-invocable path: it is absent from the native LSP tool's fixed operation list (goToDefinition, findReferences, hover, documentSymbol, workspaceSymbol, goToImplementation, call hierarchy), so only a full editor LSP client can reach it.
References (textDocument/references, CLI gopls references) — lists every use of a symbol. For an interface method, this includes concrete implementations; for a package declaration, it includes both direct imports and other files' package clauses; for an embedded field, it reports only field references (use Type Definition to find references to the type itself). Scoping gotcha: results reflect only the build configuration of the queried file — a query issued against foo_windows.go will not surface a match in bar_linux.go. Built-in symbols (int, append) are rejected as too numerous to be useful.
Implementation (textDocument/implementation, CLI gopls implementation) — on an interface, returns concrete implementations and sub-interfaces; on a concrete type, returns interfaces it satisfies; on an interface method, returns the concrete methods satisfying it, and vice versa. Matching uses method sets for types and signatures for functions. Generic types are treated as wildcards: a candidate is included if any instantiation would allow one to implement the other, without full unification checking. LSP's built-in bias toward subtypes makes this query directionally asymmetric — for full bidirectional traversal, use Type Hierarchy instead.
Document Symbol (textDocument/documentSymbol, CLI gopls symbols) — outline of a single file's top-level declarations. File-scoped; use Symbol for cross-file search.
Symbol / Workspace Symbol (workspace/symbol, CLI gopls workspace_symbol) — fuzzy search across the whole workspace. Default matcher is fastFuzzy (FZF-inspired), so abbreviations and typos still match — DocSym matches DocumentSymbol. Controlled by the symbolMatcher, symbolStyle, and symbolScope settings (see settings.md); directoryFilters excludes directories from the search.
Selection Range (textDocument/selectionRange, no CLI equivalent) — expands or contracts the current selection along syntactic boundaries (expression → statement → block → function). Useful for selecting exactly the region an Extract refactor needs.
Call Hierarchy (textDocument/prepareCallHierarchy + callHierarchyItem/incomingCalls/outgoingCalls, CLI gopls call_hierarchy) — shows a function's callers and callees as a static graph. Only static calls are included — calls made through a function value or an interface method are invisible, since detecting them isn't analytically tractable. Corroborate with References when a dynamically-dispatched call site matters. Invoke on the function declaration's name.
Type Hierarchy (textDocument/prepareTypeHierarchy + typeHierarchyItem/subtypes/typeHierarchy/supertypes, no CLI equivalent yet) — bidirectional view of the subtyping relation: which types implement an interface, and which interfaces a type satisfies. Resolves the asymmetry Implementation has. Limited to named types (unlike Implementation, which also matches unnamed function types); alias types are excluded; function-local types are visible only within the same package.
These need no explicit invocation — they fire continuously as an editor session progresses. Most degrade if the surrounding package has build errors, since they depend on successful type-checking.
Hover (textDocument/hover) — symbol name/kind/type/value, doc comment (with clickable doc links like [fmt.Printf]), promoted methods from embedded fields, struct field size/offset and wasted-space percentage (flagged at ≥20% waste), expanded //go:embed patterns, //go:linkname targets, and which Go release introduced a given stdlib symbol. Controlled by hoverKind (verbosity) and linkTarget (base URI for doc links).
Next to this one in the catalogue, plus more from the same author.