LuaLS / LuaLS/lua-language-server

Diagnostics can become stale when switching between `<module>.lua` and `<module>/init.lua` structures (such as when going back and forth between git branches)

オープン
#2,625 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Lua
スター
4.4k
フォーク
442
PR マージ指標
30日以内にマージされた PR はありません

説明

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

Visual Studio Code Extension (sumneko.lua)

### Which OS are you using?

Linux

### What is the issue affecting?

Diagnostics/Syntax Checking

### Expected Behaviour

Diagnostics should always be performed on the current version of a module that is on disk.

### Actual Behaviour

When switching between two different ways of structuring the same module as described in the title, diagnostics can populate the `Problems` panel in VS Code with information about the version of the module that was on-disk before switching using a mechanism such as `git checkout `

### Reproduction steps

1. Make sure `Runtime Path` includes `?.lua;?/init.lua`
2. Create a module at `foo.lua`, populate it with working Lua code.
3. Create a new `git` branch
4. Refactor `foo.lua` to `foo/init.lua`
5. Various diagnostics will show up in the VS Code Problems Panel, such as duplicate definitions, missing annotations, etc. It almost looks like the LSP is trying to process both files at the same time.

### Additional Notes

_No response_

### Log File

I won't be able to provide logs as this is a proprietary codebase. Apologies.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Reproduce the issue with Runtime Path set to `?.lua;?/init.lua` by switching a git branch from `foo.lua` to `foo/init.lua`, then inspect the VS Code Problems panel for diagnostics from the previous module layout. Compare the diagnostics with the current files on disk; done means only the current module structure is analyzed after the switch.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
lua, vscode
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。