Skip to content

Command completion doesn't work #1343

@sharpchen

Description

@sharpchen

Code editor

neovim

Platform

Linux

Version

5.6.0

What steps will reproduce the bug?

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

All the time

What is the expected behavior?

Complete for native executables.

What do you see instead?

No completion for native commands
Only shell builtins would appear in completion

Additional information

I didn't know bashls can complete commands until I saw #294.
Not sure whether related but, nixos neither use pkg-config or install bash-completion under /usr/shared, so this might not work:

COMPLETIONSDIR="$(pkg-config --variable=completionsdir bash-completion)"
if (( $? == 0 ))
then
COMPLETIONSRC="$(dirname "$COMPLETIONSDIR")/bash_completion"
else
# Fallback if pkg-config fails
if [ "$(uname -s)" = "Darwin" ]
then
# Running macOS
COMPLETIONSRC="$(brew --prefix)/etc/bash_completion"
else
# Suppose running Linux
COMPLETIONSRC="${PREFIX:-/usr}/share/bash-completion/bash_completion"
fi
fi

And I guess it's because bashls does not search on /home/<user>/.nix-profile/bin(shouldn't it search on $PATH?)
Some executables under /bin are presented in completion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions