Closed oblitum closed 5 years ago
@oblitum
I tested and it is ok.
which version of bingo that you use?
I use from master. This could be an issue with my client, I will check tomorrow.
fwiw, at master now http.ListenAndServe(
has signatureHelp inside main, but not on the location pointed in this issue, inside the goroutine.
With coc.nvim it doesn't work. I can reproduce the issue with this trivial test case:
package main
import "fmt"
func main() {
// works -> fmt.Println(
go func() {
// doesn't work -> fmt.Println(
}()
}
Trace for the following code:
package main
import "fmt"
func main() {
fmt.Println("")
go func() {
fmt.Println(
}()
}
## versions
vim version: NVIM v0.4.0-426-gfa6ed5f75
node version: v11.12.0
coc.nvim version: 0.0.61
term: tmux-256color
platform: linux
## Error messages
## Output channel: languageserver.golang
[Trace - 2:42:07 PM] Sending request 'initialize - (0)'.
Params: {
"processId": 12791,
"rootPath": "/home/francisco/Projects/samples/go",
"rootUri": "file:///home/francisco/Projects/samples/go",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": [
"create",
"rename",
"delete"
],
"failureHandling": "textOnlyTransactional"
},
"didChangeConfiguration": {
"dynamicRegistration": true
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
}
},
"executeCommand": {
"dynamicRegistration": true
},
"configuration": true
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"deprecatedSupport": true,
"preselectSupport": true
},
"completionItemKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": [
"markdown",
"plaintext"
]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
],
"parameterInformation": {
"labelOffsetSupport": true
}
}
},
"definition": {
"dynamicRegistration": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
}
},
"codeAction": {
"dynamicRegistration": true,
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
}
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true
},
"documentLink": {
"dynamicRegistration": true
},
"typeDefinition": {
"dynamicRegistration": true
},
"implementation": {
"dynamicRegistration": true
},
"declaration": {
"dynamicRegistration": true
},
"colorProvider": {
"dynamicRegistration": true
},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true
}
}
},
"initializationOptions": {},
"trace": "verbose",
"workspaceFolders": [
{
"uri": "file:///home/francisco/Projects/samples/go",
"name": "go"
}
]
}
langserver-go: reading on stdin, writing on stdout
Passing an initialize rootPath URI ("file:///home/francisco/Projects/samples/go") is deprecated. Use rootUri instead.
[Trace - 2:42:08 PM] Received notification 'window/logMessage'.
Params: {
"type": 3,
"message": "GOPATH: [/home/francisco/.go], import path: "
}
[Info - 2:42:08 PM] GOPATH: [/home/francisco/.go], import path:
[Trace - 2:42:08 PM] Received notification 'window/logMessage'.
Params: {
"type": 3,
"message": "GO111MODULE=auto, module mode"
}
[Info - 2:42:08 PM] GO111MODULE=auto, module mode
[Trace - 2:42:08 PM] Received notification 'window/logMessage'.
Params: {
"type": 3,
"message": "/home/francisco/Projects/samples/go/go.mod"
}
[Info - 2:42:08 PM] /home/francisco/Projects/samples/go/go.mod
[Trace - 2:42:08 PM] Received notification 'window/showMessage'.
Params: {
"type": 3,
"message": "load /home/francisco/Projects/samples/go successfully! elapsed time: 0 seconds, cache: true, go module: true."
}
[Trace - 2:42:08 PM] Received response 'initialize - (0)' in 444ms.
Result: {
"capabilities": {
"textDocumentSync": 2,
"hoverProvider": true,
"completionProvider": {
"triggerCharacters": [
"."
]
},
"signatureHelpProvider": {
"triggerCharacters": [
"(",
","
]
},
"definitionProvider": true,
"typeDefinitionProvider": true,
"referencesProvider": true,
"documentSymbolProvider": true,
"workspaceSymbolProvider": true,
"implementationProvider": true,
"documentFormattingProvider": true,
"documentRangeFormattingProvider": true,
"renameProvider": true,
"xworkspaceReferencesProvider": true,
"xdefinitionProvider": true,
"xworkspaceSymbolByProperties": true
}
}
[Trace - 2:42:08 PM] Sending notification 'initialized'.
Params: {}
[Trace - 2:42:08 PM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:///home/francisco/Projects/samples/go/sample.go",
"languageId": "go",
"version": 1,
"text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"\")\n\tgo func() {\n\t}()\n}\n"
}
}
[Trace - 2:42:08 PM] Received notification 'window/logMessage'.
Params: {
"type": 3,
"message": "fsnotify watch dir number: 1"
}
[Info - 2:42:08 PM] fsnotify watch dir number: 1
[Trace - 2:42:08 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///home/francisco/Projects/samples/go/sample.go",
"diagnostics": []
}
[Trace - 2:42:10 PM] Sending notification 'textDocument/didChange'.
Params: {
"textDocument": {
"version": 2,
"uri": "file:///home/francisco/Projects/samples/go/sample.go"
},
"contentChanges": [
{
"range": {
"start": {
"line": 6,
"character": 12
},
"end": {
"line": 6,
"character": 12
}
},
"rangeLength": 0,
"text": "\n\t\t"
}
]
}
[Trace - 2:42:10 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///home/francisco/Projects/samples/go/sample.go",
"diagnostics": []
}
[Trace - 2:42:11 PM] Sending notification 'textDocument/didChange'.
Params: {
"textDocument": {
"version": 3,
"uri": "file:///home/francisco/Projects/samples/go/sample.go"
},
"contentChanges": [
{
"range": {
"start": {
"line": 7,
"character": 2
},
"end": {
"line": 7,
"character": 2
}
},
"rangeLength": 0,
"text": "f"
}
]
}
[Trace - 2:42:11 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///home/francisco/Projects/samples/go/sample.go",
"diagnostics": [
{
"range": {
"start": {
"line": 7,
"character": 2
},
"end": {
"line": 7,
"character": 2
}
},
"severity": 1,
"source": "LSP: Go compiler",
"message": "undeclared name: f"
}
]
}
[Trace - 2:42:11 PM] Sending request 'textDocument/completion - (1)'.
Params: {
"textDocument": {
"uri": "file:///home/francisco/Projects/samples/go/sample.go"
},
"position": {
"line": 7,
"character": 3
},
"context": {
"triggerKind": 1
}
}
[Trace - 2:42:11 PM] Received response 'textDocument/completion - (1)' in 6ms.
Result: {
"isIncomplete": false,
"items": [
{
"label": "fmt",
"kind": 9,
"detail": "\"fmt\"",
"sortText": "00000",
"filterText": "fmt",
"insertText": "fmt",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 2
},
"end": {
"line": 7,
"character": 3
}
},
"newText": "fmt"
}
},
{
"label": "fmt",
"kind": 9,
"detail": "fmt",
"sortText": "00002",
"filterText": "fmt",
"insertText": "fmt",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 2
},
"end": {
"line": 7,
"character": 3
}
},
"newText": "fmt"
}
},
{
"label": "fmtsort",
"kind": 9,
"detail": "internal/fmtsort",
"sortText": "00003",
"filterText": "fmtsort",
"insertText": "fmtsort",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 2
},
"end": {
"line": 7,
"character": 3
}
},
"newText": "fmtsort"
}
},
{
"label": "false",
"kind": 21,
"sortText": "00015",
"filterText": "false",
"insertText": "false",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 2
},
"end": {
"line": 7,
"character": 3
}
},
"newText": "false"
}
},
{
"label": "float32",
"kind": 25,
"sortText": "00016",
"filterText": "float32",
"insertText": "float32",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 2
},
"end": {
"line": 7,
"character": 3
}
},
"newText": "float32"
}
},
{
"label": "float64",
"kind": 25,
"sortText": "00017",
"filterText": "float64",
"insertText": "float64",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 2
},
"end": {
"line": 7,
"character": 3
}
},
"newText": "float64"
}
}
]
}
[Trace - 2:42:12 PM] Sending notification 'textDocument/didChange'.
Params: {
"textDocument": {
"version": 4,
"uri": "file:///home/francisco/Projects/samples/go/sample.go"
},
"contentChanges": [
{
"range": {
"start": {
"line": 7,
"character": 3
},
"end": {
"line": 7,
"character": 3
}
},
"rangeLength": 0,
"text": "mt."
}
]
}
[Trace - 2:42:12 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///home/francisco/Projects/samples/go/sample.go",
"diagnostics": [
{
"range": {
"start": {
"line": 8,
"character": 1
},
"end": {
"line": 8,
"character": 1
}
},
"severity": 1,
"source": "LSP: Go compiler",
"message": "expected selector or type assertion, found '}'"
}
]
}
[Trace - 2:42:12 PM] Sending request 'textDocument/completion - (2)'.
Params: {
"textDocument": {
"uri": "file:///home/francisco/Projects/samples/go/sample.go"
},
"position": {
"line": 7,
"character": 6
},
"context": {
"triggerKind": 2,
"triggerCharacter": "."
}
}
[Trace - 2:42:12 PM] Received response 'textDocument/completion - (2)' in 8ms.
Result: {
"isIncomplete": false,
"items": [
{
"label": "Errorf(format string, a ...interface{})",
"kind": 3,
"detail": "error",
"sortText": "00000",
"filterText": "Errorf(${1:format}, ${2:a})$0",
"insertText": "Errorf(${1:format}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Errorf(${1:format}, ${2:a})$0"
}
},
{
"label": "Formatter",
"kind": 8,
"detail": "interface{...}",
"documentation": "Formatter is the interface implemented by values with a custom formatter.\nThe implementation of Format may call Sprint(f) or Fprint(f) etc.\nto generate its output.\n",
"sortText": "00001",
"filterText": "Formatter",
"insertText": "Formatter",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Formatter"
}
},
{
"label": "Fprint(w io.Writer, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Fprint formats using the default formats for its operands and writes to w.\nSpaces are added between operands when neither is a string.\nIt returns the number of bytes written and any write error encountered.\n",
"sortText": "00002",
"filterText": "Fprint(${1:w}, ${2:a})$0",
"insertText": "Fprint(${1:w}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Fprint(${1:w}, ${2:a})$0"
}
},
{
"label": "Fprintf(w io.Writer, format string, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Fprintf formats according to a format specifier and writes to w.\nIt returns the number of bytes written and any write error encountered.\n",
"sortText": "00003",
"filterText": "Fprintf(${1:w}, ${2:format}, ${3:a})$0",
"insertText": "Fprintf(${1:w}, ${2:format}, ${3:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Fprintf(${1:w}, ${2:format}, ${3:a})$0"
}
},
{
"label": "Fprintln(w io.Writer, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Fprintln formats using the default formats for its operands and writes to w.\nSpaces are always added between operands and a newline is appended.\nIt returns the number of bytes written and any write error encountered.\n",
"sortText": "00004",
"filterText": "Fprintln(${1:w}, ${2:a})$0",
"insertText": "Fprintln(${1:w}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Fprintln(${1:w}, ${2:a})$0"
}
},
{
"label": "Fscan(r io.Reader, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Fscan scans text read from r, storing successive space-separated\nvalues into successive arguments. Newlines count as space. It\nreturns the number of items successfully scanned. If that is less\nthan the number of arguments, err will report why.\n",
"sortText": "00005",
"filterText": "Fscan(${1:r}, ${2:a})$0",
"insertText": "Fscan(${1:r}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Fscan(${1:r}, ${2:a})$0"
}
},
{
"label": "Fscanf(r io.Reader, format string, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Fscanf scans text read from r, storing successive space-separated\nvalues into successive arguments as determined by the format. It\nreturns the number of items successfully parsed.\nNewlines in the input must match newlines in the format.\n",
"sortText": "00006",
"filterText": "Fscanf(${1:r}, ${2:format}, ${3:a})$0",
"insertText": "Fscanf(${1:r}, ${2:format}, ${3:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Fscanf(${1:r}, ${2:format}, ${3:a})$0"
}
},
{
"label": "Fscanln(r io.Reader, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Fscanln is similar to Fscan, but stops scanning at a newline and\nafter the final item there must be a newline or EOF.\n",
"sortText": "00007",
"filterText": "Fscanln(${1:r}, ${2:a})$0",
"insertText": "Fscanln(${1:r}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Fscanln(${1:r}, ${2:a})$0"
}
},
{
"label": "GoStringer",
"kind": 8,
"detail": "interface{...}",
"documentation": "GoStringer is implemented by any value that has a GoString method,\nwhich defines the Go syntax for that value.\nThe GoString method is used to print values passed as an operand\nto a %#v format.\n",
"sortText": "00008",
"filterText": "GoStringer",
"insertText": "GoStringer",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "GoStringer"
}
},
{
"label": "Print(a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Print formats using the default formats for its operands and writes to standard output.\nSpaces are added between operands when neither is a string.\nIt returns the number of bytes written and any write error encountered.\n",
"sortText": "00009",
"filterText": "Print(${1:a})$0",
"insertText": "Print(${1:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Print(${1:a})$0"
}
},
{
"label": "Printf(format string, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Printf formats according to a format specifier and writes to standard output.\nIt returns the number of bytes written and any write error encountered.\n",
"sortText": "00010",
"filterText": "Printf(${1:format}, ${2:a})$0",
"insertText": "Printf(${1:format}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Printf(${1:format}, ${2:a})$0"
}
},
{
"label": "Println(a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Println formats using the default formats for its operands and writes to standard output.\nSpaces are always added between operands and a newline is appended.\nIt returns the number of bytes written and any write error encountered.\n",
"sortText": "00011",
"filterText": "Println(${1:a})$0",
"insertText": "Println(${1:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Println(${1:a})$0"
}
},
{
"label": "Scan(a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Scan scans text read from standard input, storing successive\nspace-separated values into successive arguments. Newlines count\nas space. It returns the number of items successfully scanned.\nIf that is less than the number of arguments, err will report why.\n",
"sortText": "00012",
"filterText": "Scan(${1:a})$0",
"insertText": "Scan(${1:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Scan(${1:a})$0"
}
},
{
"label": "ScanState",
"kind": 8,
"detail": "interface{...}",
"documentation": "ScanState represents the scanner state passed to custom scanners.\nScanners may do rune-at-a-time scanning or ask the ScanState\nto discover the next space-delimited token.\n",
"sortText": "00013",
"filterText": "ScanState",
"insertText": "ScanState",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "ScanState"
}
},
{
"label": "Scanf(format string, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Scanf scans text read from standard input, storing successive\nspace-separated values into successive arguments as determined by\nthe format. It returns the number of items successfully scanned.\nIf that is less than the number of arguments, err will report why.\nNewlines in the input must match newlines in the format.\nThe one exception: the verb %c always scans the next rune in the\ninput, even if it is a space (or tab etc.) or newline.\n",
"sortText": "00014",
"filterText": "Scanf(${1:format}, ${2:a})$0",
"insertText": "Scanf(${1:format}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Scanf(${1:format}, ${2:a})$0"
}
},
{
"label": "Scanln(a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Scanln is similar to Scan, but stops scanning at a newline and\nafter the final item there must be a newline or EOF.\n",
"sortText": "00015",
"filterText": "Scanln(${1:a})$0",
"insertText": "Scanln(${1:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Scanln(${1:a})$0"
}
},
{
"label": "Scanner",
"kind": 8,
"detail": "interface{...}",
"documentation": "Scanner is implemented by any value that has a Scan method, which scans\nthe input for the representation of a value and stores the result in the\nreceiver, which must be a pointer to be useful. The Scan method is called\nfor any argument to Scan, Scanf, or Scanln that implements it.\n",
"sortText": "00016",
"filterText": "Scanner",
"insertText": "Scanner",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Scanner"
}
},
{
"label": "Sprint(a ...interface{})",
"kind": 3,
"detail": "string",
"documentation": "Sprint formats using the default formats for its operands and returns the resulting string.\nSpaces are added between operands when neither is a string.\n",
"sortText": "00017",
"filterText": "Sprint(${1:a})$0",
"insertText": "Sprint(${1:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Sprint(${1:a})$0"
}
},
{
"label": "Sprintf(format string, a ...interface{})",
"kind": 3,
"detail": "string",
"documentation": "Sprintf formats according to a format specifier and returns the resulting string.\n",
"sortText": "00018",
"filterText": "Sprintf(${1:format}, ${2:a})$0",
"insertText": "Sprintf(${1:format}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Sprintf(${1:format}, ${2:a})$0"
}
},
{
"label": "Sprintln(a ...interface{})",
"kind": 3,
"detail": "string",
"documentation": "Sprintln formats using the default formats for its operands and returns the resulting string.\nSpaces are always added between operands and a newline is appended.\n",
"sortText": "00019",
"filterText": "Sprintln(${1:a})$0",
"insertText": "Sprintln(${1:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Sprintln(${1:a})$0"
}
},
{
"label": "Sscan(str string, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Sscan scans the argument string, storing successive space-separated\nvalues into successive arguments. Newlines count as space. It\nreturns the number of items successfully scanned. If that is less\nthan the number of arguments, err will report why.\n",
"sortText": "00020",
"filterText": "Sscan(${1:str}, ${2:a})$0",
"insertText": "Sscan(${1:str}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Sscan(${1:str}, ${2:a})$0"
}
},
{
"label": "Sscanf(str string, format string, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Sscanf scans the argument string, storing successive space-separated\nvalues into successive arguments as determined by the format. It\nreturns the number of items successfully parsed.\nNewlines in the input must match newlines in the format.\n",
"sortText": "00021",
"filterText": "Sscanf(${1:str}, ${2:format}, ${3:a})$0",
"insertText": "Sscanf(${1:str}, ${2:format}, ${3:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Sscanf(${1:str}, ${2:format}, ${3:a})$0"
}
},
{
"label": "Sscanln(str string, a ...interface{})",
"kind": 3,
"detail": "n int, err error",
"documentation": "Sscanln is similar to Sscan, but stops scanning at a newline and\nafter the final item there must be a newline or EOF.\n",
"sortText": "00022",
"filterText": "Sscanln(${1:str}, ${2:a})$0",
"insertText": "Sscanln(${1:str}, ${2:a})$0",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Sscanln(${1:str}, ${2:a})$0"
}
},
{
"label": "State",
"kind": 8,
"detail": "interface{...}",
"documentation": "State represents the printer state passed to custom formatters.\nIt provides access to the io.Writer interface plus information about\nthe flags and options for the operand's format specifier.\n",
"sortText": "00023",
"filterText": "State",
"insertText": "State",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "State"
}
},
{
"label": "Stringer",
"kind": 8,
"detail": "interface{...}",
"sortText": "00024",
"filterText": "Stringer",
"insertText": "Stringer",
"insertTextFormat": 2,
"textEdit": {
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"newText": "Stringer"
}
}
]
}
[Trace - 2:42:19 PM] Sending notification 'textDocument/didChange'.
Params: {
"textDocument": {
"version": 5,
"uri": "file:///home/francisco/Projects/samples/go/sample.go"
},
"contentChanges": [
{
"range": {
"start": {
"line": 7,
"character": 6
},
"end": {
"line": 7,
"character": 6
}
},
"rangeLength": 0,
"text": "Println("
}
]
}
[Trace - 2:42:19 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///home/francisco/Projects/samples/go/sample.go",
"diagnostics": [
{
"range": {
"start": {
"line": 8,
"character": 1
},
"end": {
"line": 8,
"character": 1
}
},
"severity": 1,
"source": "LSP: Go compiler",
"message": "expected operand, found '}'"
}
]
}
[Trace - 2:42:19 PM] Sending request 'textDocument/signatureHelp - (3)'.
Params: {
"textDocument": {
"uri": "file:///home/francisco/Projects/samples/go/sample.go"
},
"position": {
"line": 7,
"character": 14
}
}
[Trace - 2:42:19 PM] Received response 'textDocument/signatureHelp - (3)' in 1ms.
No result returned.
@saibing thanks. I just tried it but it fails in the same minimal test case. Though at least it's returning an error message:
[coc.nvim] Error output from languageserver.golang: Request textDocument/signatureHelp failed.
Message: cannot find an enclosing function
Code: 0
It seems there's not bingo/gopls issue tracking on github anymore. Where issues should be reported? This issue needs to be replicated there, it's still the same behavior.
Oh... I just built your bingo fork/branch of gopls, #20 is back as regression.
This issue can be tested with bingo's own source code, in
main.go
, I don't get signatureHelp forlog.Println(http.ListenAndServe(
at the following location:https://github.com/saibing/bingo/blob/4d5e0eb4d9555b9fbe3a371bee11be98093763a0/main.go#L56