Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not show error message #132

Closed
elricli opened this issue Oct 21, 2018 · 5 comments
Closed

can not show error message #132

elricli opened this issue Oct 21, 2018 · 5 comments

Comments

@elricli
Copy link

elricli commented Oct 21, 2018

In vs code, phpcs cannot show error message.

VS Code About

Version: 1.28.2
Commit: 7f3ce96ff4729c91352ae6def877e59c561f4850
Date: 2018-10-17T00:20:56.183Z
Electron: 2.0.9
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

php version And phpcs version

image

app.php

<?php

function a()
{
    return '11';

}//end a()
echo(a());

In Terminal
image

In VS Code
image

Output

[Trace - 10:43:02 AM] Sending notification '$/setTraceNotification'.
Params: {
    "value": "verbose"
}


[Trace - 10:43:02 AM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": null
}


[Trace - 10:43:02 AM] Received request 'workspace/configuration - (3)'.
Params: {
    "items": [
        {
            "scopeUri": "file:///home/ayden/Project/php/mvc-demo/app.php"
        }
    ]
}


[Trace - 10:43:02 AM] Sending response 'workspace/configuration - (3)'. Processing request took 1ms
Result: [
    {
        "enable": true,
        "workspaceRoot": "/home/ayden/Project/php/mvc-demo",
        "executablePath": "/usr/local/bin/phpcs",
        "composerJsonPath": "composer.json",
        "standard": null,
        "autoConfigSearch": true,
        "showSources": true,
        "showWarnings": true,
        "ignorePatterns": [],
        "warningSeverity": 5,
        "errorSeverity": 5
    }
]


[Trace - 10:43:02 AM] Received notification 'textDocument/didStartValidate'.
Params: {
    "textDocument": {
        "uri": "file:///home/ayden/Project/php/mvc-demo/app.php"
    }
}


[Trace - 10:43:02 AM] Linting started on: file:///home/ayden/Project/php/mvc-demo/app.php
[Trace - 10:43:02 AM] Received notification 'textDocument/didEndValidate'.
Params: {
    "textDocument": {
        "uri": "file:///home/ayden/Project/php/mvc-demo/app.php"
    }
}


[Trace - 10:43:02 AM] Linting completed on: file:///home/ayden/Project/php/mvc-demo/app.php
[Trace - 10:43:02 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///home/ayden/Project/php/mvc-demo/app.php",
    "diagnostics": []
}

settings

{
    "phpcs.trace.server": "verbose",
    "phpcs.showSources": true
}
@Blake-C
Copy link

Blake-C commented Oct 21, 2018

Looking at your screenshot, this might be similar to the issue I was having in:
#128

If you have basepath in your phpcs.xml file, try removing it and see if that provides the expected output from the plugin: <arg name="basepath" value="./"/>

@elricli
Copy link
Author

elricli commented Oct 21, 2018

Looking at your screenshot, this might be similar to the issue I was having in:
#128

If you have basepath in your phpcs.xml file try removing it and see if that provides the expected out put from the plugin: <arg name="basepath" value="./"/>

Thank you so much, I resolve it by remove <arg name="basepath" value="./"/>

@josephfusco
Copy link

Thank you @Blake-C - I had the same issue & that solved it!

@rizkysyazuli
Copy link

Not seeing any errors either. no <arg name="basepath" value="./"/> in my config. I used the example config from the WordPress Standards example.

I specifically instruct the extension to use the locally installed phpcs:

{
    "phpcs.executablePath": "./vendor/bin/phpcs",
    "phpcs.standard": "WordPress"
}

All the standards also seems to be installed:

$ ./vendor/bin/phpcs -i       
The installed coding standards are PEAR, Zend, PSR2, MySource, Squiz, PSR1, PSR12, PHPCompatibility, PHPCompatibility, PHPCompatibilityParagonieRandomCompat, PHPCompatibilityParagonieSodiumCompat, PHPCompatibilityWP, WordPress, WordPress-Extra, WordPress-Docs and WordPress-Core

@shadyvb
Copy link

shadyvb commented Dec 28, 2019

This helped fix the extension for me, didn't work at all before it:
"phpcs.autoConfigSearch": false,

Discard that, it was one of my included rulesets that also have the basepath arg as well 🤦‍♂

@elricli elricli closed this as completed Mar 27, 2020
yukihiko-shinoda added a commit to yukihiko-shinoda/staticpress-s3 that referenced this issue Jun 18, 2020
Comment out basepath temporary for developing with Visual Studio Code.
@see ikappas/vscode-phpcs#128
@see ikappas/vscode-phpcs#132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants