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

Method calls via selector operator (->) do not correctly use implicit first parameter in completion/reference checking #112

Closed
GoNZooo opened this issue Jan 3, 2025 · 0 comments
Assignees
Milestone

Comments

@GoNZooo
Copy link
Contributor

GoNZooo commented Jan 3, 2025

The following code is a method on a ^d3d12.IDevice (from the vendor:directx/d3d12 package):

GetDescriptorHandleIncrementSize :: proc "system" (this: ^IDevice, DescriptorHeapType: DESCRIPTOR_HEAP_TYPE) -> u32

When using this with the selector operator in the editor completion will not give correct suggestions based on the parameter being passed in, because it thinks we are currently filling in the pointer to the device, when in fact we are filling in the second parameter (the pointer is passed implicitly):

descriptor_size := device->GetDescriptorHandleIncrementSize(.RTV)

The .RTV value here is recognized incorrectly as an unknown reference because the plugin does not realize that we are filling in the DESCRIPTOR_HEAP_TYPE parameter:
image

If we pass nil as a "first" argument the plugin has now caught up and will actually also give correct completion for the parameter:
image

Completion:
image

@obiwan87 obiwan87 self-assigned this Jan 4, 2025
@obiwan87 obiwan87 added this to the 0.10.0 milestone Jan 7, 2025
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

No branches or pull requests

2 participants