bashsupport-pro
bashsupport-pro copied to clipboard
variable braces
Hi,
We're using the variable expansion recommendation from Google (https://google.github.io/styleguide/shellguide.html#variable-expansion, e.g. prefer "${var}" over "$var") and BashSupport Pro does not automatically closes braces, neither manual (after you write the variable name entirely) or automatically (you pick one from list).
Is this intended?
Thanks.
@jobace78 What exactly are you typing? That would help me understand if it's intentional.
Typing ${ is supposed to add the closing } to make it ${} with the caret in between {}. That's controlled by Settings > Editor > General > Smart keys.
Or would you expect that ${myVar} is inserted if you pick $myVar from the completion popup if Google Code style is enabled?
Hi,
I'm unable to reproduce within an empty file but within a complex one.
I'm trying something like this:
VAR1="value1"
echo "VAR1 = ${"
When I enter the first brace should insert the paired bracket, but it's not working. I switched to the bundled Shell Script plugin and it works as intended.
Can I post a clip? A picture is worth a thousand words...
Typing ${ should always expand to${} where ${var} is valid.
Sure, you can post a clip.
This sounds like there may be a parsing error before the location where you're typing, but I should see that in the clip.
https://github.com/BashSupport-Pro/bashsupport-pro/assets/1135365/029509b9-a013-459a-a449-80b5edf4c9ad
@jobace78 Thanks! This is supposed to work in both complex and simple, so it seems like a bug.
Is complex showing any syntax errors after enabling Settings > Languages & Framework > BashSupport Pro > Highlight errors in shell scripts? If it does, could you post a screenshot of the error and its context?
How many lines does file complex have?
Are complex and simple in the same project?
Hi,
complex file does not have any errors, only a few warnings ("Missing function comment" to be precise).
It's about 1k lines.
Both scripts are in the same project.
Hope it helps.
Thanks.
That's a bit weird, because it's all pretty much standard. But I'll try to reproduce and fix this...
Okay, I'm able to reproduce this. It's a bug to be fixed for the next update.
Okay, I've fixed this for the next update.
Version 4.1.1 with a fix is now available.