R: Workspace symbol search shows duplicate results that open read-only editors
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- devtools
Research direction
Read extensions/positron-r/src/provider.ts and inspect the two pattern selectors in R_DOCUMENT_SELECTORS. Reproduce the duplicate by opening Git changes for a modified R file and searching for a symbol with # in Quick Open. Add the file scheme to both selectors, then confirm the search returns one result and git diff copies no longer receive these R language features.
Written by the indexing model from the issue text.
Description
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
- Open a folder that is a git repo and contains an R file with a function, e.g.
R/live.Rwithsave_pdf <- function(x) x. - Edit and save
R/live.Rso it shows as modified. - Run Git: Open Changes on the file.
- 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.
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 207
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 308
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from posit-dev/positron
-
area: assistant area: ui
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
accessibility area: plots area: ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area: plots area: ui bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Memory meter counts page cache as used memory under a cgroup limitPossibly taken @jmcphers claimed this 10 days ago. Openarea: workbench bug memory-use support
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
posit-dev/positron#17414 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
area: remote host bug support
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
posit-dev/positron#17249 · 1 comment ·
Maintainers usually reply within 1 day
All issues in posit-dev/positron
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Vessel9817/onion-site-template#512 ·
Maintainers usually reply within 1 day
-
nightly-tests
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BlackBeltTechnology/pi-agent-dashboard#1256 ·
Maintainers usually reply within 1 day
-
approved
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fritzprix/libr-agent#3266 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
better-auth/better-auth#13101 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day