modelica-tools / atom-language-modelica

Modelica language support for the atom editor
https://atom.io/packages/language-modelica
Other
8 stars 4 forks source link

replace snippets with Boris' snippets #15

Open thorade opened 8 years ago

thorade commented 8 years ago

The converted snippets from Boris' package define more or less the same snippets (snippet for while is missing). I believe the version from Boris is more readable, using new line instead of new line character \n. Do we want a blank line before every snippet?

lochel commented 8 years ago

I prefer the compact version containing \n and so on.

thorade commented 8 years ago

OK, compact versus multiple lines is one difference. Another difference is that Boris uses something like ${1:ClassName}. Do you understand what it does?

lochel commented 8 years ago

I guess this are just labelled placeholders similar to comments. But I am not sure.

thorade commented 8 years ago

I need to read more about how snippets work https://atom.io/docs/latest/using-atom-snippets https://github.com/atom/snippets

tshort commented 8 years ago

The ${1:ClassName} prefills the entry with "Classname". It's useful as a reminder of what goes there.

lochel commented 8 years ago

I see! Thanks for the explanation.

thorade commented 8 years ago

Sounds like the best way here is to close this pull request and start over from Raphaels snippets, adding these ${1:ClassName} defaults. If nobody insists, I will close this pull request this afternoon.

lochel commented 8 years ago

There are even more differences between both versions, e.g. for model.

I think it is good to add the equation block, however I think the description should not be added, since it could be annoying to have it everywhere. What do you think?

thorade commented 8 years ago

What happens when you cycle through the tab-marks? Is the placeholder/default value marked so that it can be overwritten without marking the text first or do yo uhave to mark the default value to overwrite it?

lochel commented 8 years ago

The default value is already selected so that you can replace it by just typing.

thorade commented 8 years ago

I do not have a strong opinion on the default values, my impression is they do offer small advantages and bring almost no disadvantages. I only use the snippets for if and for anyway.

thorade commented 8 years ago

I might start using snippets also for model and block etc, I just tested it and I like how one can write the model name at two places simultaneously!

bilderbuchi commented 8 years ago

I find the snippet name string unnecessarily verbose, e.g. "Modelica function definition" vs. "function" -- it's already clear, if you're in a Modelica file, that the snippets will be Modelica snippets, and it could be that during use this takes unnecessarily much space in the autocomplete popup (but I haven't tried that out).

thorade commented 8 years ago

You are right. I will close this pull request without merging it. We can then start from Raphaels version (currently on master) and add only the parts that we like.

bilderbuchi commented 8 years ago

there's no need to close it (e.g. the rest looked better than the old one imo), we could have just updated/shortened the new description strings.

thorade commented 8 years ago

Well, then @bilderbuchi and @lochel have to discuss and decide whether we want the short or long version. @tshort do you have a strong opinion on this?

bilderbuchi commented 8 years ago

My reasons for preferring the long version:

lochel commented 8 years ago

I would propose something like 776bbf0ad0abeeda5f48823336ddbc2de75f23e7. We should somehow define consistent default values for model/record/function/block/class names. Probably Unnamed should be fine.

bilderbuchi commented 8 years ago

so, should we go forward with this? At this point I don't have a preference either way.

tshort commented 8 years ago

I don't have a preference either way.

On Tue, Mar 15, 2016 at 9:41 AM, Christoph Buchner <notifications@github.com

wrote:

so, should we go forward with this? At this point I don't have a preference either way.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub:

https://github.com/modelica-tools/atom-language-modelica/pull/15#issuecomment-196822797

bilderbuchi commented 8 years ago

the only thing that would be great would be to lose the "Modelica ..." prefix of all the snippet names, as that is imo pretty redundant.

thorade commented 8 years ago

Also, no preferences on my side

lochel commented 8 years ago

Boris' snippets contain default values for certain place holders.