Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Fixed PHP Errors Not Removed From Linter #19

Closed
mikebronner opened this issue Sep 13, 2017 · 16 comments
Closed

Fixed PHP Errors Not Removed From Linter #19

mikebronner opened this issue Sep 13, 2017 · 16 comments

Comments

@mikebronner
Copy link

I noticed that after fixing PHP errors, they are not cleared (most of the time):

php-errors-not-cleared

@damieng
Copy link
Contributor

damieng commented Sep 13, 2017

This could be either of us - it might be the PHP server isn't telling us to clear the diagnostic or it might be it is but we're somehow missing it.

Let me investigate this one before you mention it upstream - I don't want to bug them with errors that turn out to be in our court.

@damieng
Copy link
Contributor

damieng commented Sep 13, 2017

If you're so inclined you might be able to find out the cause yourself. If you open the atom dev tools window and type in atom.config.set('core.debugLSP', true) you can see the messages going back and forth between them (you'll need to restart atom first)

Once you've typed your ; you should see a diagnostics message received that would indicate we should clear the message (or not if it the problem is on the other side) - sometimes it takes a second or two though.

@mikebronner
Copy link
Author

mikebronner commented Sep 13, 2017

Every time I type, I get the following two messages, that don't seem to change (sorry, couldn't figure out how to copy out the complete stack trace, so I took a screenshot):

screen shot 2017-09-13 at 10 35 29 am

@damieng
Copy link
Contributor

damieng commented Sep 13, 2017 via email

@mikebronner
Copy link
Author

Should I report this to language-php as well?

@damieng
Copy link
Contributor

damieng commented Sep 13, 2017

Give me a few days - I'm a little concerned that such an obvious issue wouldn't have gone unnoticed there and I'm wondering if the excessive autocomplete requests I'm sending is messing things up.

I should have a fix out for that this week and then we can re-evaluate on the new version.

@mikebronner
Copy link
Author

Sounds good, @damieng! Thanks again, and please let me know if I can help with any debugging. :) With some guidance I will be happy to take some time to help out.

@mikebronner
Copy link
Author

mikebronner commented Sep 13, 2017

OK, gotta admit to being a Homer here ... doh! I forgot the function keyword in my original use case. The errors went away after fixing that. With the example in the GIF above, the error did go away after about 5 seconds, so it appears the language server has some lag.

@damieng
Copy link
Contributor

damieng commented Sep 13, 2017

oops. Sorry, my knowledge of PHP is stuck in the 4-5 era.

One way to test such scenarios we should have tried is saving the file then restarting - that way it would definitely be showing the latest diagnostics and would have revealed this.

@mikebronner
Copy link
Author

Yea, I did that ... not sure if I mentioned it. The linter errors were showing up immediately after loading the file in the case of the missing keyword

@mikebronner
Copy link
Author

Sorry for the flip-flopping here. The issue re-appeared without me goofing up in syntax. I waited 10 seconds, tried saving, waited again, but it wouldn't go away. I closed the file and re-opened it, and it was gone. Will try to reproduce and look at what the console spits out.

@mikebronner mikebronner reopened this Sep 13, 2017
@mikebronner
Copy link
Author

Watching this some more, it appears to sometimes remove the linter errors relatively quickly after the fix is implemented, but other times may take a LONG time before the language server issues a response. Is this something that could be related to the language server being too busy? There were no messages appearing in the console from the language server during this time of waiting, then all of a sudden a whole bunch of messages flooded in and the linter errors were removed.

@damieng
Copy link
Contributor

damieng commented Sep 13, 2017

Yeah it could just be backed up with all the spurious autocomplete requests.

@mikebronner
Copy link
Author

Was just observing this again... took about 60 seconds for it to actually complete. Will try to record this, but the only messages I got back were textDocumentation/completion messages. ( I guess those are responsible both for linting as well as autocompletion?)

@damieng
Copy link
Contributor

damieng commented Sep 13, 2017

No the completion messages are the ones we are accidently creating far too many of that are probably bottlenecking things.

@mikebronner
Copy link
Author

This appears to be working more smoothly now with the 0.6.6 release. Will close for now until I see it happening again. :) Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants