LuaLS / LuaLS/lua-language-server

[Question / Feature Request] Disable global variable

Open
#990 3 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

I have a problem when concerning the lpeg library. The re module has a conditional if that defines re globally if and only if the version is Lua 5.1. However since it is global, the automated add require path won't trigger (e.g. on version 5.3). My first idea was to disable the global variable. This doesn't seem possible. Any suggestions?

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

Start by reproducing the lpeg re module behavior under Lua 5.1 and 5.3, focusing on its conditional global definition and the automated require path. Then inspect how the language server handles globals and require suggestions. Done means the intended behavior for disabling the global re variable is decided and documented, with Lua 5.1 compatibility and Lua 5.3 require detection addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.