Replies: 3 comments 3 replies
-
@L3MON4D3 to be honest I think is better to avoid doing this, even if the new API is nicer, it will break a lot of configurations, and to make it worse it will be probably a silent break. |
Beta Was this translation helpful? Give feedback.
-
It would be backwards-compatible to just merge both tables. That way you could break up the snippet metadata however you want. I guess it would be sort of odd, but I can't imagine a circumstance where it would cause issues unless in the future you wanted to reuse one of the "trigger" keys in the "post-expansion" data. I've always found it sort of odd that there were two tables since both of them are just metadata applied to the snippet in the same context. As a fennel user I actually just wrote macros that take all of the metadata up front and then accept nodes as varargs. |
Beta Was this translation helpful? Give feedback.
-
imo, from a users perspective, it might make sense to migrate the changes to a dev branch and maybe put out a warning on master so that people get time to migrate their snippets to the new syntax? |
Beta Was this translation helpful? Give feedback.
-
I'm thinking of moving around some of the arguments that can be passed to
s
.The first time I thought about doing this was while adding
snippetProxy
(allows delayed (on expand) parsing of lsp-snippet), where the implementation could be a bit cleaner if the arguments tos
were separated differently.It has now come up again in #420, where it would be nice to specify
condition
/show_condition
separately for each trigger (this obviously assumes that only the first table may be duplicated, nothing prevents also allowing multiple of the second table (apart from me believing it would be an ultimately worse desing and require a much more complicated implementation)).I'm mentioning those two so there is some context for the suggested separation.
For a quick overview, we currently have:
As of now, they are (rather subconciously) separated into options with "short" values (string, number, boolean) and those with "longer" values (functions, tables).
This obviously doesn't make very much sense and I'd like to change it.
(and here we also have a first problem: lots of configs will have to be adjusted when these parameters are rearranged. Is it worth it to cause that, without very much (slightly cleaner implementation for
snippetProxy
, more option in #420) benefit? Please let me know your opinions on this)Currently, I'd favor a separation into options that somehow relate to expansion, and those that relate to the snippet after expansion (specifically this makes implementing
snippetProxy
nicer):Another option, and this would prevent similar breaking changes in the future, would be to just put all parameters into one table.
What are your opinions? Objections? Questions?
Let me know :D
Beta Was this translation helpful? Give feedback.
All reactions