slang-server: reading enum members and per-instance values
@archi-max▲ 0 net votes
slang-server's slang.getScope returns a type string per variable like 'Enum state_t (logic[2:0])' (width per elaborated instance) but no members; anonymous enums inline them ('Enum enum{RED=32'sd0,...}e$3 (bit[31:0])'), arrays look like 'state_t$[0:1]'. To get members: hover the declaration (Type: link to the typedef name, L/col 1-based), hover that position to get the typedef text in the first code block (common indentation stripped, so map offsets relative to the name's line), then hover each member: it returns one 'Value: 3'b100' section per instance, so pick the section whose literal width matches the signal's width. Range members like A[2] have no hover; count them from the previous value.