LuaLS / LuaLS/lua-language-server

"Save as" can cause "duplicate defined alias"

オープン
#2,745 コメント 0 件 リアクション 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?

Windows

What is the issue affecting?

Annotations

Expected Behaviour

"Save as" should clear the cached aliases from the previous file (in the case of no workspace/folder)

Actual Behaviour

With a new window with no workspace, when I used "save as" I noticed the aliases from the file were still being used, causing a conflict duplicate defined alias with the newly named file. See repro steps.

image

Reproduction steps
  1. Start with a new window, no workspace, etc
  2. Create a new file, e.g., "test.lua"
  3. Add some code and save the file ( --@alias id integer\n )
  4. "Save as" test_2.lua
  5. (Optional) You may need to repeatedly "Save as" (e.g., test_3.lua) to trigger the bug, I couldn't 100% repro
  6. Observe Duplicate defined alias id

Reload editor to clear error

Additional Notes

This is an edge case, as typically you'd have an workspace or folder open (in which case 'save as' should keep the previous file cached also).

Log File

No response

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

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

はじめの一歩

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

調査の方向性

ソースファイルもテストも指定されていません。まず、新しいウィンドウを開き、ワークスペースなしの状態で Visual Studio Code 拡張機能における問題を再現し、その後 Save as の処理とキャッシュされたアノテーションエイリアスを追跡してください。完了条件は、Save as 操作を繰り返しても定義済みエイリアスの重複が報告されず、記載されたワークスペースの動作が維持されることです。

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

評価

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

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

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