Give FCS open file contents per checker (DocumentSource) instead of the global FileSystem
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
Direzione di ricerca
Start with the global shim in src/FsAutoComplete.Core/FileSystem.fs and the SharedFileSystem registry in AdaptiveServerState.fs, then trace where FSAC hands open-file text to the FCS checker. The issue sets the goal: create checkers with DocumentSource.Custom, call NotifyFileChanged on did change, did save and close, and keep only the path helpers process-wide. Done means no static server state remains, two servers in one process cannot see each other's open files, and the LSP test groups can run in parallel on shared folders.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
FSAC gives FCS the contents and timestamps of open files through the process-wide FSharp.Compiler.IO.FileSystemAutoOpens.FileSystem. FCS also offers a per-checker way to do this, FSharpChecker.Create(documentSource = DocumentSource.Custom getSource). Moving to it would remove the last piece of shared, process-wide state between language servers in one process.
Today
Every AdaptiveState installs FSAC's FileSystem shim (src/FsAutoComplete.Core/FileSystem.fs) as the global FCS file system. The shim does three things:
OpenFileForReadShimreturns the in-memory text of open files.GetLastWriteTimeShimreturns the time an open file was last changed, which is how FCS notices edits and rechecks.IsPathRootedShim,GetFullPathShimandNormalizePathShimhandle paths in an OS-agnostic way.
Until #1554 each state wrapped the global file system around the previous one and never unwrapped it, so every state ever created stayed reachable. #1554 replaces that with a registry (SharedFileSystem in AdaptiveServerState.fs) that asks each live state for its open files, newest first, and lets a disposed state unregister. That fixes the leak, but the state is still shared: when two servers in one process have the same file open, FCS reads of one can see the text of the other. The test suite runs LSP test groups in parallel since #1554, and has to keep groups that use the same TestCases folder from overlapping for that reason. In the product there is one server per process, so it does not show there.
The alternative
DocumentSource.Custom gives each checker its own source of file text. Two things change with it (FCS main):
- FCS stamps each source file once, when the incremental builder is created, instead of asking for its last write time (IncrementalBuild.fs#L1647-L1653).
- A custom document source switches the checker to change notifications (service.fs#L215-L218), so FSAC has to call
checker.NotifyFileChanged(service.fs#L376) when an open file changes. Today the shim's last write times do this implicitly.
So the work is roughly:
- Create the checker with
DocumentSource.Custom, answering from the state's open files and falling back to disk. - Call
NotifyFileChangedwhere open files change (did change, did save, close), for the BackgroundCompiler. The TransparentCompiler already gets file versions through its snapshots; check whether it still reads through the global file system anywhere. - Keep only the path members (3.) in a process-wide shim, or drop the shim if FCS's defaults are fine there. They hold no per-server state.
- Remove
SharedFileSystem, and let the test suite run groups on the same folders in parallel.
Why
- No server state reachable from a static; the per-server file view lives with the checker.
- Servers in one process cannot read each other's open files.
- Explicit invalidation instead of timestamp comparisons on every file read.
- Lingua principale
- F#
- Stelle
- 488
- Fork
- 172
- Merge medio
- 2g 19h
- PR unite (30g)
- 7
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ionide/FsAutoComplete
-
Running dotnet test test/FsAutoComplete.Tests.Lsp/FsAutoComplete.Tests.Lsp.fsproj directly on a clean repository fails in gotoTestForse già presa @rubin55 l’ha presa 3 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ionide/FsAutoComplete#1559 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Document agentic contribution workflowForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ionide/FsAutoComplete#1540 ·
I maintainer di solito rispondono entro 2 giorni
-
agentic-workflows automation repo-assist
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ionide/FsAutoComplete#1517 ·
I maintainer di solito rispondono entro 2 giorni
-
agentic-workflows automation repo-assist
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ionide/FsAutoComplete#1507 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 63/100
ionide/FsAutoComplete#1547 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di ionide/FsAutoComplete
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
A `--symbolic` entry binding `𝑛3` and `!n3` passes the load check, since `once` compares spellings, and fails mid-run with a `user error`Forse già presa @sherenkov l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
objectionary/phino#1929 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
FuRongJun-1999/dsh-memory#402 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100