codeinspector icon indicating copy to clipboard operation
codeinspector copied to clipboard

Some important CodeInspect hints do not get shown (too low confidence?)

Open SjoerdSmitWolfram opened this issue 3 years ago • 1 comments

The code error Which[a, b, a, c] gets picked up by the plugin, but a related one like Which[a, b, c] does not. Presumably this is because CodeInspect assigns a relatively low confidence (0.55) to this case?

CodeInspect["Which[a, b, a, c]"]
CodeInspect["Which[a, b, c]"]

This is rather unfortunate, since this is a pretty important and common error to catch. I don't know what the proper solution is, but I feel like this is worth addressing.

SjoerdSmitWolfram avatar Sep 13 '22 10:09 SjoerdSmitWolfram

The problem is that issues that have to do with argument counts (like CodeInspect["Which[a, b, c]"]) do not currently have good technology for distinguishing when a pattern sequence represents the correct arguments.

I mean like with:

CodeInspect["foo[c___] := Which[a, b, c]"]

where c is actually a sequence of arguments.

It would be really good for CodeInspector` to get to the point of understanding these things.

So issues about argument counts have low confidence (for now).

bostick avatar Sep 15 '22 14:09 bostick