LuaLS / LuaLS/lua-language-server

Plugin ResolveRequire is getting the wrong URI

Open
#3,259 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

### How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

### Which OS are you using?

Windows/Linux

### What is the issue affecting?

Plugins

### Expected Behaviour

Over the [plugins page](https://luals.github.io/wiki/plugins/#resolverequire) it seems to me like ResolveRequire first parameter is the current file the require is being typed at.

### Actual Behaviour

But in reality it seems to be the workspace URI, not the file.

Image

### Reproduction steps

1. Make a new plugin
2. Paste the same code shown in screenshot
3. Type out some `require` statement, you will see the URI of the workspace in the output instead of the `require` statement file.

### Additional Notes

See https://github.com/LuaLS/LuaLS.github.io/issues/48

### 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

Start at the plugin ResolveRequire entry point and compare the URI passed while typing a require statement with the behavior described on the plugins page. Reproduce the issue in the VS Code extension using the screenshot’s plugin example; done means the callback receives the require statement’s file URI rather than the workspace URI.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.