Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't see the signature helper. #442

Closed
CppCXY opened this issue Aug 9, 2024 · 22 comments
Closed

Can't see the signature helper. #442

CppCXY opened this issue Aug 9, 2024 · 22 comments
Labels
bug Something isn't working signatureHelp

Comments

@CppCXY
Copy link
Contributor

CppCXY commented Aug 9, 2024

the lsp reponse about signatureHelper:

{
    "signatureHelpProvider": {
      "triggerCharacters": [
        "(",
        ","
      ]
    }
}

add parameterInfo to plugin.xml:

<codeInsight.parameterInfo
        language="Lua"
        implementationClass="com.redhat.devtools.lsp4ij.features.signatureHelp.LSPParameterInfoHandler"/>

the project url

can download the plugin from: https://github.com/EmmyLua/Intellij-EmmyLua2/actions/runs/10316582699

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 9, 2024

see:
debug

@angelozerr angelozerr added bug Something isn't working signatureHelp labels Aug 9, 2024
@angelozerr
Copy link
Contributor

angelozerr commented Aug 9, 2024

If you do Ctr+P inside (), do you see signature help?

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 9, 2024

If you do Ctr+P inside (), do you see signature help?

yes, I can see:
image

However, it will not update afterwards because my signature can change dynamically.

@angelozerr
Copy link
Contributor

angelozerr commented Aug 9, 2024

Ok it means LSP signature help is working. If you want to process the signature help when you apply completion, you need to select the standard Show the parameter info popup in ... option (it works like other language like Java).

image

@angelozerr
Copy link
Contributor

However, it will not update afterwards because my signature can change dynamically.

Sorry I have not understood the problem?

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 9, 2024

Ok it means LSP signature help is working. If you want to process the signature help when you apply completion, you need to select the standard Show the parameter info popup in ... option (it works like other language like Java).

I still can't get the signature unless I press Ctrl+P.
debug

@angelozerr
Copy link
Contributor

Do you see some LSP trace of signature help when you apply completion?

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 9, 2024

Do you see some LSP trace of signature help when you apply completion?

no, I can't see any signature help protocol

@angelozerr
Copy link
Contributor

And if you do ctrl+p?

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 9, 2024

When I press ctrl + p, I always get 2 times signatureHelper protocol
image

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 16, 2024

I am certain that while editing the code, IntelliJ did not call the findElementForParameterInfo method, so there is no signature helper, I inherited the LSP class and did not find any calls unless I pressed Ctrl+P.
image

@angelozerr
Copy link
Contributor

The auto popup is opened here

popupController.autoPopupParameterInfo(editor, null);
I suggest that you debug LSP4IJ to understand the problem.

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 21, 2024

The auto popup is opened here

popupController.autoPopupParameterInfo(editor, null);

I suggest that you debug LSP4IJ to understand the problem.

signature

donot enter the breakpoint

@angelozerr
Copy link
Contributor

If you set a breakpoint in LSPCompletionProposal it should stop when you open completion, right?

If no it means that you cannot debug LSP4IJ

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 21, 2024

If you set a breakpoint in LSPCompletionProposal it should stop when you open completion, right?

If no it means that you cannot debug LSP4IJ

I can debug in other method
image

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 21, 2024

it can be invoke when this completionItem can execute command:
image

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 21, 2024

it can be invoke when this completionItem can execute command

My mistake, it will only be called when selected completion and tab, but cannot be invoked during normal typing.

@angelozerr
Copy link
Contributor

Exactly! Is it working when you select completion ? This behavior is the same for other languages like Java, right?

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 21, 2024

Exactly! Is it working when you select completion ? This behavior is the same for other languages like Java, right?

Even when completion is selected, paramInfo still cannot be triggered. I tried customizing an empty paramInfoHandler, but it still couldn't hit the breakpoint during typing. I think this might be related to the PSI system.

@angelozerr
Copy link
Contributor

angelozerr commented Aug 21, 2024

I think this might be related to the PSI system.

I think so, I suggest that you debug the Jetbrains code of the autoPopupParameterInfo.

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 22, 2024

I found that it was because LSPTypedHandler returned stop:
image

which caused the subsequent execution to fail.
image

@CppCXY
Copy link
Contributor Author

CppCXY commented Aug 22, 2024

when I change to continue:
image
it work well:
image

so why is it return stop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working signatureHelp
Projects
None yet
Development

No branches or pull requests

2 participants