Open eitankeren opened 3 years ago
The reason is that there are lot of different try-catch implementation. Some of them require semi others - don't. Plugin supports some of them, but it's not possible to say which one is used in particular file. So there is a heuristic. And it fails sometime. I don't see how I can distinct this approach from another one.
Clear.
if you can link the Try/Cache module importation to the correct syntax that may be nice as this one is among the more popular one used by the Perl community together with Tiny::Try.
Thanks allot for your fast response, Your contribution to the community is very much appreciated!
-- Eitan
The problem is that it may be used indirectly or in some tricky way. I don't really remember atm what problems I had, but it was a real headache :)
Here is the list of modules that should work correctly: https://github.com/Camelcade/Perl5-IDEA/blob/master/plugin/core/grammar/Perl5.bnf#L681
I'll recheck the code, but can't give you exact estimation.
Ok, thanks allot for your efforts!
Maybe could add a per-project setting that lets us choose which Try library we're using?
That way we could have next and redo inside try or catch blocks, if we choose say Syntax::Keyword::Try without a red underline
The syntax check mark an error if Syntax::Keyword::Try; is used without ending ";" while they aren't needed, see example below.
use Syntax::Keyword::Try;
try { attempt_a_thing(); return "success"; } catch ($e) { warn "It failed - $e"; return "failure"; };
The catch block do not need the ending semicolon signed but without it the Perl syntax checker will raise an error.