- By snippet using LSP, I mean, language servers provide facility 'completion' so if user inputs code in form of EBNF, then a request will be made from client and a reply will be provided from server that will be converted into desired code. So, I am willing to work on this transaction, i.e., adding support for completion for code provided in form of EBNF.
OK.
The ticket you see in LSP4E is more for giving user choice, not specifically about variable transformation (but both are related).
Supporting this would be a good addition to the LSP stack in the Eclipse IDE stack, it's IMO a good GSoC topic. I'm just not sure it's a enough for 3 months.
For example, I set keyboard shortcut Ctrl + Shift + P for print statement in IDE and have installed following plugins.
1. On working on _javascript_ file if i press Ctrl + Shift + P , 'document.write()' will be written due to the property of Eclipse WWD, with cursor ends in between those parenthesis.
2. On working on C# file, on pressing that keyboard shortcut, 'Console.WriteLine()' will be written due to the property of Eclipse aCute, with cursor ends in between those parenthesis.
3. For Java file, It will be converted to "System.out.println()".
We already have such similarity in Eclipse Platform/IDE with a command/handler pattern; and the trend in general is to make things simpler for end-users. Adding additional shortcuts is rarely a simplification. In your case, if the LS has a snippet called "print", then typing "p" in the editor will suggest as completion the "print" action resulting in created code. See for example how JDT expands "sysout" completion.
Overall, I think the workflow you're suggesting is not worth being developed and we can find more valuable features or enhancements to implement.
**snippet - Earlier, i meant to add user-defined snippet but now i mean to provide simple snippet which are present in every language like printing task, function, for, while, if and so on. For language like HTML and CSS, there is no snippet present for mentioned tasks, there it will not be needed to implement.