Snippet and/or rightLabelHTML guide?

The “rightLabelHTML” field seems to suggest the function sin has a syntax of sin(E:real):real

Or is this simply a human readable popup docstring definitition? (With keywords highlighted and typehints?)

(In reference to “language-algol60/tree/master/grammars”)

Maybe I lack the deeper understanding of rightLabelHTML, but the following extract of language-algol60/snippets/language-algol60.json seems to suggest that the function sin has literally an actual definition of “sin(E:real):real”…

I’m thinking that this is atom’s snippet’s “meta” grammar… am I on the right path? (Maybe you can point me to a good URL on snippets…)

[The next question might be, about leftLabel and leftLabelHTML :slight_smile: ]

Here is an extract of the json I’m trying to figure out…

"sin(…)": {
                    "prefix": "sin",
                    "body": "sin(${1:E})$2",
                    "rightLabelHTML": "
                 <span class=\"syntax--variable    syntax--other syntax--identifier syntax--algol60\"> sin </span>
                 <span class=\"syntax--meta        syntax--brace syntax--round syntax--algol60\">     (   </span>
                 <span class=\"syntax--variable    syntax--other syntax--identifier syntax--algol60\">E   </span>
                 <span class=\"syntax--punctuation syntax--separator syntax--colon syntax--algol60\"> :   </span>
                 <span class=\"syntax--storage     syntax--type syntax--re syntax--algol60\">         real</span>
                 <span class=\"syntax--meta        syntax--brace syntax--round syntax--algol60\">     )   </span>
                 <span class=\"syntax--punctuation syntax--separator syntax--colon syntax--algol60\"> :   </span>
                 <span class=\"syntax--storage     syntax--type syntax--re syntax--algol60\">         real</span>"
                },

That looks right (not that I know Algol). : real would be a type annotation, so sin takes a real number and returns a real number.

See this wiki for how they work in Atom. Note this is autocomplete, not snippets. Snippets look like autocomplete because of the autocomplete-snippets packages which adds snippets to the autocomplete drop down, but snippets can be triggered independently even if autocomplete is disabled. Interestingly, the reverse is generally not true because autocomplete uses the snippets package for expanded completions.

Snippets are much simpler than autocomplete; they are basically just the prefix and body attributes of autocomplete.

OK… I got it… its an I wondered how auto completes work. Didn’t realise I’d stumbled on them. Time to master autocomplete.

BTW: sin(E:real):real is easy to read, but looks like Pascal. An Algol60 definition would natively read: procedure sin(E) Result(res); value E; real E,res;