java-language-server icon indicating copy to clipboard operation
java-language-server copied to clipboard

Fix language server crash when it encounters a file that is not UTF-8

Open AaronAsAChimp opened this issue 2 years ago • 4 comments

This PR fixes the crash by ignoring any file that throws an encoding exception while its being read.

AaronAsAChimp avatar May 26 '23 17:05 AaronAsAChimp

Can you add a test?

georgewfraser avatar Jul 06 '23 04:07 georgewfraser

Sure, I added the test.

AaronAsAChimp avatar Jul 06 '23 17:07 AaronAsAChimp

Tests are failing @AaronAsAChimp can you check that out?

georgewfraser avatar Jul 07 '23 16:07 georgewfraser

Yes, so this appears to be because FileStore doesn't get reset between tests. I've added a method to reset it, and reset it when the language server is reset in the test fixture.

AaronAsAChimp avatar Jul 07 '23 23:07 AaronAsAChimp