meta description の module function 参照も 4.0 以降は ?. で表示する#284
Merged
Conversation
Entry#description_text(meta description など、コンパイラを通さない表示 テキスト)は、[[m:Kernel.#mf]] のような参照からラベルを取り出す際に ".#" をそのまま出力していた。可視ページの参照は bitclust#282/rurema#283 で DB バージョン 4.0 以降は "?." 表示に切り替わるが、この経路だけ ".#" の まま残っていた。 RDCompiler#display_spec と同じく NameUtils.display_typemark を使って、 バージョン 4.0 以降は ".#" を "?." に畳んで表示する。spec・URL・ アンカーキーなどの識別子は不変。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Entry#description_text(meta description など、コンパイラを通さない表示テキスト)は、[[m:Kernel.#mf]]のような module function 参照からラベルを取り出すときに.#をそのまま出力していました。可視ページ側の参照は #282 / #283 で「DB バージョンが 4.0 以降なら
.#を?.で表示する」ようになりましたが、この meta description 用の経路だけ.#のまま残っていました(rurema/doctree で 4.0 のページの<meta name="description">にObjectSpace.#_id2refのような表記が出ていました)。変更内容
Entry#description_textのラベル取り出しで、RDCompiler#display_specと同じくNameUtils.display_typemarkを使い、バージョン 4.0 以降は.#を?.に畳んで表示します。@db.propget('version')。不明な場合は従来どおり.#のままです。EntryはNameUtilsを include していますが、MethodEntry#display_typemark(0 引数)が同名で隠すため、RDCompilerと同様にNameUtils.display_typemark(...)と明示して呼んでいます。テスト
test/test_methodentry.rbに、description に[[m:Kernel.#mf2]]を含むエントリで、3.4 ではKernel.#mf2、4.0 ではKernel?.mf2になることを確認するテストを追加しました。ruby test/run_test.rb: 17807 tests, 0 failures, 0 errorsbundle exec steep check: No type error detectedbundle exec rake sig: 差分なし🤖 Generated with Claude Code