Skip to content

perf: cache all info nodes by range along with variables' types - #235

Merged
david-christiansen merged 7 commits into
mainfrom
sfl-local
Aug 24, 2026
Merged

perf: cache all info nodes by range along with variables' types#235
david-christiansen merged 7 commits into
mainfrom
sfl-local

Conversation

@david-christiansen

Copy link
Copy Markdown
Collaborator

The local info table now stores all info, rather than just tactic info, reducing the number of traversals. Positioned syntax now looks in this table rather than traversing the tree.

The signature cache also now has cached types of metavariable-free signatures.

The local info table now stores all info, rather than just tactic
info, reducing the number of traversals. Positioned syntax now looks
in this table rather than traversing the tree.

The signature cache also now has cached types of metavariable-free
signatures.
The type shown for a variable occurrence comes from that occurrence's own
elaboration context: linked binders can differ in type across contexts, and
the rendering depends on the names in scope and the pretty printer options
in force at the occurrence.
A variable occurrence's hover is rendered from its fully instantiated
type, the names in the occurrence's local context, and the
pretty-printing context. The cache key consists of exactly these
inputs, so linked occurrences of a binder whose types differ (such as
the branches of a dependent if) each show the type from their own
context. Types that still contain metavariables render fresh at each
occurrence.
The names in a constant's hover signature abbreviate according to the
namespace and open declarations in force where the constant is
mentioned.
A constant's signature renders under the options, namespace, and open
declarations of the occurrence being hovered, so the cache key pairs
the constant's name with a hash of that context. Commands whose
contexts agree still share the rendering work across a batch.
Up to and including 4.5, ppSignature renders only a declaration's
type, without its name and binders, so the expected strings don't
apply there.
@david-christiansen
david-christiansen enabled auto-merge (squash) August 24, 2026 08:29
@david-christiansen
david-christiansen merged commit fda188f into main Aug 24, 2026
56 checks passed
@david-christiansen
david-christiansen deleted the sfl-local branch August 24, 2026 09:05
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.

1 participant