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

Fix snippets for dynamic arrays and maps #303

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

xb-bx
Copy link
Contributor

@xb-bx xb-bx commented Jan 30, 2024

This PR fixes behavior of snippets for dynamic arrays and maps. Also added snippets for slices.

Current behavior:

arr := make([dynamic]int)
// becomes len(arr). it's fine
arr.len~ 
StructWithArray :: struct {
    arr_field: [dynamic]int
}
struc := StructWithArray {}
// becomes len(). should be len(struc.arr_field)
struc.arr_field.len~
return_array :: proc() -> [dynamic]int ---
// becomes len(). should be len(return_array())
return_array().len~ 

This PR fixes all of those cases and also adds snippets(len, for) for slices

@DanielGavin DanielGavin merged commit d7531bd into DanielGavin:master Jan 30, 2024
4 of 6 checks passed
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.

2 participants