Open x0vr opened 1 year ago
Experiencing this as well with the same setup. Had to disable the prettier extension until this is fixed.
I have the same situation
Same issue but with an HTML file, not only JS
Same issue, size limit seems to be ~100 KB for JS files.
Had this issue with a JS file of 101 KB, problem vanished after refactoring it to 97 KB.
Maybe this is a feature and not a bug, enticing us to use smaller files 😄
I had the same problem 😩
Yep this issue still exists. It's kinda annoying. I had to disable format on save because of this. Is there an estimated date of fixing?
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
Issue still exists, workaround is keeping source files small, which is somewhat painful if I just want to add another test case that thematically belongs into the file that would get too large.
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
Issue still exists
issue still exists
Hi guys, I found this may be a fix, paste this in the settings.json
.
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
yes, very annoying issue
Hi guys, I found this may be a fix, paste this in the
settings.json
."editor.codeActionsOnSave": { "source.fixAll.eslint": true },
doesn't work for me
Hi guys, I found this may be a fix, paste this in the
settings.json
."editor.codeActionsOnSave": { "source.fixAll.eslint": true },
doesn't work for me
Hi, can you try "endOfLine": "auto"
Hi guys, I found this may be a fix, paste this in the
settings.json
."editor.codeActionsOnSave": { "source.fixAll.eslint": true },
doesn't work for me
Hi, can you try "endOfLine": "auto"
I tried with following settings "eslint.codeActionsOnSave.mode": "problems", "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "prettier.endOfLine": "auto"
but always the same behaviour on large files with cursor moving to end of file :-(
Hi guys, I found this may be a fix, paste this in the
settings.json
."editor.codeActionsOnSave": { "source.fixAll.eslint": true },
doesn't work for me
Hi, can you try "endOfLine": "auto"
I tried with following settings "eslint.codeActionsOnSave.mode": "problems", "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "prettier.endOfLine": "auto"
but always the same behaviour on large files with cursor moving to end of file :-(
Hi, my configurasyon file I just added endOfLine auto and fixed, I did not add other configurations. Maybe you should remove other configurations
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
Issue still exists, and is still annoying.
The limit of 100kb (100,000 bytes) seems to be hardcoded in VSCode here.
It would be nice if there was a setting to increase this.
Still exists. Super annoying.
Still Happening
Still happening (up)
Having this issue too, extension is basically unusable right now :'(
The behavior can be reproduced with this document, for example: https://github.com/turbulenz/turbulenz_engine/blob/master/tslib/canvas.ts
-> Just add a line at the beginning and format document => Editor jumps to eof
I think this is a VSCode issue rather than a Prettier one. The same thing happens with other formatters such as CSharpier and the 100k limit is hardcoded in VSCode itself.
How is this still an ongoing thing? I have tried adjusting my settings.json with no luck. I'm moving to Zed, lol
I was able to fix this by setting End of line to auto in prettier settings.
Seems like none of these fixes work, would be useful to be able to extend the size limit for files...
Same problem here...
I have the same issue but with Go's code, I have uninstalled prettier and turn off format on save, not working
Same issue here. It's so annoying. I think it only happens on the Windows version of VSCode.
I was able to fix this by setting End of line to auto in prettier settings.
Fix for me too.
In VSCode settings.json
-> "prettier.endOfLine": "auto"
System info: macOS Sonoma 14.4, VSCode v1.87, Prettier v10.4.0
don't work for me
So this seems to be the issue, at least in my testing. The end of line character in prettier setting must match the document end of line setting.
The end of line character for Prettier is defaults to "LF" if "prettier.endOfLine" isn't specifically set. You can set this to "auto", or you can update the document itself to use "LF" instead of "CRLF". Do this by searching for "Change End of Line Sequence" in the command prompt (CTRL+SHIFT+P). This can also be changed by clicking the CRLF text in the status bar.
Can anyone confirm?
Hi 👋
I think thi behavior occurs since ~Feb 2023. When I configure VSCode to use for instance "editor.defaultFormatter": "vscode.typescript-language-features" , the issue is gone.
I am using "Prettier - Code formatter" v9.10.4
Summary
When formating a huge JavaScript file in VSCode using Prettier as default formatter, everytime (most of the time?) I format the document the editor jumps to the end of the file (last line).
Steps To Reproduce:
Expected result
Document should be formatted and the line position in editor should not be changed.
Actual result
Editor jumps to end of file (last line)
Additional information
Feel free to attach a screenshot.
VS Code Version: 1.75.1
Prettier Extension Version: 9.10.4
OS and version: Win10
Prettier Log Output
Thanks for checking 👍