soderlind / vscode-phpcbf

PHP Code Beautifier and Fixer for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=persoderlind.vscode-phpcbf
GNU General Public License v3.0
28 stars 10 forks source link

In 0.0.8, debug fails. `TypeError: console.group is not a function` #14

Open dotZak opened 6 years ago

dotZak commented 6 years ago

With "phpcbf.debug": true in the project settings I get the following in the console under Output > Log (Window):

[2018-02-21 09:53:55.757] [renderer1] [error] console.group is not a function: TypeError: console.group is not a function
    at PHPCBF.getArgs (/Users/zk/.vscode/extensions/persoderlind.vscode-phpcbf-0.0.8/extension.js:73:21)
    at PHPCBF.format (/Users/zk/.vscode/extensions/persoderlind.vscode-phpcbf-0.0.8/extension.js:96:55)
    at Promise (/Users/zk/.vscode/extensions/persoderlind.vscode-phpcbf-0.0.8/extension.js:252:30)
    at Promise (<anonymous>)
    at Object.provideDocumentFormattingEdits (/Users/zk/.vscode/extensions/persoderlind.vscode-phpcbf-0.0.8/extension.js:244:28)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:629:497
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:98:622
    at new n.Class.derive._oncancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:75:657)
    at Object.t.asWinJsPromise (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:98:585)
    at e.provideDocumentFormattingEdits (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:629:451)

This prevents the document from being written while debugging to the console is enabled. Discovered this while trying to figure out a problem with formatting for WordPress standards.

VS Code 1.20.1 (2018-02-13) vscode-phpcbf 0.0.8

soderlind commented 6 years ago

Thanks, I'll remove the call to console.group

btw, what OS etc are you on ?

dotZak commented 6 years ago

macOS High Sierra (10.13.3)

badah commented 6 years ago

Same error here. I'm on Ubuntu 17.10 (artful).

dorian-marchal commented 6 years ago

Same problem on Ubuntu 16.04

garrettw commented 6 years ago

I see this issue still exists. I'm having it on macOS High Sierra (10.13.5) as well.

(Incidentally, I had to turn on debugging because phpcbf wouldn't fix my file at all.)

Could we get a fix for this @soderlind ?

jonty-comp commented 6 years ago

Just tried to set up this extension on High Sierra and encountered the same issue.

sowiso commented 6 years ago

Same here on Ubuntu 18.04