Skip to content

Conversation

@extern-c
Copy link
Contributor

@extern-c extern-c commented Jan 2, 2026

This PR resolves #1011 by ensuring that constant names with :: (e.g. ::CONSTANT_NAME) can be used to find constants in contexts. Please note that the darkfish and aliki themes do not display links for constants in the constants section (just the names of the constants in a description list), so the changes in this PR just make it possible to cross reference constants. I will create a separate PR to propose changes to the themes.

@extern-c extern-c requested a deployment to fork-preview-protection January 2, 2026 15:25 — with GitHub Actions Waiting
@extern-c extern-c force-pushed the bugfix-1011-cannot-link-to-constant-in-markdown-issue branch from 98d2612 to b48030b Compare January 2, 2026 16:15
@extern-c extern-c requested a deployment to fork-preview-protection January 2, 2026 16:15 — with GitHub Actions Waiting
@tompng
Copy link
Member

tompng commented Jan 2, 2026

What happens in the reproduction code in #1011 is:

  1. find_symbol('TestModule::TEST_CONSTANT') is called.
  2. find_local_symbol('TestModule::TEST_CONSTANT') is called because constant can't be found globally. (I think this is the bug)
  3. Module and constant not found, fallback to method search
  4. Name is treated as method name, decomposed into container part(TestModule) and method name part (::TEST_CONSTANT) (:: means . in here. Math::sin(1) == Math.sin(1))
  5. Method search mechanism somehow calls find_constant_named('::TEST_CONSTANT')

So I think modifying find_constant_named to handle ::TEST_CONSTANT is not the correct fix.
I think we should handle this case in step 1.: find_symbol('TestModule::TEST_CONSTANT') should find constant correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cannot link to constants in Markdown

2 participants