LuaLS / LuaLS/lua-language-server

支持设定某些表成为环境表?

Open
#271 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

我在代码里会给当前环境设置一些其他的fallback表,比如说:

local EnvMeta = {
  __index = function(t, k) return _G[k] or Env[k] end
}

local env = setmetatable({}, EnvMeta)
local chunk = loadfile(filename, "bt", env)

可以支持设置Env里的内容也能出现在全局环境里嘛?

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

No files or tests are named. Start by tracing how the language server models global environments, using the loadfile and setmetatable example in the issue, then clarify the intended configuration and fallback behavior. Done means the requested environment-table contents are recognized in the global environment with coverage for the expected cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.