Allow adding special variables to languages.toml #10268
Replies: 2 comments
-
#6979 |
Beta Was this translation helpful? Give feedback.
-
I don't really think we should offer an interpolation syntax like that. This sort of thing is what I would expect the plugin system/scheme config to cover. Otherwise it's going to be a cat and mouse game of people wanting a slightly different interpolation variable that we need to add. It would also become potentially quite complex because we would need to figure out when these variables changes and potentially restart language servers (or reload gramamrs?). That kind of thing shouldn't happen automatically. If it's done imperative it's clear it doesn't happen on its own and the user needs tor existed event hooks if they do want it to happen automatically (and if they don't they don't need to). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was looking over issues and couldn't find anything similar so i hope I'm not duplicating anything because I love this editor and I don't wanna slow down the progress for anyone.
Anyway, in vscode launch.json you can add variables to certain values. This is especially useful for setting up debugging scenarios. Here is the languages.toml for a rust project of mine (a bit abbreviated):
As you can see, I have to reference a binary from
target/debug
and also a config file in a directory relative to the repository root. This is a bit annoying because if I start helix from a subdirectory of my repository (a Rust workspace for example) I cannot debug this binary because it tries to find it from the directory i started in. If helix had something similar to vscode my languages.toml would look like this:This is just a suggestion, but I found that handlebars is a good way to add this kind of functionality in personal projects. It may be a bit of overkill for this, but it is a pretty well known format and easy to add to a project. I'd even be interested in adding this functionality in a PR if someone could point me to where config is loaded in helix.
Beta Was this translation helpful? Give feedback.
All reactions