Skip to content

Commit

Permalink
Merge pull request #586 from cornishon/cornishon/allocator_completion
Browse files Browse the repository at this point in the history
Add `allocator` field completion to dynamic arrays and maps
  • Loading branch information
DanielGavin authored Jan 29, 2025
2 parents a71caaa + 9b3716b commit a694b72
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/server/completion.odin
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,16 @@ append_magic_map_completion :: proc(
return
}

// allocator
{
item := CompletionItem {
label = "allocator",
kind = .Field,
detail = fmt.tprintf("%v.%v: %v", "Raw_Map", "allocator", "runtime.Allocator"),
}
append(items, item)
}

remove_range := common.Range {
start = range.start,
end = range.end,
Expand Down Expand Up @@ -1803,6 +1813,16 @@ append_magic_dynamic_array_completion :: proc(
return
}

// allocator
{
item := CompletionItem {
label = "allocator",
kind = .Field,
detail = fmt.tprintf("%v.%v: %v", "Raw_Dynamic_Array", "allocator", "runtime.Allocator"),
}
append(items, item)
}

prefix := "&"
suffix := ""
if symbol.pointers > 0 {
Expand Down Expand Up @@ -2054,3 +2074,4 @@ swizzle_coord_map: map[u8]bool = {
}

swizzle_coord_components: []string = {"x", "y", "z", "w"}

0 comments on commit a694b72

Please sign in to comment.