Giter VIP home page Giter VIP logo

Comments (11)

oblitum avatar oblitum commented on June 11, 2024

It also seems that for standard packages signatureHelp isn't working at all.

from bingo.

saibing avatar saibing commented on June 11, 2024

@oblitum

It also seems that for standard packages signatureHelp isn't working at all.

Do you mean built-in functions(append, println...)?

from bingo.

saibing avatar saibing commented on June 11, 2024

Just built the project and trying it out with coc.nvim, for this simple code:

package main

func foo(a, b int) int {
	return 42
}

func main() {
	foo(
}

On foo(, I get wrong signatureHelp highlight, it highlights the last parameter foo(a int, *b int*), then when I insert the first integer, foo(4, , signatureHelp information returns the first parameter as active. I've checked the server communication.

@oblitum

I have fixed this bug.

from bingo.

oblitum avatar oblitum commented on June 11, 2024

@oblitum

It also seems that for standard packages signatureHelp isn't working at all.

Do you mean built-in functions(append, println...)?

I meant from standard packages, like fmt. They're responding now, but see below.

On foo(, I get wrong signatureHelp highlight, it highlights the last parameter foo(a int, *b int*), then when I insert the first integer, foo(4, , signatureHelp information returns the first parameter as active. I've checked the server communication.

@oblitum

I have fixed this bug.

It's still not working for me, same behavior. Standard package's signatureHelp is responding but I get the same fuzzy behavior regarding highlight of active parameter, indexing is wrong.

from bingo.

oblitum avatar oblitum commented on June 11, 2024

In late protocol you can have labelOffsetSupport too, but it won't make any difference since you would have to support clients that ignore it too. In any case, that's just additional information, the signatureHelp's active parameter bug could be present in whatever case if indexing is not done correctly.

from bingo.

oblitum avatar oblitum commented on June 11, 2024

Relevant log for the original example code.

On opening parentheses (foo():

[Trace - 4:12:54 PM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "version": 5,
        "uri": "file:///home/francisco/Projects/samples/go/sample.go"
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 7,
                    "character": 4
                },
                "end": {
                    "line": 7,
                    "character": 4
                }
            },
            "rangeLength": 0,
            "text": "("
        }
    ]
}

[Trace - 4:12:54 PM] Sending request 'textDocument/signatureHelp - (2)'.
Params: {
    "textDocument": {
        "uri": "file:///home/francisco/Projects/samples/go/sample.go"
    },
    "position": {
        "line": 7,
        "character": 5
    }
}

[Trace - 4:12:54 PM] Received response 'textDocument/signatureHelp - (2)' in 68ms.
Result: {
    "signatures": [
        {
            "label": "foo(a int, b int)",
            "parameters": [
                {
                    "label": "a int"
                },
                {
                    "label": "b int"
                }
            ]
        }
    ],
    "activeSignature": 0,
    "activeParameter": 1
}

On first comma (foo(1,):

[Trace - 4:12:57 PM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "version": 7,
        "uri": "file:///home/francisco/Projects/samples/go/sample.go"
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 7,
                    "character": 6
                },
                "end": {
                    "line": 7,
                    "character": 6
                }
            },
            "rangeLength": 0,
            "text": ","
        }
    ]
}

[Trace - 4:12:57 PM] Sending request 'textDocument/signatureHelp - (4)'.
Params: {
    "textDocument": {
        "uri": "file:///home/francisco/Projects/samples/go/sample.go"
    },
    "position": {
        "line": 7,
        "character": 7
    }
}

[Trace - 4:12:57 PM] Received response 'textDocument/signatureHelp - (4)' in 34ms.
Result: {
    "signatures": [
        {
            "label": "foo(a int, b int)",
            "parameters": [
                {
                    "label": "a int"
                },
                {
                    "label": "b int"
                }
            ]
        }
    ],
    "activeSignature": 0,
    "activeParameter": 0
}

from bingo.

saibing avatar saibing commented on June 11, 2024

@oblitum
I'm sorry. I can't reproduce the above problem in vscode. Can you reproduce it in vscode?

from bingo.

oblitum avatar oblitum commented on June 11, 2024

Sorry but I don't use vscode. Though, I think this is a bingo issue, since it's the one that's clearly sending wrong activeParameter, maybe it's getting lost the way messages are sent from client. I'm currently using coc.nvim, bingo is the only server that reproduces this behavior.

from bingo.

oblitum avatar oblitum commented on June 11, 2024

Notice the above output isn't full, I get interleaved diagnostics reports, I've cut it because the message is too noisy and would probably not be relevant.

from bingo.

saibing avatar saibing commented on June 11, 2024

@oblitum

I have fixed this bug, please try the latest version bingo

from bingo.

oblitum avatar oblitum commented on June 11, 2024

@saibing thanks, it's working now.

from bingo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.