Closed kaluluosi closed 8 months ago
This is a problem with the language server, which is a component of the Godot Editor. This extension doesn't have anything to do with that.
You'll need to go open an issue with the engine, and you can propose your fix there.
This is a problem with the language server, which is a component of the Godot Editor. This extension doesn't have anything to do with that.
You'll need to go open an issue with the engine, and you can propose your fix there.
yep, I have report it to the Godot Engine. Thanks . I close this issue.
Godot version
4.2.1 -stable
VS Code version
1.64.2
Godot Tools VS Code extension version
2.0
System information
Win10, Core I7-9700,RTX2080
Issue description
When you type in event.is_action_pressed, it pops up an input action list for you to insert. After you press enter to insert, you find that it also inserts its own double quotes for you and doesn't clean up the double quotes that you input.
But it won't happen on Input.is_action_pressed.
PS: It not happens in Godot Editor, just happens in VSCode.
While typing Input.is_action_pressed, it's LSP request and response It respondd the completion item kind is 2 -> lsp::CompletionItemKind::Method
In the case of InputEvent.is_action_pressed, it's LSP request and response It responds the completion item kind is 21 -> lsp::CompletionItemKind::Constant
And I find something interesting in GodotScript LSP server.
While typing InputEvent.is_action_pressed. In the method _find_call_arguments: And because the base is nil, so it is not considered as a method.
And this is the case of Input.is_action_presss: The LSP server has identified the type of Input.
It seems that there has a hard code to force fix the issue of InputEvent not identified. It force return the input action options as CODE_COMPLETION_KIND_CONSTANT.
I can simply fix it by change CODE_COMPLETION_KIND_CONSTANT to CODE_COMPLETION_KIND_FUNCTION
But it may not the best way to fix it. The best way is to find out why LSP server can't identify the type of InputEvent and figure it,
Steps to reproduce
All in description.