Skip to content

Conversation

datho7561
Copy link
Contributor

@datho7561 datho7561 commented Oct 1, 2025

What does this PR do?

Adds two refactorings that change inline strings (i.e. unquoted, single quoted, double quoted) into block strings. One for folded block string and one for literal block string.

eg. if you have the following

root: "value1\value2"

There are two refactoring actions so that it can be turned into

root: >-
  value1

  value2

or

root: |-
  value1
  value2

What issues does this PR fix or reference?

Fixes #1119

Is it tested? How?

  • Unit tests

@coveralls
Copy link

coveralls commented Oct 1, 2025

Coverage Status

coverage: 84.068% (+0.1%) from 83.956%
when pulling d669f4a on datho7561:1119-convert-inline-block-strings
into 86a61da on redhat-developer:main.

@datho7561 datho7561 force-pushed the 1119-convert-inline-block-strings branch from 64a73c4 to 6269b2d Compare October 2, 2025 21:07
@datho7561 datho7561 force-pushed the 1119-convert-inline-block-strings branch 7 times, most recently from d771362 to 479ad4c Compare October 6, 2025 13:46
Adds two new refactoring actions to turn quoted strings into block
strings.

eg. if you have the following

```yaml
root: "value1\value2"
```

There are two refactoring actions so that it can be turned into

```yaml
root: >-
  value1

  value2
```

or

```yaml
root: |-
  value1
  value2
```

Fixes redhat-developer#1119

Signed-off-by: David Thompson <[email protected]>
@datho7561 datho7561 force-pushed the 1119-convert-inline-block-strings branch from 479ad4c to d669f4a Compare October 6, 2025 13:59
@datho7561 datho7561 changed the title [WIP] Refactoring to change strings into block scalars Refactoring to change strings into block strings Oct 6, 2025
@datho7561 datho7561 marked this pull request as ready for review October 6, 2025 14:11
@datho7561
Copy link
Contributor Author

@nyarly if you have time, do you mind trying this out to see if it works well for you? I think it's mostly working, but there might be some edge cases I haven't considered.

If you need help getting the project set up, free free to ask about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants