LuaLS / LuaLS/lua-language-server

Inject library paths at runtime

Open
#2,330 1 comment 3 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

Is there any way to pass library paths dynamically at runtime e.g. via environment variables like LUA_PATH?

My use-case is that I want to create an isolated development environment with Nix. Nix paths are hashed (/nix/store/rhb22df25vwdq5fr5dba8w873qciqgmg...) so they can change at any time, making static configs like .luarc.json ineffective.

Ideally, the server can pick up the current lua executable in the PATH and automatically detect all the libraries (this is how it works with pyright). Is this currently possible?

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 source file, test, or entry point is named. Start by tracing how library paths and configuration are resolved, then inspect whether the server reads runtime environment variables or discovers the Lua executable; done means supporting the requested dynamic paths or documenting the existing limitation with tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.