Comments (6)
Maybe the case is needed, so something like:
private def printStatement: Unit = {
stat match {
case _ =>
sb.line { _.append(s"val $fresh = ") }
(true, List(Name(fresh) -> stat.pos))
}
from the mdoc issue?
from scalafmt.
Looks like the same issue in mdoc https://github.com/scalameta/mdoc/pull/849/files
from scalafmt.
@mdedetrich thank you. scalafmt is very much context-sensitive, so could you please double-check that the code snippet you've provided formats incorrectly if put in a small file in its entirety?
your link doesn't load a relevant example for me (starts at the beginning of the diff and can't find anything that contains '{
).
from scalafmt.
@mdedetrich thank you. scalafmt is very much context-sensitive, so could you please double-check that the code snippet you've provided formats incorrectly if put in a small file in its entirety?
your link doesn't load a relevant example for me (starts at the beginning of the diff and can't find anything that contains
'{
).
You seem to be right, with the following scalafmt doesn't remove the line break
object Test {
val g = '{ ((r: R) => $upm.fromProduct(r.asInstanceOf[Product])).asInstanceOf[Any => Any] }
(f, g, elemTpes)
}
Let me create a minimal reproducible sample
from scalafmt.
So this appears to be the quick minimal reproduction
object Test {
Expr.summon[Mirror.ProductOf[U]] match {
case _ =>
val g = '{ ((r: R) => $upm.fromProduct(r.asInstanceOf[Product])).asInstanceOf[Any => Any] }
(f, g, elemTpes)
}
}
The pattern match with case
is necessary here
from scalafmt.
from scalafmt.
Related Issues (20)
- Does scalafmt support automatic removal of unused imports HOT 2
- Too many line breaks when using :: HOT 1
- Inconsistent `extends` alignment with `align.preset = more` HOT 8
- Produces Non-Compiling Code with implicit keyword after colon HOT 2
- How can I make "then" at the end of line, not next line HOT 1
- 3.8.0 breaks lambda functions
- scalafmt fail at parsing \n??? HOT 1
- scalafmt rewrites scala 2 syntax into scala 3 in build.sbt file
- SortModifiers does not follow Scala style guide HOT 3
- 3.8.0 breaks code when the next line starts with a parenthesis HOT 2
- 3.8.0 regression: tuple expression at the start of a line are moved to prior line (inside of match cases) HOT 2
- Scalafmt 3.8.0 update: suspicous reformatting HOT 3
- More newlines in unit tests after updating to 3.8.0 HOT 6
- Exception in scalafmt HOT 1
- Code no longer compiles after formatting HOT 1
- Implement fewer-braces rewrite
- Properly formatted code using zio method `*>` is formatted so the code is no longer valid
- Wrong formatting of code blocks with partial functions returning tuples HOT 2
- apply more stringent scalafmt formatting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalafmt.