# nsf/gocode

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/nsf-gocode).**

4,993 stars · 654 forks · Go · MIT

## Links

- GitHub: https://github.com/nsf/gocode
- awesome-repositories: https://awesome-repositories.com/repository/nsf-gocode.md

## Description

gocode is a language server backend and autocompletion daemon for the Go language. It functions as a static code analyzer and symbol indexer that provides real-time identifier and symbol suggestions to text editors.

The project utilizes a client-server daemon architecture to maintain a persistent background process, avoiding the overhead of reloading package metadata for every request. It employs a two-tier metadata caching system and parses compiled package binaries to enable fast symbol lookups and declaration retrieval.

The system covers broad capability areas including context-sensitive autocompletion for member fields, function signatures, and variables, as well as automatic code formatting. It manages lexical scope tracking and recursive symbol resolution to ensure accurate type and variable completions.

Administrative utilities allow for daemon configuration management, state control, and a debugging mode with detailed logging to monitor the background process.

## Tags

### Development Tools & Productivity

- [Language Server Backends](https://awesome-repositories.com/f/development-tools-productivity/language-server-backends.md) — Implements a daemon that manages code analysis and formatting for various programming environments.
- [Code Completion](https://awesome-repositories.com/f/development-tools-productivity/code-completion.md) — Analyzes source code and binary data to suggest appropriate completions for identifiers and declarations. ([source](https://github.com/nsf/gocode/blob/master/package_ibin.go))
- [Go Code Completers](https://awesome-repositories.com/f/development-tools-productivity/code-completion/go-code-completers.md) — Gopls analyzes source code to suggest relevant identifiers and types to accelerate the development process. ([source](https://github.com/nsf/gocode/blob/master/type_alias_build_hack_19.go))
- [Symbolic Resolution](https://awesome-repositories.com/f/development-tools-productivity/dynamic-variable-evaluators/scope-resolution-rules/symbolic-resolution.md) — Traverses nested lexical levels and package imports to map identifiers to their original declarations.
- [Lexical Scope Tracking](https://awesome-repositories.com/f/development-tools-productivity/dynamic-variable-evaluators/scope-resolution-rules/symbolic-resolution/lexical-scope-tracking.md) — Analyzes nested block levels and declaration visibility to resolve identifiers and maintain correct naming contexts.
- [Language Server Integrations](https://awesome-repositories.com/f/development-tools-productivity/language-server-integrations.md) — Implements the Language Server Protocol to provide IDE-agnostic code intelligence and formatting data.
- [Variable and Type Completions](https://awesome-repositories.com/f/development-tools-productivity/variable-and-type-completions.md) — Gopls analyzes source code to suggest variable names, functions, and types as a developer types in an editor. ([source](https://github.com/nsf/gocode/blob/master/README.md))
- [Autocompletion Engines](https://awesome-repositories.com/f/development-tools-productivity/vim-plugins/go-language-plugins/autocompletion-engines.md) — Delivers real-time suggestions for variables, functions, and types while writing Go code.
- [Code Formatting Tools](https://awesome-repositories.com/f/development-tools-productivity/code-quality-analysis/static-analysis-engines/static-analysis-tools/code-formatting-tools.md) — Provides automated source code formatting to ensure a consistent coding style upon saving documents. ([source](https://github.com/nsf/gocode/tree/master/subl3))
- [Package Caches](https://awesome-repositories.com/f/development-tools-productivity/package-caches.md) — Stores parsed exported declarations from package archives to enable high-performance symbol lookups. ([source](https://github.com/nsf/gocode/blob/master/package.go))
- [Signature and Snippet Completion](https://awesome-repositories.com/f/development-tools-productivity/signature-and-snippet-completion.md) — Suggests function signatures, return types, and argument snippets to accelerate the writing process. ([source](https://github.com/nsf/gocode/blob/master/os_posix.go))
- [Symbol Indexing](https://awesome-repositories.com/f/development-tools-productivity/symbol-indexing.md) — Parses and caches exported declarations from Go package archives to enable fast symbol lookups.

### Software Engineering & Architecture

- [Language Server Daemons](https://awesome-repositories.com/f/software-engineering-architecture/client-server-architecture/language-server-daemons.md) — Maintains a persistent background process to avoid the overhead of reloading package metadata for every completion request.
- [Static Code Analyzers](https://awesome-repositories.com/f/software-engineering-architecture/static-code-analyzers.md) — Tracks lexical scopes and resolves package imports to ensure accurate type and variable completions.
- [Code Completion Member Listers](https://awesome-repositories.com/f/software-engineering-architecture/exception-detail-accessors/variable-introspection/object-member-listing/code-completion-member-listers.md) — Suggests language identifiers and symbols automatically as a user accesses member fields of an object. ([source](https://github.com/nsf/gocode/blob/master/gocode.go))
- [Parser Scope Isolation](https://awesome-repositories.com/f/software-engineering-architecture/execution-control/namespace-isolation/module-isolation/architecture-isolation/logic-isolation/parser-scope-isolation.md) — Separates functions containing the cursor from the rest of the source code to prevent parser errors. ([source](https://github.com/nsf/gocode/blob/master/ripper.go))

### Data & Databases

- [Contextual Code Understanders](https://awesome-repositories.com/f/data-databases/semantic-search/code-search/contextual-code-understanders.md) — Parses source code around the cursor to identify types and expressions for providing accurate completion suggestions. ([source](https://github.com/nsf/gocode/blob/master/cursorcontext.go))
- [Declaration Caches](https://awesome-repositories.com/f/data-databases/filesystem-cache-stores/file-lookup-caches/declaration-caches.md) — Caches parsed source files and top-level declarations to speed up code completion lookups. ([source](https://github.com/nsf/gocode/blob/master/declcache.go))
- [Two-Tier Metadata Caching](https://awesome-repositories.com/f/data-databases/in-memory-caches/metadata-caches/two-tier-metadata-caching.md) — Stores parsed source declarations and binary package data in local memory for fast symbol lookups.
- [Compiled Code Indexing](https://awesome-repositories.com/f/data-databases/search-indexing/compiled-code-indexing.md) — Reads binary export data from compiled packages to extract type and declaration information. ([source](https://github.com/nsf/gocode/blob/master/package_bin.go))

### Programming Languages & Runtimes

- [Binary Parsing](https://awesome-repositories.com/f/programming-languages-runtimes/binary-parsing.md) — Reads compiled Go object files to extract type and symbol information without requiring a full source analysis.
- [Go Development Tooling](https://awesome-repositories.com/f/programming-languages-runtimes/go-development-tooling.md) — Provides background services that analyze Go source code and compiled binaries to accelerate development.
- [Symbol Scope Tracking](https://awesome-repositories.com/f/programming-languages-runtimes/symbol-scope-tracking.md) — Tracks declarations across nested lexical levels to resolve names and maintain visibility rules for code completion. ([source](https://github.com/nsf/gocode/blob/master/scope.go))
- [Partial Source Isolation](https://awesome-repositories.com/f/programming-languages-runtimes/partial-source-isolation.md) — Extracts fragments of source code around the cursor to bypass parser errors in incomplete files.

### Security & Cryptography

- [Autocompletion Daemons](https://awesome-repositories.com/f/security-cryptography/source-code-vulnerability-scanning/go-source-code-analyzers/autocompletion-daemons.md) — Operates as a background process analyzing Go source and binaries to provide real-time symbol suggestions.

### Testing & Quality Assurance

- [Static Analysis](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/static-analysis.md) — Uses static analysis of package metadata and source identifiers to enable contextual code completions.

### User Interface & Experience

- [Code Autocomplete Engines](https://awesome-repositories.com/f/user-interface-experience/autocomplete-suggestion-engines/code-autocomplete-engines.md) — Suggests relevant identifiers based on the current cursor position and surrounding code to speed up development. ([source](https://github.com/nsf/gocode#readme))

### Part of an Awesome List

- [Editor Plugins](https://awesome-repositories.com/f/awesome-lists/devtools/editor-plugins.md) — Provides fast autocompletion for Go code.
