Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Removing and re-adding database with same folder path does not work properly

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

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

評価

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

調査の方向性

VS Code 拡張機能のデータベースの削除と再追加のフローから始め、番号付きの再現手順を使って古い状態を確認します。データベースを再作成した後に codeql-zip-archive エラーを再現し、その後、以前のデータベースの状態を保持せずにソースファイルとクエリ結果を再度開けることを確認します。

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

説明

bug VSCode

Version
Extension 1.4.5
CodeQL CLI 2.5.1

Describe the bug
Removing a database after having run queries on it and viewed ASTs and then re-adding a different database at the same file system location (e.g. because you made changes to the source code and then created the database again) prevents browsing the source code of that database.

To Reproduce

  1. Create a folder test-db
  2. In that folder create a Test.java file with this content:
    class Test {
    }
    
  3. Run
    codeql database create --language=java --source-root=. "--command=javac *.java" db
    
  4. In VSCode add the test-db/db folder as database
  5. Run any query, e.g.:
    import java
    
    from Class c
    where c.fromSource()
    select c
    
  6. Click on the result to open the .java source
  7. Run "View AST"
  8. Optional: Close the .java file and remove the AST view and the query result from the list
  9. Use "Remove Database"
  10. Make a change to the Test.java file:
    class Test {
        void someMethod() { }
    }
    
  11. Delete the test-db/db folder and create the database again:
    codeql database create --language=java --source-root=. "--command=javac *.java" db
    
  12. In VSCode add the database again
  13. Run any query again, and click on the result
    ❌ Nothing happens; the CodeQL Query Server output contains:
    Unable to handleMsgFromView: cannot open codeql-zip-archive://1-51/#REDACTED#%5Ctest-db%5Cdb%5Csrc.zip/#REDACTED#/test-db/Test.java. Detail: Unable to read file 'codeql-zip-archive://1-51/#REDACTED#\test-db\db\src.zip/#REDACTED#/test-db/Test.java' (Error: unexpected end of file)
    
    Similarly, clicking on the Test.java source file in the files explorer of VSCode causes a similar error.

Note: Steps 5 - 8 (inclusive) might not be needed to reproduce this.

Expected behavior
When re-adding a database for which a database with the same folder path existed previously, all state of that previous database should be removed.

Removal of previous database state could happen either when the database is removed, or when a database with the same folder path is re-added. Maybe it would be better to only perform this when re-adding the database (instead of on removal) to allow the user to still view some information after the database has been removed (might be useful when importing test databases).

主要言語
TypeScript
スター
539
フォーク
240
平均マージ
2日 18時間
マージ済み PR(30日)
37

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

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

はじめの一歩

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

github/vscode-codeql のほかの issue

github/vscode-codeql の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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