Closed ditodidio closed 3 years ago
How is this an improvement over the already supported g:snipMate.description_in_completion
option (see :h SnipMate-options
for details) where the snippet is defined as follows?
snippet xsect xml schema element with complexType and simple content
<xs:element name="${1}">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="${2}">
${0}
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
Yeah you are right. It is not. I did not notice the possibility to write it after the snippet name. Although I think, it makes more sense to seperate it from the snippet itsself. The folded snippet file is more readable this way and you can easily grab a list of all available snippet Comments without string manipulation of the snippet line. Maybe later it is possible to have space separated snippet names (if its not already possible). The file itsself gets larger with my approach. That maybe could result in a slower reading of the file. My approach is not activated by default though and it does not interfere with the current approach. There is not even a parsing speed impact if you have no comments in your current file. If you merge it in, the user can decide if he wants the description above or behind the snippet declaration.
I will not be merging this. Its main advantage overlaps with functionality already in SnipMate, it makes comments in snippets files meaningful, and it adds a little complexity to a codebase I've been meaning to refactor for years.
I do thank you for giving SnipMate your attention
Yeah, No Problem. You are the maintainer. I will keep my changes. I thought my approach is actually more "KISS". Maybe one day you will appreciate that.
By the way, there is a bug in the current version. I will report it later.
This little change adds comments support. The basic idea is, to have a really small snippet abbreviation as snippet trigger and a comment that describes the snippet further.
An example:
autocomplete menu shows:
xsect xml schema element with complexType and simple content