LuaLS / LuaLS/lua-language-server

use with craftos-pc indexes PC root dir

Open
#2,317 16 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

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?

Other

Expected Behaviour

not index every file on PC by recursively going through root dir

Actual Behaviour

accepts / as valid workspace directory, causing every file on my PC to be indexed

the fix done for #2159 seems to be incorrect - it should not index every file on my PC if I have a CraftOS workspace open. if it can't support the virtual filesystem, it should just ignore it. instead the extension is completely unusable in this configuration when trying to use craftos remote, even with attempting to override the force-accept-workspace parameter to false on user-level in vscode preferences. (maybe this is ignored for some reason? it's defaulted to true so would make sense)
not sure if this is an issue to be made on the vscode-lua extension or the LSP itself!

Reproduction steps
  1. Use CraftOS-PC in a project, and connect to a remote computer in Minecraft
  2. With the vscode-lua extension enabled, watch as every Lua file on PC is indexed because the root dir for the VFS is technically /
Additional Notes

No response

Log File

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the CraftOS-PC remote workspace case from the listed steps with the sumneko.lua Visual Studio Code extension enabled. Start by tracing how the virtual filesystem root / and the force-accept-workspace setting are handled, then verify that opening this workspace no longer recursively indexes the host PC.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.