Closed fadrian06 closed 10 months ago
It just works?
Nonetheless, if the features you requested are not there, nothing we can do here. LSP-intelephense is more of just a UI layer which shows what the serve responses. You should file a feature request to the server's repository instead. https://github.com/bmewburn/vscode-intelephense
No. There doesn't seem to be info about "uncaught exceptions" from my experiments.
<?php
/**
* This is foo.
*
* @deprecated don't use this function
*
* @throws JsonException
* @throws RuntimeException
*/
function foo()
{
$rand = rand(0, 100);
if ($rand > 50) {
throw new RuntimeException('A');
} else {
throw new JsonException('B');
}
}
try {
foo();
} catch (Throwable $e) {
echo 'Throwable: ' . $e->getMessage();
}
At the same time, I may not want to caught them here but at a more upper level.
It just works?
Yes, it works for the @deprecated tag, but it would be great if it worked for the @throws tag
Nonetheless, if the features you requested are not there, nothing we can do here. LSP-intelephense is more of just a UI layer which shows what the serve responses. You should file a feature request to the server's repository instead. https://github.com/bmewburn/vscode-intelephense
Thanks for the almost immediate response, it is indeed a feature that they are already requesting in the vs repository Diagnostic for Uncaught Exception Β· Issue #1859 Β· bmewburn/vscode-intelephense https://github.com/bmewburn/vscode-intelephense/issues/1859
Someone tell me if there is ever support for Info messages about uncaught exceptions thanks to the @throws tag in the docblock. Similar to the Info message about the @deprecated tagππ½ππ½ππ½
When I took a java course with lsp-jdtls I noticed that when I don't handle possible exceptions it gives me an info, even a quickFix to group the code in a
try/catch
.It would be great to have the same functionality in php