LuaLS / LuaLS/lua-language-server

Fringe Use Case: Different environments in different parts of the file

Open
#3,164 0 comments 0 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

This may seem like a ridiculous idea, and it is, but a project I am working with called Recoil Engine has a concept called "gadgets", which run in different contexts ("synced" or "unsynced") which provide different environments based on when the gadget is executed. This is a weird way of doing it, sure, but it's a 20 year old codebase.

My question is if it would be possible to provide LS support for these different contexts by offering some kind of annotation like `--- @context synced` via a plugin to change what is available in different parts of the file.

Relatedly, would it be possible to offer different environments based on filepaths? for example, Recoil's UI stuff would be exposed in `/luaui` but not `/luarules`.

Is it also possible to mark a function as being "virtual"?

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, tests, or entry points are identified. Start by determining whether plugins can provide annotations that change available symbols by context, then assess filepath-based environments and virtual functions; done requires a documented feasibility decision and defined behavior for all three requests.

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.