Extra space added after pasting JSDoc comment
See original GitHub issue- VS Code Version: 1.55.1 (but also 1.55.0 and at least the last one or two minor versions of v1.54)
- OS Version: Windows 10
Code formatting in at least es6 is broken since last 2 or 3 minor versions of Vs Code. It happens a lot since that code aligns completely wrong and out of place while there is nothing wrong with the code. It’s pretty frustrating. This was working fine and without issues before. This is not an issue with some extension as it’s also the case when running without extensions.
The reason for this ‘confused formatter’ seems to be that after copying code with jsdoc, the alignment of the method name is wrong in the pasted fragment and that confuses the formatter for the rest of the code and every time it tries to format it after that paste. BTW in the example below the error-offset is only one space, but it also happens that the alignment skips ‘tabs’ (spaces here) and that makes the code even more misaligned and so unreadable and messed up.
See gif:
Steps to Reproduce:
- Copy code with jsdoc
- Paste code with jsdoc
- See that the method name isn’t alligned as supposed to, but now is aligned to the jsDoc. See that the formatter is confused and keeps messing up.
Does this issue occur when all extensions are disabled?: Yes (see demo)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:17 (6 by maintainers)
Top GitHub Comments
@bencresty: I’ve been on the developer’s side of a big project like this, and I’m therefore sympathetic.
I mostly hope that the visibility of this bug can be raised enough to get it onto the list of things to fix – perhaps even in the November update cycle.
I note that @ssigwart created a PR nearly a year ago that apparently fixes this annoying bug.
@mjbvz: Is there something I or we can do to allow the pending PR from @ssigwart to be approved? A brief description of the obstacle might allow us to help resolve it.
@bencresty, I’m just a contributor with limited repo permissions. I have the same feelings. I have several unreviewed pull requests that I can’t get any traction on. At this point, I’ve stopped contributing because I was just wasting my time. When someone starts responding to my PRs, I’ll start contributing again.