Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert pipe character | when editing multiline strings with stringMargin #859

Closed
olafurpg opened this issue Jun 21, 2019 · 1 comment
Closed
Labels
feature-request Used for feature requests
Milestone

Comments

@olafurpg
Copy link
Member

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

When editing multiline strings with .stripMargin it's currently necessary to manually type the | character and indent it.

Describe the solution you'd like

It would be nice if Metals inserted the | character at the correct indentation as we type, the same way it works in IntelliJ.

2019-06-21 20 15 30

Describe alternatives you've considered

In the PR scalameta/metals-vscode#121, we added basic support for similar functionality in the VS Code extension. This solution has several limitations however:

  • it triggers even when editing outside multiline strings

2019-06-21 20 05 30

  • it doesn't auto-insert | for copy-pasted multiline code

2019-06-21 20 11 00

  • it only works for VS Code

Additional context

In LSP there is a textDocument/formattingOnType request that allows us to produce the same behaviour that allows us to implement this analysis on top of tokens and make it work for all editors.

@tgodzik tgodzik transferred this issue from scalameta/metals-feature-requests Aug 9, 2019
@tgodzik tgodzik added the feature-request Used for feature requests label Aug 9, 2019
@tgodzik tgodzik added this to the Metals v0.8 - Cobalt milestone Aug 16, 2019
@mzarnowski
Copy link
Contributor

partially fixed by #865

What is still missing is inserting "|" when copy-pasting inside a multiline strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Used for feature requests
Projects
None yet
Development

No branches or pull requests

3 participants