Skip to content

Implement template parameter resolution for type completions#797

Open
bangbangsheshotmedown wants to merge 1 commit intodlang-community:masterfrom
bangbangsheshotmedown:templates
Open

Implement template parameter resolution for type completions#797
bangbangsheshotmedown wants to merge 1 commit intodlang-community:masterfrom
bangbangsheshotmedown:templates

Conversation

@bangbangsheshotmedown
Copy link

- vibe coded -

Implement template parameter resolution for type completions

When completing members of templated types (e.g., Data!Vec2), DCD now resolves template parameters (T) to their concrete arguments (Vec2), providing accurate type information for autocomplete suggestions.

Changes:

  • Add templateInstantiation lookup kind to track template instantiations
  • Parse template arguments from TypeIdentifierPart AST nodes
  • Store template arguments in TypeLookup for use in type resolution
  • Implement resolveTemplateInstantiation() to substitute template parameters
  • Add tc_templates test case to verify template resolution

Fixes: Code completion for templated structs/classes where members use template parameters in their type declarations.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Thanks for your Pull Request and making D better!

This comment will automatically be updated to summarize some statistics in a few minutes.

@bangbangsheshotmedown
Copy link
Author

Failures seems unrelated to the PR

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