-
Notifications
You must be signed in to change notification settings - Fork 185
phpDocumentor throws random RuntimeExceptions (TypeResolver failing all the time, Language Server not starting) #753
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
Comments
Apparently the phpDocumentor throws RuntimeException if there is typo or something in the doc block. Pretty bad but it can be fixed like this: https://github.com/felixfbecker/php-language-server/blob/master/src/DefinitionResolver.php#L167
to
|
Here is a pull request: #756 |
Note, the phpDocumentor puts a message to RuntimeException: E.g. 'A type is missing before a type separator' or 'Unexpected type separator' or 'Unexpected nullable character' Maybe this could shown to user as warning if the line number can be extracted somehow. It's not a reason however to stop the whole thing from working. |
I have a similar thing going on with mine. They're RuntimeExceptions, but different errors from what you're showing. They're essentially parsing errors on the doc blocks. Adding RuntimeException to the catch as shown above seems to quiet things down and keep the Output console from popping up on its own, but it would be nice to show these as warnings in the Problems console instead. I'm just not sure about the implications (or perhaps even the wisdom) of combining phpDocumenter errors with PHP errors. |
Warnings would be nice, but the whole phpDocumentor is done badly, it should throw own parsing exception which contains the line number and file (or list of parsing errors). Instead it's reusing generic RuntimeException, which is not a good practice. |
When running
I edited Based on the comments above I went looking for the problem file. It seems that I'm running "PHP 7.4.11 (cli) (built: Oct 1 2020 23:30:54) ( NTS )" if that helps. |
The text was updated successfully, but these errors were encountered: