Skip to content

Line with just a space in gitignore causes whole project to be ignored #3458

Description

@vaisest

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

An empty space (literally just ) along with "Lua.workspace.useGitIgnore" : true being set seems to be causing my whole project to be ignored.

Actual Behaviour

I'd expect it to be ignored. The .gitignore docs (https://git-scm.com/docs/gitignore#_pattern_format) say:

Trailing spaces are ignored unless they are quoted with backslash ("").

Reproduction steps

  1. Assign global in a.lua: x = 100
  2. Add .gitignore with empty space character
  3. See below:
Image

Removing the .gitignore file fixes the issue.

Additional Notes

No response

Log File

No response

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