Skip to content

Disable recursive globbing for $HOME #277

Closed
@lithammer

Description

@lithammer

When opening a shell script in your home folder (~/foo.sh), bash-language-server starts looking through your entire home directory for files. There are two main problems with this:

  1. It takes forever for the server to start. I have around 2 million files in my home directory, and that's after removing things like node_modules/ which are notoriously big. It takes 2.5 minutes for the server to start on my 2017 MacBook Pro with SSD.

  2. Even after the scan is complete, 99% of the information is going to be irrelevant for the file I'm editing. Getting completion result about Bash variables defined 6 directories down in some repo I cloned 9 months ago just isn't very interesting.

Personally I basically never want recursive globbing, It's just not that interesting. In my experience related shell scripts are usually located in the same directory. But I'll settle with just the home directory.

Now, of course I could just set GLOB_PATTERN and continue with my day. But the problem is the constant issues raised over at https://github.com/neovim/nvim-lspconfig about the bash-language-server not working with Neovim's native language server client. Most of the time it's because they opened some file directly in the home directory and they think it's not working (but it's just busy globbing).

A workaround (neovim/nvim-lspconfig#686) was recently merged try to prevent any such issues. But it would be better if the server itself just handled this more gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions