Skip to content

File/folder renames where only capitalization changes causes assumed duplication #3478

Open

Description

@fatboychummy

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

When a file or folder is renamed from, for example, test to Test, the language server should not suddenly mark everything as Duplicate-Defined-Field/etc.

Actual Behaviour

Image

All fields within classes are marked as duplicates.

Reproduction steps

  1. Create a file, a.lua.
  2. Open the file so it's an opened tab in the editor.
  3. Rename it to A.lua.
  4. Write a basic class definition into it.
---@class X
---@field Y string
local x = {}

function x.new() end
  1. Observe the bug.

Additional Notes

Windows treats paths containing different capitalization as the same file, unlike linux. a.lua in Windows is the same as A.lua. I believe there is an assumption somewhere that a.lua does not equal A.lua and it causes the language server to bug out.

Log File

I just want to report this then sleep. If nobody else is able to reproduce/get logs, I will do so tomorrow.

Activity

  1. CppCXY commented on Oct 20, 2026

    @CppCXY
    Member

    On Windows, performing a case-only rename in VS Code actually does not take effect at all. It causes VS Code to show two copies—one with the old name and one with the new name—while the file on disk may not actually be renamed, and may even be renamed back by a version control tool. So this is not something a language server can solve, but it can be appropriately addressed at the editor level: first close VS Code, then rename the file on disk, then delete .vscode and reopen VS Code. Only in this way can the effects of this rename be thoroughly cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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