Skip to content

Code action: convert inline strings to block (and vice versa) #1119

@nyarly

Description

@nyarly

Is your enhancement related to a problem? Please describe.

Our deployments (uncontrollably) convert block strings to long inline strings. When editing the resulting files in the live server, it would be great to be able to reliably convert them back to a block string.

Wrapping long lines to folded scalars would be welcome as well.

Describe the solution you would like

Given

field: "<1000 word novel>"

If the cursor is in the string, invoking code actions should present two options:

  • convert to block scalar
  • convert to flow scalar

Because I assume that sometimes the opposite would be desirable:

field: |
  <100 lines of prose>

If the cursor is in the string, code actions should include:

  • convert to inline scalar

Describe alternatives you have considered

A series of search and replace? Very carefully editing the string without changing it.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Pending review

Relationships

None yet

Development

No branches or pull requests

Issue actions