feedback
feedback copied to clipboard
Cell formatting stops working when class instance fields are present
Describe the bug When a cell contains a class, and that class contains private class features, formatting seems to stop working.
To Reproduce Steps to reproduce the behavior:
- Create a cell
- Create a class in the cell with a line that should get formatted, and also has a private class feature:
class Test {
#foo = 1;
constructor() {
const veryLongVariableNameRepresenting1 = 1;
const veryLongVariableNameRepresenting2 = 2;
// intially written as a single line
const veryLongVariableNameRepresenting3 = veryLongVariableNameRepresenting1 + veryLongVariableNameRepresenting2;
}
}
- Saving the cell results. The line will not be reformatted.
Expected behavior The last line should be reformatted into two lines.
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome
- Version: 101
I think this is happening with any instance field, right? Does it work if you have:
class Test {
foo = 1;
constructor() {
const veryLongVariableNameRepresenting1 = 1;
const veryLongVariableNameRepresenting2 = 2;
// intially written as a single line
const veryLongVariableNameRepresenting3 = veryLongVariableNameRepresenting1 + veryLongVariableNameRepresenting2;
}
}
Yep, happening with any instance field, not just private. Good catch!