scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

Copy string value #335

Open kubukoz opened 1 year ago

kubukoz commented 1 year ago

Is your feature request related to a problem? Please describe.

When working with multiline strings, sometimes you want to move the contents of that string to a file. Or you're trying to send that string as an example to someone, or if working on a compiler you might want to copy it to a file to play with it in your language's tooling.

It would be useful if there was a way to copy a multiline string's value, excluding the margin prefix (usually whitespace and a trailing |).

Describe the solution you'd like

A code action that shows up on string literals with no interpolation: "Copy string literal value". This would put the contents into the clipboard, similar to how you can copy worksheet output in an editor command (e.g. in vscode).

Describe alternatives you've considered

Manually copy-pasting the string and removing the margins. This is an error-prone process, especially if whitespace is significant in the text.

Additional context

No response

Search terms

copy paste