Skip to content

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

@thepigeongenerator

Description

@thepigeongenerator

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions