Resolve `<see cref>` in XML doc comments like C#
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- fsharp
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- F#
- スター
- 4.3k
- フォーク
- 884
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 73
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/fsharp のほかの issue
-
Needs-Triage
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
メンテナーはふだん 2 日以内に返信
-
Semantic classification cache for opened documents is never populated (written to the unopened-documents cache)対応中かも @xperiandri が 69 日前に担当しました。 オープンNeeds-Triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 2 日以内に返信
-
Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dotnet/fsharp#20265 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Bug Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
Needs-Triage
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
from-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
code quality wasm backend
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
nanyx-lang/nanyx#930 ·
メンテナーはふだん 1 日以内に返信
-
mlir
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
llvm/llvm-project#241891 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
arrays bug intrinsic llvm medium priority wrong result
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
`lower_throw!` treats any function whose name contains `jl_error` etc. as a throw (kernel becomes a trap / segfault)対応中かも @sasmith-14 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
JuliaGPU/GPUCompiler.jl#1088 ·
メンテナーはふだん 1 日以内に返信