Skip to content

x/tools/gopls: support Go assembly files #71754

Open
@adonovan

Description

@adonovan

Gopls already supports navigating from Go source to assembly files (use "Go to definition" on a func declaration with no body), but it wouldn't be hard for it to support navigation within assembly files, and from assembly files to Go files. The necessary parts are:

  • a new file.Kind for Asm (see https://go.dev/cl/649461 for sketch) and go.s LanguageID.
  • a basic parser for assembly files that can extract symbol names and control labels reliably.
  • recording of parsed assembly files in cache.Package, analogous to CompiledGoFiles.
  • augmentation of the xrefs index to include cross-package references from assembly files.
  • new implementations of the Definitions and References queries for file.Asm.
  • bonus: an implementation of Hover for assembly could provide all kinds of helpful information to make reading easier.
  • bonus: DocumentHighlight could show, for a given register, its def/use chains by making them temporarily bold.
  • go.s languageID support in eglot, vscode-go, neovim.

This is obviously not a high priority, but it's a fun little project.

@golang/compiler @golang/runtime

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions