You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the details field of completion candidates is of limited value in editors (e.g the preview window in Vim -- not the candidates list).
I'd like to propose that the details field should contain as much information as the label field of completion candidates plus more. Probably, it should be the full type definition for types and the declaration for variables and constants. For functions and methods, the full declaration would be useful: name (along with receive for methods), parameters, and return values.
Contrast that with the current details. Here are two examples: the details field only contains the type name for constants and only has return values for functions and methods.
According to the LSP spec, detail is meant to contain "additional information about this item, like type or symbol information", which is why the detail is done this way.
An example in VSCode:
It seems to me that maybe Vim should behave differently in this case? Detail is meant to augment the information provided in the label, not entirely replace it.
Changing vim itself isn't likely to happen, but I can certainly use the details in vim-go more like you suggest. The one complication is methods and functions with more than one return value: parsing the details string correctly to decide when it should be wrapped with parentheses is tricky. Could we have gopls wrap the details with a set of parentheses when the function or method has multiple return values since gopls actually knows how many return values exist?
Currently, the details field of completion candidates is of limited value in editors (e.g the preview window in Vim -- not the candidates list).
I'd like to propose that the details field should contain as much information as the label field of completion candidates plus more. Probably, it should be the full type definition for types and the declaration for variables and constants. For functions and methods, the full declaration would be useful: name (along with receive for methods), parameters, and return values.
Contrast that with the current details. Here are two examples: the details field only contains the type name for constants and only has return values for functions and methods.
Here's a screenshot of completing constants in vim-go. The details field of the completion candidates is shown in the top window:
https://user-images.githubusercontent.com/1958864/57467163-e6f30f00-7236-11e9-8ce3-fe6a685b763d.png
Here's a similar screenshot of completing a method in vim-go. Again, the details field of the completion candidates is shown in the top window:
https://user-images.githubusercontent.com/1958864/57467081-b90dca80-7236-11e9-964c-e1f1e3f5cbdb.png
Relates to #31923
The text was updated successfully, but these errors were encountered: