-
-
Notifications
You must be signed in to change notification settings - Fork 351
feat(completion): truncate arguments for callSnippet #1014
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
Conversation
The callSnippet always expands all the optional arguments and variable argument that is annoying. To truncate optional arguments and variable arguments help users more frequently use `callSnippet`. We already have the label and signature to get the total arguments. This behavior is like tsserver.
Found a bug about optional arguments is not continuous, needs to be fixed. |
If the arguments are all optional or variable until the end, we can truncate them directly.
I don't quite understand your requirements. Can you add some tests to make me understand your changes? |
I have tested under the below code: --- Test
---@param a number
---@param b? number
---@param c? number
---@vararg number
local function foo(a, b, c, ...) end
-- type `foo` You can change the arguments optional status to quickly check out the logic that is like tsserver. |
OK, I need time to explore the test framework. BTW, it's too late and it's time to sleep now. o_o |
Thank you, have a nice dream! |
Please review the code and share your idea. :) |
It make sense, thank you! |
The callSnippet always expands all the optional arguments and variable
argument that is annoying.
To truncate optional arguments and variable arguments help users more
frequently use
callSnippet
. We already have the label and signature to getthe total arguments.
This behavior is like tsserver.