Prevent putting the same information twice in documentation
bew opened this issue · 2 comments
Extracted from L3MON4D3/LuaSnip#1006
This comes from a slight annoyance of duplicated information for no reason.
With a simple snippet without explicit description, the doc looks like:
You can see we have modeline
repeated twice in the doc popup
(and even 4 times if we count the completion popup and what I wrote / the inserted completion)
I would like to at least remove the docstring when it is the same as the trigger/name of the snippet.
Here is a simulation of the result I'd like to have:
👉 I'd even argue that when the snippet name is the same as the trigger (which is the default when the name isn't specified when defining a snippet), we could remove the name, or replace it with something else 👀
@L3MON4D3 mentioned we could just compare the name/trigger with the docstring and not display it if it's the same
Actually, if we're at this, maybe the trigger shouldn't even be displayed in the doc-window again since it's already in the list on the left?
We just need to make the relevant changes in the get_documentation function. What's the exact behaviour would you guys prefer?