ccls icon indicating copy to clipboard operation
ccls copied to clipboard

member alignment, byte size / total alignment and bytesize tooltips.

Open thepigeongenerator opened this issue 5 months ago • 0 comments

There is a feature within clangd that allows me to view the byte size via the textDocument/hover method. where this is the response I get:

{
	"id": 5,
	"jsonrpc": "2.0",
	"result": {
		"contents": {
			"kind": "markdown",
			"value": "### struct `conf_fstr`  \\n\\n---\\nSize: 16 bytes, alignment 8 bytes  \\nfor outputting a fixed string as this config field  \\n\\n---\\n```cpp\\nstruct conf_fstr {\\n}\\n```"
		},
		"range": {
			"end": {
				"character": 16,
				"line": 36
			},
			"start": {
				"character": 7,
				"line": 36
			}
		}
	}
}

note the value string where it specifies the size and alignment.

I hope this was helpful.

thepigeongenerator avatar Jul 21 '25 08:07 thepigeongenerator