R: Workspace symbol search shows duplicate results that open read-only editors

オープン 初心者向け
#17,575 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
devtools

調査の方向性

extensions/positron-r/src/provider.tsを読み、R_DOCUMENT_SELECTORS内の2つのパターンセレクターを調べます。変更されたRファイルのGit変更を開き、Quick Openで#を含むシンボルを検索して重複を再現します。両方のセレクターにfileスキームを追加し、検索結果が1件になり、git diffのコピーにこれらのR言語機能が適用されなくなることを確認します。

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

説明

area: kernels lang: r

When an R file has uncommitted git changes and a diff of it is open, searching for a symbol (#name in Quick Open) lists the symbol twice with the same label, e.g. save_pdf R/live.R. One result opens the real file. The other opens a read-only editor showing the HEAD version of the file. Each extra git copy that is open (staged version, other diff views) adds another duplicate.

Steps to reproduce
  1. Open a folder that is a git repo and contains an R file with a function, e.g. R/live.R with save_pdf <- function(x) x.
  2. Edit and save R/live.R so it shows as modified.
  3. Run Git: Open Changes on the file.
  4. Open Quick Open and type #save_pdf.

Expected: one result. Actual: two save_pdf R/live.R results; picking the second opens a locked, read-only live.R with the old contents.

Cause

R_DOCUMENT_SELECTORS in extensions/positron-r/src/provider.ts includes { language: 'r', pattern: '**/*.{r,R}' } without a scheme, so it matches R documents under any scheme. The git: documents that back diff editors are synced to ark, which indexes them as separate files and returns them from workspace/symbol with their git: URIs. VS Code only merges symbols with identical URIs, and the label service shows the git: URI relative to the workspace folder, so both rows look the same.

Ark itself is not doing anything wrong: it only indexes the documents it is sent.

Suggested fix

Add scheme: 'file' to the two pattern selectors in R_DOCUMENT_SELECTORS. This also stops other LSP features (diagnostics, hover, etc.) from running on read-only git copies.

Positron 2026.12.0, ark 0.1.252+519.646f572, macOS.

Originally discovered by @Hadley.

主要言語
TypeScript
スター
4.4k
フォーク
207
平均マージ
1日 16時間
マージ済み PR(30日)
308

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

posit-dev/positron のほかの issue

posit-dev/positron の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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