Re: [Github-comments] [geany/geany] Snippets: Use ASCII ellipsis for the cursor placeholder (957b49b)
> I didn't meant for this to be the syntax but the result. For the syntax I > would rather suggest something like %cursor=function_name% or similar, > extending the current syntax in what seems at a glance like a compatible way. Ok, fine. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/commit/957b49b868214a4aea81641dedeabb98a497e4c1#commitcomment-23347078
Re: [Github-comments] [geany/geany] Snippets: Use ASCII ellipsis for the cursor placeholder (957b49b)
> And yeah a semantic snippet placeholder might be a nice future improvement, > but [ ] is a common language syntax, so I suspect it may get used in > snippets, so another syntax for indicating the placeholder might be better […] I didn't meant for this to be the syntax but the result. For the syntax I would rather suggest something like `%cursor=function_name%` or similar, extending the current syntax in what seems at a glance like a compatible way. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/commit/957b49b868214a4aea81641dedeabb98a497e4c1#commitcomment-23347074
Re: [Github-comments] [geany/geany] Snippets: Use ASCII ellipsis for the cursor placeholder (957b49b)
@b4n, underscore is in fact used as a placeholder in patterns some languages, [eg](https://doc.rust-lang.org/1.6.0/book/patterns.html) [and](https://golang.org/doc/effective_go.html#blank) [and](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching) but not C. :grin: So it is not unreasonable to use it for this, especially given the symbol issues @kugel- mentioned. And yeah a semantic snippet placeholder might be a nice future improvement, but [ ] is a common language syntax, so I suspect it may get used in snippets, so another syntax for indicating the placeholder might be better, but the idea seems sound. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/commit/957b49b868214a4aea81641dedeabb98a497e4c1#commitcomment-23347023
Re: [Github-comments] [geany/geany] Snippets: Use ASCII ellipsis for the cursor placeholder (957b49b)
> I disagree that it looks better, I prefer one char. Unfortunately … is > troublesome. Well, I don't feel like `_` really looks like a placeholder in the context of programming. Maybe a space would fit better for only one ASCII character? > I then chose _ because it's also less likely to mess up the tagmanager due to > syntax errors introduced by the ellipsis. It is indeed, though good parsers should handle it not too badly. But that might be a valid point indeed. I guess ideally the snippet could provide the placeholder, to expand like: ``` def [function_name]([arguments]): """[documentation]""" [body] ``` with `[]` representing the indicator range. But that's a whole other story. @codebrainz @elextr opinions on that? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/commit/957b49b868214a4aea81641dedeabb98a497e4c1#commitcomment-23346900
Re: [Github-comments] [geany/geany] Snippets: Use ASCII ellipsis for the cursor placeholder (957b49b)
I disagree that it looks better, I prefer one char. Unfortunately … is troublesome. I then chose _ because it's also less likely to mess up the tagmanager due to syntax errors introduced by the ellipsis. I don't feel very strong about it, though. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/commit/957b49b868214a4aea81641dedeabb98a497e4c1#commitcomment-23274521