December 27, 2025, 11:48pm 1

In Zig’s standard naming convention (and in many places in std) there is a clear structure:

  • StructName in the declaration of a struct
  • struct_name (or similar lowercase) in usage of that struct

A capitalized CamelCase name signals a type, while the lowercase form signals a value.

For example, inconsistencies like this appear (LSP data):

fn parse(gpa: Allocator, source: [:0]const u8, mode: Mode) Allocator.Error!Ast
(fn (Allocator, [:0]const u8, Mode) error{OutOfMemory}!Ast)

// Go to Allocator | Mode | Ast
// Result should be freed with tree.deinit() when there are
// no more references to any of the tokens or nodes.

or this (LSP data):

fn deinit(tree: *Ast, gpa: Allocator) void

// (fn (*Ast, Allocator) void)

// Go to As...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help