BashSupport-Pro / bashsupport-pro

Public issue tracking for BashSupport Pro. This is a plugin, which provides advanced support for Bash scripts for JetBrains IDEs.
https://www.bashsupport.com
48 stars 2 forks source link

Variables with unset Cannot Be Auto-Completed #184

Closed mylovesaber closed 1 week ago

mylovesaber commented 1 month ago

Code outside function

aaa=q
echo 

When you type $a after echo, BSP will show $aaa image

GOOD


If you do this first:

aaa=q
echo 
unset aaa

When you type $a after echo, BSP will show $aaa image

GOOD


Code inside function

f1(){
aaa=q
echo 
}

When you type $a after echo, BSP will show $aaa image

GOOD


If you do this first:

f1(){
aaa=q
echo 
unset aaa
}

When you type $a after echo, BSP will NOT show $aaa image

BAD

jansorg commented 1 month ago

Thanks! I can confirm that this is a bug.

jansorg commented 1 month ago

I've fixed this for the next update, but it'll take a bit until that's available (4.3.2 was just released).

jansorg commented 2 weeks ago

4.4.0 with the fix is now available. Please let me know if the new version is not working as expected.

mylovesaber commented 2 weeks ago

Version: 4.4.0.243 seems not fixed yet.

Some spaces before "echo" is not the problem. If I define a variable and unset it before using it, then I use this variable between definition and unset line. BSP will not recognize this variable. image

jansorg commented 2 weeks ago

@mylovesaber I'm sorry, you're right that this isn't fixed. I'll double-check why this particular case isn't working with the fix I made and I'll get this fixed for the next update.

jansorg commented 2 weeks ago

I've finally fixed this for the new update. Completion outside a function is already fixed in 4.4.0, but it wasn't fixed inside a function definition. I'll let you know when the update is available.

jansorg commented 1 week ago

Version 4.5.0 with the fix is now available. Please let me know if it's still not working as expected. Thank you for your patience!