Resolve `<see cref>` in XML doc comments like C#
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
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- fsharp
- Ambito
- compilers, devtools, documentation
Direzione di ricerca
Start by reading the XML documentation flow at XmlDocFileWriter.WriteXmlDocFile and the XML doc ranges from #20637, then inspect XmlDocSigOfVal and the related rename work in #20638. Done means the stated first-cut cref forms resolve against the final environment, emit documentation IDs or !:Text, report FS3390 when unresolved, and support the described editor behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
<see cref="…"/>, <seealso cref>, <exception cref> and <permission cref> in F# /// comments are plain text to the compiler and the IDE:
--doccopies the attribute verbatim (XmlDocFileWriter.WriteXmlDocFile), so<see cref="Parse"/>reaches the.xmlfile asParse. C# writes the documentation ID (M:Ns.Parser.Parse(System.String)), and tools that read the file (DocFX, fsdocs, Visual Studio tooltips of the consuming project) resolve IDs, not source names. The unresolved-cref diagnostic already exists (xmlDocUnresolvedCrossReference, FS3390 group) but is never raised.- In the editor, a cref is not a symbol: Go To Definition does nothing on it, renaming the type or member leaves it stale, and the tooltip prints the raw text.
Describe the solution you'd like
The same as C#, built on the XML doc ranges from #20637:
- The checker resolves each
crefagainst the file's final environment (so it can point forward, as in C#): the enclosing type's members first, then values, types and modules — thenameofresolution order. A resolved cref is reported as a related symbol use of a new kind (RelatedSymbolUseKind.XmlDocCref), opt-in likeXmlDocParameterin #20637, so symbol search is not bloated. --docwrites the documentation ID of the resolved symbol; an unresolved cref is written as!:Textand reported under FS3390. A cref that already carries a prefix (T:,M:, …) is kept as is.- The editor: Rename rewrites the last segment of the cref (#20638 already passes all related kinds to Rename), Go To Definition works on it, and the tooltip shows the resolved name.
A first cut would cover types, modules, union cases, fields, properties, events and non-overloaded methods, and leave M(int) overload syntax, List{T} generics and operators for later.
Describe alternatives you've considered
- Resolving where each doc comment is converted: a type's doc is converted before the rest of its recursive group and its members exist, so forward references would not resolve.
- Producing the IDs during checking:
XmlDocSigOfValneeds the generalized type andValReprInfo, and the IDs are cached on theVal; they have to be made when--docwrites the file.
Additional context
Questions before any code:
- Should Find All References list crefs? C# does; #20637/#20638 keep
<param>names out of it. - Is rewriting the
.xmloutput a compiler change that can go in behind--doc, or does it need a language suggestion first? - Should FS3390 for an unresolved cref stay opt-in, like the rest of that warning?
Related: #20630, #20637, #20638, #15134, #20591.
- Lingua principale
- F#
- Stelle
- 4.3k
- Fork
- 884
- Merge medio
- 2g 11h
- PR unite (30g)
- 73
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un 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 dotnet/fsharp
-
Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
I maintainer di solito rispondono entro 2 giorni
-
Semantic classification cache for opened documents is never populated (written to the unopened-documents cache)Forse già presa @xperiandri l’ha presa 69 giorni fa. ApertaNeeds-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 2 giorni
-
Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dotnet/fsharp#20265 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Bug Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Needs-Triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di dotnet/fsharp
Issue simili
-
from-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
code quality wasm backend
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
nanyx-lang/nanyx#930 ·
I maintainer di solito rispondono entro 1 giorno
-
[mlir][math] math-expand-ops computes math.ctlz wrongly for widths that are not a power of twoApertamlir
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
llvm/llvm-project#241891 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
arrays bug intrinsic llvm medium priority wrong result
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
`lower_throw!` treats any function whose name contains `jl_error` etc. as a throw (kernel becomes a trap / segfault)Forse già presa @sasmith-14 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
JuliaGPU/GPUCompiler.jl#1088 ·
I maintainer di solito rispondono entro 1 giorno