Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.23k stars 748 forks source link

Expand/Collapse code broken in many places #13892

Open slavizh opened 6 months ago

slavizh commented 6 months ago

Bicep version Bicep CLI version 0.26.170 (e9abaf16a5)

Describe the bug Expand/Collapse code broken in many places

To Reproduce I have already described one of the issues here #13676 . But there are more. Example file:

type foo = {
  @description('''Description
    Some more info

  | column1 | column2 | column3 | column4 | column5 | column6 | column7 |
  |---------|---------|---------|---------|---------|---------|---------|
  | value1  | value2  | value3  | value4  | value5  | value6  | value7  |
  | value3  | value4  | value3  | value4  | value5  | value6  | value7  |
  | value3  | value4  | value3  | value4  | value5  | value6  | value7  |
  | value3  | value4  | value3  | value4  | value5  | value6  | value7  |
  | value3  | value4  | value3  | value4  | value5  | value6  | value7  |
  | value3  | value4  | value3  | value4  | value5  | value6  | value7  |
  | value3  | value4  | value3  | value4  | value5  | value6  | value7  |
  | value3  | value4  | value3  | value4  | value5  | value6  | value7  |

  * test
  * test2

  sasda

  ''')
  a: int
  b: string
  c: bool
}

collapsing description results in:

image

it seems at some places instead of collapsing on the closing sign of the code it collapses based on lines or something.

Additional context Add any other context about the problem here.

anthony-c-martin commented 6 months ago

Implementation note: I think we'd need to implement the "Folding range" LSP handler to support this reliably: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_foldingRange