bash-lsp / bash-language-server

A language server for Bash
MIT License
2.16k stars 125 forks source link

local variables which are defined & re-assigned in a function are shown to be accessible globally #1166

Open ShadowCreator250 opened 6 months ago

ShadowCreator250 commented 6 months ago

Code editor

VSCode v1.89.1

Platform

Win10

Version

mads-hartmann.bash-ide-vscode@v1.41.0

What steps will reproduce the bug?

my_function() {
    local _my_var="test"
    _my_var=42
}

$<auto-completion here, e.g. Ctrl+Space>

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

_my_var should not show up in the auto-completion dialog because it was created locally

What do you see instead?

_my_var is shown to be supposedly accessible picture proof

Additional information

expected behaviour is described e.g. here: https://stackoverflow.com/a/22527475