Skip to content

Require of files from other workspaces #1567

@ghost

Description

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?

Completion

Expected Behaviour

In VSCode with multiple workspaces, it is not possible to require files from other workspaces within a specific workspace.

Example:
br-mw-require-expected
From workspace/F.lua, no other Lua file (except the default ones) can be required.

Actual Behaviour

In workspaces whose names are the start of the names of other workspaces, files from the other workspaces can be required if they return something.

Example:
br-mw-require1
The name of workspace w is the start of the workspaces w1, w2, w3, w35, and workspace. Therefore, all files from these workspaces can be required (because all files return 5).
br-mw-require2
Within the workspace w3 whose name is the start of the workspace w35, w35/G.lua can be required.

Reproduction steps

  1. Open a new folder within VSCode.
  2. Add a new folder to VSCode to create a new VSCode workspace. The name of this second folder must be <name of the first folder><some characters>.
  3. Create a new Lua file within the second folder which returns something, e.g., a number, string or table.
  4. Create a new Lua file within the first folder, and type require(' within this file. The name of the file from the second folder should appear in the code completion.

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions