prettier / prettier-vscode

Visual Studio Code extension for Prettier
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
MIT License
5.04k stars 446 forks source link

Format Document not working with Prettier 1.8.x and VS Code 1.31.1 #726

Closed elewin closed 4 years ago

elewin commented 5 years ago

I have just updated VS Code to 1.31.1, and the "Format Document" option no longer works with Prettier, it basically does nothing at all. I can however invoke Prettier by highlighting a selection and calling Format Selection.

I'm also able to get Format Document to work with other extensions such as Beautify, but with Prettier it doesn't seem to work at all.

I'm running VS Code 1.31.1 with Prettier 1.8.1

I tried rolling back to 1.8.0, and had the same problem. However, after rolling back to Prettier 1.7.3 it started to work again.

Jupiterrr commented 5 years ago

I had the same problem. Rolling back to 1.7.3 fixed it.

erickbennett commented 5 years ago

I had the same problem. Rolling back to 1.7.3 fixed it.

Ditto.

a118n commented 5 years ago

+1

deangoku commented 5 years ago

I roll back to 1.7.3, still not working

WeiShengv99 commented 5 years ago

I had the same problem, its so sad😢

PrimarchAlpharius commented 5 years ago

Suddenly stopped working for me in version 1.8.1 and I don't use any other related plugins. Works fine when reverted to 1.7.3.

CiGit commented 5 years ago

Can you look at your developer Console? Help -> Toggle Developer Tools

elewin commented 5 years ago

Ok, what should I be looking for?

songguangyu commented 5 years ago

+1

iamwillpowell commented 5 years ago

Same problem vs code 1.32.1 with prettier 1.8.1 doesn't work, prettier 1.7.3 works fine.

iamwillpowell commented 5 years ago

console error:


log.ts:173   ERR prettierInstance.getSupportInfo is not a function: TypeError: prettierInstance.getSupportInfo is not a function
    at getSupportLanguages (/Users/williampowell/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/utils.js:43:29)
    at Object.getParsersFromLanguageId (/Users/williampowell/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/utils.js:11:22)
    at /Users/williampowell/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:46:40
    at Generator.next (<anonymous>)
    at __awaiter (/Users/williampowell/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:7:71)
    at new Promise (<anonymous>)
    at __awaiter (/Users/williampowell/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:3:12)
    at format (/Users/williampowell/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:40:12)
    at PrettierEditProvider._provideEdits (/Users/williampowell/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:158:16)
    at PrettierEditProvider.provideDocumentFormattingEdits (/Users/williampowell/.vscode/extensions/esbenp.prettier-vscode-1.8.1/out/src/PrettierEditProvider.js:152:21)
    at define.provideDocumentFormattingEdits.a.asPromise (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:566:40)
    at t.asPromise.Promise (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:48:58)
    at new Promise (<anonymous>)
    at Object.t.asPromise (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:48:32)
    at D.provideDocumentFormattingEdits (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:566:11)
    at define.$provideDocumentFormattingEdits._withAdapter.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:580:768)
    at $._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:575:502)
    at $provideDocumentFormattingEdits (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:580:746)
    at h._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:593:118)
    at h._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:592:777)
    at h._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:591:383)
    at h._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:590:279)
    at define.constructor._protocol.onMessage.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:588:565)
    at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
    at e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:39:64)
    at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
    at s (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:168:754)
    at Socket.define.constructor._socketDataListener.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:168:960)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:279:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onread (net.js:636:20)
iamwillpowell commented 5 years ago

Sorry, I updated to the latest stable prettier version in package.json and the current version of the extension works without problem.

janzenz commented 5 years ago

Using the latest prettier doesn't work. I reverted back to prettier@1.7.3 fixed it for me.

upupming commented 5 years ago

Thanks for that information, I have to revert to an old version, too.

ucod3 commented 4 years ago

Still not working: VS Code - 1.36.0 Prettier - 1.9.0

fpkpmg commented 4 years ago

I was having this issue. I enabled Tslint Integration in VS code settings which resolved the issue for me.

Screen Shot 2019-07-10 at 2 05 40 pm
jannikbuschke commented 4 years ago

For me VS code does not apply prettier formatting on save: VS Code - 1.36.1 Prettier - 1.9.0

Lokua commented 4 years ago

same as above, only thing I see in console after save is: WARN Aborted format on save after 750ms

mrTurkay commented 4 years ago

does not format documents.

vscode: 1.36.1 prettier: 1.9.0

hansena commented 4 years ago

setting prettier.eslintIntegration to false resolved this for me... vscode: 1.37.0 prettier: 1.9.0

pxjiang commented 4 years ago

I set Default Formatter to null to solve the problem.

ntotten commented 4 years ago

Is this still happening in version 2.0.0?

no-response[bot] commented 4 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.