hcl-lang icon indicating copy to clipboard operation
hcl-lang copied to clipboard

Improve rendering of complex types in hover

Open radeksimko opened this issue 2 years ago • 0 comments

Context

Currently we provide relatively inconsistent hover data for various complex types:

Screenshot 2023-04-25 at 15 56 34

i.e. we render nested objects with the appropriate nesting, markdown syntax etc. but we leave all other types to be rendered as "human friendly" names.

variable "test" {
  type = object({
    str = string
    num = number
    bl  = bool

    bar = map(string)
    lst = list(string)
    set = set(string)
    tpl = tuple([number, string])

    baz = object({
      noot = string
    })
  })
}

output "test" {
  value = var.test
}

Proposal

Consider rendering all types as valid typeexpr syntax, e.g. map(string) instead of map of string or list(bool) instead of list of bool.

radeksimko avatar Apr 25 '23 15:04 radeksimko