Skip to content

Conversation

@ChrisPenner
Copy link
Member

@ChrisPenner ChrisPenner commented Dec 5, 2025

Overview

Internal ticket

Adds the fully-qualified-name to the rendered syntax text JSON.

  • This is helpful for including in things like the hover-help; but also lets us generate correct hyper-links by name, not just by hash.
  • Linking by name is typically faster (due to implementation reasons) and it's a better UX to have the name in the URL rather than a hash.
  • It also guarantees that the name we render actually matches the name the user clicked on (in cases where there are multiple names for a hash).
  • It also allows us to know when a given hash is in a specific library by name alone, which Share can use to avoid needing to crawl through libs to find it.
  • It's also less prone to breakage when linking to branch heads without a pinned causal hash. If the causal hash is pinned, then it uniquely identifies a given term.

Implementation approach and notes

Just adds a new fqn key to the JSON for TypeReference, DataConstructorReference, AbilityConstructorReference, TermReference syntax text elements. It's a little awkward it's not in contents or w/e, but can't do that and still be back-compatible. It's fine as is IMO
This value will be null if a given hash doesn't have a name in scope. Possibly also when using old cached syntax texts; but we can choose to clear the old caches if desired.

Test coverage

  • Updated the output of the api transcripts.

@ChrisPenner ChrisPenner requested a review from hojberg December 5, 2025 00:56
@ChrisPenner ChrisPenner marked this pull request as ready for review December 5, 2025 00:56
@aryairani aryairani merged commit d0f3021 into trunk Dec 5, 2025
22 checks passed
@aryairani aryairani deleted the cp/syntax-text-fqn branch December 5, 2025 02:32
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.

4 participants