Skip to content
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

No information available for variables defined via mapfile, readarray or read #1126

Open
pr3c0g opened this issue Mar 22, 2024 · 0 comments
Open

Comments

@pr3c0g
Copy link

pr3c0g commented Mar 22, 2024

Code editor

neovim

Platform

OS X

Version

5.1.2

What steps will reproduce the bug?

#!/usr/bin/env bash

this_works() {
    files=$(find test_dir/ -type f)
    printf "%s\n" "${files[@]}"

}

this_doesnt_work() {
    mapfile -t files < <(find test_dir/ -type f)
    printf "%s\n" "${files[@]}"
}

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

No response

What is the expected behavior?

Hovering on the variable files on line 11 should show "Variable: files - defined on line 8"

What do you see instead?

Variable: files - defined on line 4

Additional information

Hi there!

It looks like variables defined via mapfile, readarray or read are not detected by bashls.
This happens either with process substitution, or just redirecting from a file.

Maybe I'm missing something and this is the expected behavior, but I couldn't find any issues or info related to this.

Thank you very much for the work you do here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant