Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support variable such as CURRENT_YEAR used by friendly-snippets #68

Open
jmetz opened this issue Jun 27, 2024 · 5 comments
Open

Support variable such as CURRENT_YEAR used by friendly-snippets #68

jmetz opened this issue Jun 27, 2024 · 5 comments

Comments

@jmetz
Copy link

jmetz commented Jun 27, 2024

There are a bunch of common system variables that spring to mind, including date-time related, username, email, or perhaps even the result of a shell command.

@estin
Copy link
Owner

estin commented Jul 1, 2024

Hi! It can be implemented with some restrictions.
I don't use snippets heavily and don't know common standards for variables in snippets.
This is "standard": https://code.visualstudio.com/docs/editor/userdefinedsnippets#_variables ?

@jmetz
Copy link
Author

jmetz commented Jul 1, 2024

Yeah that looks pretty comparable to other snippet systems I've used before 👍

@GameDungeon
Copy link

Those would be great, especially TM_SELECTED_TEXT which allows for way more powerful snippets.

@estin
Copy link
Owner

estin commented Aug 12, 2024

Hi!

I have take a look on it https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#snippet_syntax

Variable resolving is the task for editor (client side), not for language-server.
I hope after helix-editor/helix#9801 we can use varaibles in templates

For scls we can add feature - snippets as result of shell execution, like :pipe. Helix now allow via keymap configure hot keys for :pipe my-snippet.sh. But scls can give menu as regular snippet and execute on complete/resolve with litle hacks.

@GameDungeon
Copy link

GameDungeon commented Aug 12, 2024

I just checked the code for helix-editor/helix#9801 and tested it (which is the branch I use). It currently implements variable parsing, but it does not seem to have support for any specific variables yet, but the fact it has got that far is good news.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants