Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

References to use statements aren't being resolved properly by mcdoc yet #1154

Closed
NeunEinser opened this issue May 17, 2024 · 2 comments · Fixed by #1193
Closed

References to use statements aren't being resolved properly by mcdoc yet #1154

NeunEinser opened this issue May 17, 2024 · 2 comments · Fixed by #1193
Assignees
Labels
✨ feature New feature or request /mcdoc
Milestone

Comments

@NeunEinser
Copy link
Contributor

image
image
image

The use statement itself is properly resolved to the definition, but when referencing it somewhere, you get a reference with the same name but the path of the current module.

This eventually leads to options.context.symbols.query(ctx.doc, 'mcdoc', '::java::data::predicate::Predicate') being resolved as a union of (::java::data::predicate::LootCondition | [::java::data::predicate::LootCondition]) which itself is not a valid mcdoc reference.

use super::loot::LootCondition

type Predicate = (LootCondition | [LootCondition])
dispatch minecraft:resource[predicate] to Predicate
@NeunEinser NeunEinser added ✨ feature New feature or request /mcdoc labels May 17, 2024
@NeunEinser NeunEinser added this to the Release 4.0.0 milestone May 17, 2024
@SPGoding
Copy link
Member

This is intentional, so when you Ctrl+click LootCondition it goes to the use statement first, and Ctrl+click again goes to the actual definition. The use statement introduces the referenced symbol into the current scope under a new symbol path and is a valid reference.

@NeunEinser
Copy link
Contributor Author

In that case, the use statement fails to create a reference. In the registry, the lookup of ::java::data::predicate::LootCondition yields no result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request /mcdoc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants