-
Notifications
You must be signed in to change notification settings - Fork 57
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
Implement lint-as-you-type #35
Comments
@weirdan Have a look at the latest development branch and see if this works ;) |
It appears to be working. I'm a bit worried though because I don't see any code to throttle linting. Wouldn't it cause phpcs to be spawned for every keystroke? As a sidenote, you can use fixed encoding if you're feeding text to PHPCS's stdin, just like Atom's counterpart does: AtomLinter/linter-phpcs#236 (see issue linked from there for rationale). That'll fix #34 with a single line of code. |
@weirdan After doing some tests, I found that change event is throttled at 200ms. See https://github.com/Microsoft/vscode-languageserver-node/blob/master/client/src/main.ts#L534 |
This actually works pretty good for me. |
When will we see 0.8.0 get pushed out? I'd like to see this feature as well. I've currently tweaked my autosave to give me this effect, but it's not preferred. Also, I might point out, that there are some rules that fix whitespace that cause the cursor to go from an indented state back to the start of the line. If this was doing it every 200ms, this feature would be useless since you'd have to start typing then tab in every single line. |
how to install this version? |
@weirdan @oojacoboo @yukulele I've pushed some changes in the development branch. Can you test these changes ? |
I got this running, it appears to be working. Is there anything specific you would like to get tested? |
@ikappas I'm getting Reverted back to 0.7.0 and the issue disappeared and |
@oojacoboo , oh, I had that problem too. Had to cleanup all unversioned/ignored files, then rebuilt the ext & server and then it worked. |
Looks like the
|
Same error here though, after that. |
Try fresh git clone
…On Tue, Oct 31, 2017, 21:51 Jacob Thomason ***@***.***> wrote:
Same error here though, after that. phpcs: Cannot read property 'length'
of null.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgO2qBK4uKffFe-s3kQ-5mHSevTnfHks5sx3o7gaJpZM4L-BaN>
.
|
@oojacoboo Are you following updated instructions found https://github.com/ikappas/vscode-phpcs/blob/develop/README.md ? |
@ikappas yep. |
@oojacoboo win or mac? |
@ikappas mac. It'd be nice if the error output actually told you something helpful. That's a needle/haystack error message output. |
@oojacoboo The error suggests that an array is returned somewhere as null |
@ikappas okay sure. But that doesn't really help much. I don't know if this is within analyzed PHP code, the plugin source, the configuration, etc. It's virtually impossible to track that down, especially since I don't know much about how this plugin works. It is working properly on |
@oojacoboo can you post your phpcs related settings.json config? |
I suspect it's caused by old 'phpcs/server' folder not being cleaned up on build. |
// Optional. The name or path of the coding standard to use. Defaults to the one set in phpcs global config.
"phpcs.standard": "app/vendor/foo/coding-standard/phpcs.xml", |
@weirdan If that is the case then manually delete the server folder and run vscode compile task |
@oojacoboo did you try last suggestion? |
@ikappas I don't know what the "server folder" is. Where is that? |
@oojacoboo phpcs/server |
I just pushed some major new features in
Your feedback is very welcome! |
@ikappas
Also, I think the issue earlier was that I installed 0.8.1 from the |
@oojacoboo Good to hear you got your first error sorted out. I assume that your workspace root is Meanwhile, since your composer is located one level deeper i.e in a folder named "phpcs.composerJsonPath": "bar/composer.json" |
@oojacoboo I fixed the issue when composer.json was not found and pushed the code to |
@ikappas tested the latest commits. No issues here.
And, of course, linting as you type is huge! Let's get this thing deployed! |
The new features sound awesome! When will this be deployed? |
@jclerc Working on multi-root support before releasing 1.0.0 |
I just pushed multi-root support in develop branch that need testing |
I've just pushed 1.0.0-beta.6 on the development branch adding automatic configuration search. This is the last feature for the 1.0.0 release which needs some testing before 1.0.0 launch. |
I just released vscode-phpcs 1.0.0 which supports the VSCode 1.20+ and includes many enhancements most notable of which are:
I would like to give my thanks to all the people that helped track down issues in the previous betas and hope the new features help you get things done easier. On that note, I am closing this issue to properly track any new issues in the new release. If you find this issue persists or any other issue please feel free to open a new ticket for v.1.0.0. |
vscode-phpcs
lints files on save (and load). It's possible to lint unsaved files by feeding file contents to PHPCS on its STDIN. This might provide for more interactive user experience: seeing if you introduced a problem or fixed one without saving the file.You may borrow some implementation bits from AtomLinter/linter-phpcs that implemented this feature.
The text was updated successfully, but these errors were encountered: