Skip to content

Commit 80d3570

Browse files
committed
gopls/doc: add two missing items to doc index
Type Hierarchy, and support for Go assembly files. Change-Id: Ic9cfe0a8672d837707eb65b8b0830efe5d5cc252 Reviewed-on: https://go-review.googlesource.com/c/tools/+/680297 Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Alan Donovan <[email protected]>
1 parent 0d64d53 commit 80d3570

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

gopls/doc/features/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ when making significant changes to existing features or when adding new ones.
4242
- [Symbol](navigation.md#symbol): fuzzy search for symbol by name
4343
- [Selection Range](navigation.md#selection-range): select enclosing unit of syntax
4444
- [Call Hierarchy](navigation.md#call-hierarchy): show outgoing/incoming calls to the current function
45+
- [Type Hierarchy](navigation.md#type-hierarchy): show interfaces/implementations of the current type
4546
- [Completion](completion.md): context-aware completion of identifiers, statements
4647
- [Code transformation](transformation.md): fixes and refactorings
4748
- [Formatting](transformation.md#formatting): format the source code
@@ -58,6 +59,7 @@ when making significant changes to existing features or when adding new ones.
5859
- Support for non-Go files:
5960
- [Template files](templates.md): files parsed by `text/template` and `html/template`
6061
- [go.mod and go.work files](modfiles.md): Go module and workspace manifests
62+
- [Go *.s assembly files](assembly.ms): Go assembly files
6163
- [Command-line interface](../command-line.md): CLI for debugging and scripting (unstable)
6264

6365
You can find this page from within your editor by executing the

gopls/doc/features/assembly.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Gopls: Support for Go *.s assembly files
2+
3+
Gopls has rudimentary support for LSP operations in Go assembly files.
4+
5+
Go assembly files have a `.s` file name extension. LSP clients need to
6+
be configured to recognize `.s` files as Go assembly files, since this
7+
file name extension is also used for assembly files in other
8+
languages. A good heuristic is that if a file named `*.s` belongs to a
9+
directory containing at least one `*.go` file, then the `.s` file is
10+
Go assembly, and its appropriate language server is gopls.
11+
12+
Only Definition (`textDocument/definition`) requests are currently
13+
supported. For example, a Definition request on the `sigpanic`
14+
symbol in this file in GOROOT/src/runtime/asm.s:
15+
16+
```asm
17+
JMP ·sigpanic<ABIInternal>(SB)
18+
```
19+
20+
returns the location of the function declaration in
21+
GOROOT/src/runtime/signal_unix.go:
22+
23+
```go
24+
//go:linkname sigpanic
25+
func sigpanic() {
26+
```
27+
28+
See also issue golang/go#71754, which tracks the development of LSP
29+
features in Go assembly files.

0 commit comments

Comments
 (0)