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
Allow use of integer variables in tasks.json #95866
Comments
This would require that the variable substitution know something about where the variable substitution is happening. Instead, you could very easily write your own command that takes a string lineNumber and converts it to a number before calling the revealLine command. |
Sorry, I'm unsure what this means: doesn't the variable substitution already happen in
The problem is that the command itself wants a vscode/src/vs/editor/browser/widget/codeEditorWidget.ts Lines 579 to 590 in 7c17748
I'm totally aware there are command extensions out there that can service my needs but I don't trust extensions as a rule and prefer to keep those installed to a minimum. In this case a very simple addition would be to convert from string to integer but that may seem too specific. I've not dug any deeper into the code than this but I hand-wave assumed there'd be some higher level point (e.g.
|
@rebornix would you consider changing the reveal line command to handle a string for the lineNumber? |
@alexr00 we can support both |
Verifier, please test that you are not seeing warnings in keybindings editor when adding below
and also it works as expected |
The title of this feature request no longer matches what was actually implemented to close the issue. The feature "Allow use of integer variables in tasks.json" is still not supported. I've verified that "revealLine" now accepts a string argument. |
I'm trying to call
revealLine
from a task input as that allows variable substitution (unlike keybindings):Obviously this fails because the command
revealLine
expects an integer as the first command. It works fine if I substitute"${lineNumber}"
with any old integer.Of course, this is a valid JSON file with no pre-process and I anticipate you want to keep this concept. But it occurs to me that the type matching between strings an integers could be loosened a bit, allowing this conversion. I may be useful elsewhere.
Thanks again for this great tool.
The text was updated successfully, but these errors were encountered: