golang/go

x/tools/gopls: support Go assembly files

Open

#71,754 建立於 2025年2月14日

在 GitHub 查看
 (14 留言) (8 反應) (0 負責人)Go (133,883 star) (19,008 fork)batch import
FeatureRequestToolsgoplshelp wanted

描述

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

貢獻者指南