Questions about Inspections API


(I know it's is pushing the bounds of acceptable usage of these lists to ask about Semi-Open API, but I'm under a bit of deadline, and all of these occur with built-in inspections as well, and thus could be classified as product bugs. If anyone is offended, apologies in advance).

1) If create a ProblemDescriptor with a "null" LocalQuickFix, a "Problem Resolution: Apply Fix" line shows up in the problem description panel, and an "Apply Fix" right-clik button shows up on the problem list panel. Neither should be present. Am I doing something wrong, or is this a bug in the API?

2)As of 859, I only get tooltips for errors in the edit panel if they have LocalQuickFixes. I do get tooltips over gutter marks, just not tool tips in the editor. This is very visually jarring, as it says to the user "There's a problem here, but since I can't help you fix it, you'll just have to guess what it is". If intentional, this seems a very odd design choice.

3)Names of LocalQuickFixes are now used for the intentions they add to the editor pane (which is intensely cool), but not for the problem description panel or problem list panel. There, it's always "Apply Fix", which is not particularly helpful. It would be much better if the LocalQuickFix name was used instead.

Thanks, Max, and apologies again if this is out of line. On the other hand, if you think Tracker entries for any of these are appropriate I'll gladly enter them.

6 comments
Comment actions Permalink

(I know it's is pushing the bounds of acceptable usage of these lists to

ask about Semi-Open API, but I'm under a bit of deadline, and all of these
occur with built-in inspections as well, and thus could be classified as
product bugs. If anyone is offended, apologies in advance).
No need for apologies since your questions/suggestions/api usage will
definetely make an API better.

1) If create a ProblemDescriptor with a "null" LocalQuickFix, a "Problem

Resolution: Apply Fix" line shows up in the problem description panel, and
an "Apply Fix" right-clik button shows up on the problem list panel.
Neither should be present. Am I doing something wrong, or is this a bug in
the API?
Known bug. Working on the fix.

2)As of 859, I only get tooltips for errors in the edit panel if they have

LocalQuickFixes. I do get tooltips over gutter marks, just not tool tips in
the editor. This is very visually jarring, as it says to the user "There's
a problem here, but since I can't help you fix it, you'll just have to guess
what it is". If intentional, this seems a very odd design choice.
Just noticed this wierd behaviour. Definetely is a bug and should be fixed.

3)Names of LocalQuickFixes are now used for the intentions they add to the

editor pane (which is intensely cool), but not for the problem description
panel or problem list panel. There, it's always "Apply Fix", which is not
particularly helpful. It would be much better if the LocalQuickFix name was
used instead.
It can be easily done with problem description panel (that on the right side
of the inspection window) but it's a kind of a problem for the popup in the
tree on the left. Imagine you've atteched different kind of LocalQuickFixes
to different ProblemDescriptors. Since you may invoke somwhat fix-all from
tree root node popup menu you need some meaninful name for the action. What
it should be if there are different fixes for different problems? Ideas are
welcome.


0
Comment actions Permalink

(I know it's is pushing the bounds of acceptable

usage of these lists to
ask about Semi-Open API, but I'm under a bit of
deadline, and all of these
occur with built-in inspections as well, and thus
could be classified as
product bugs. If anyone is offended, apologies in
advance).
No need for apologies since your
questions/suggestions/api usage will
definetely make an API better.


Then you probably should make some changes here:
http://www.intellij.org/twiki/bin/view/Main/ProgramStructureInterface
("So you shouldn’t: Ask questions about PSI neither in newsgroups ")
since "[...] thus is "open" at the same terms" ( http://www.intellij.org/twiki/bin/view/Main/InspectionPlugins )

I think that it would be better if there were no restrictions on asking questions (about non-published API) in newsgroups and filing requests (even if in some cases they could go unanswered for long time). See also http://www.intellij.net/tracker/idea/viewSCR?publicId=13355


Timur

0
Comment actions Permalink

While seems similar the situation actually differs for PSI and let say
Inspection API. Latter just can't be "open" since uses PSI still thought out
and designed to be open so I'm very interested in discussion here. On other
hand PSI is not designed as open thing has many non-trivial contracts etc.
So hot discussion will produce unnecessary and helpless pressure to the
team.

--

Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


"Timur Zambalayev" <no_mail@jetbrains.com> wrote in message
news:28659376.1058205646819.JavaMail.itn@is.intellij.net...

(I know it's is pushing the bounds of acceptable

usage of these lists to
ask about Semi-Open API, but I'm under a bit of
deadline, and all of these
occur with built-in inspections as well, and thus
could be classified as
product bugs. If anyone is offended, apologies in
advance).
No need for apologies since your
questions/suggestions/api usage will
definetely make an API better.

>

Then you probably should make some changes here:
http://www.intellij.org/twiki/bin/view/Main/ProgramStructureInterface
("So you shouldn?t: Ask questions about PSI neither in newsgroups ")
since "[...] thus is "open" at the same terms" (

http://www.intellij.org/twiki/bin/view/Main/InspectionPlugins )
>

I think that it would be better if there were no restrictions on asking

questions (about non-published API) in newsgroups and filing requests (even
if in some cases they could go unanswered for long time). See also
http://www.intellij.net/tracker/idea/viewSCR?publicId=13355
>
>

Timur



0
Comment actions Permalink

>Ideas are welcome.

My gut feel is that "LocalQuickFix names always on the right pane, and on the left pane if it is the same for all of the selections. If they are different, use "Apply Fix", would be the clearest presentation.

One other thing, which is probably a lot more difficult to fix: If one element has two separate errors attached to it, it is possible that it will get one tool-tip in the edit window and a different one in the gutter marks. This is somewhat jarring.

Thanks for the quick and helpful response.

--Dave Griffith

0
Comment actions Permalink


Timur and Maxim,

I don't think this will be a problem with the Intention and Inspection APIs, both because they are pretty small and well documented, and because the four people outside of JetBrains who care about them seem to be getting it sorted out. I also sympathize with JetBrains not wanting to spend time shagging questions and requests about the PSI (Motto: "Careful! That might be null!"). The reason I posted my questions as I did (rather than as Tracker items) is that I was only 75/25 on whether the issues were bugs in the API or my misunderstandings. If they were bugs, I didn't want them dropped on the floor (because they were semi-open API bugs, and thus a major violation to put them into Tracker), but I also didn't want them fixed for the built-in inspections but not fixed for the semi-open API (or fixed but the fix not explained). If they were my misunderstandings, well, I apologized, and was ready to be justly flamed. Trust me, I didn't do this lightly, but I've got a whole lot of time invested in code using the Inspections API, and didn't feel I could leave these issues unraised.

0
Comment actions Permalink

Maxim Shafirov wrote:
>>2)As of 859, I only get tooltips for errors in the edit panel if they have
>> LocalQuickFixes. I do get tooltips over gutter marks, just not tool tips in
>> the editor. This is very visually jarring, as it says to the user "There's
>> a problem here, but since I can't help you fix it, you'll just have to guess
>> what it is". If intentional, this seems a very odd design choice.

Just noticed this wierd behaviour. Definetely is a bug and should be fixed.


I think this could be (related to)
http://www.intellij.net/tracker/idea/viewSCR?publicId=14178
which is fixed in 864

Bas

0

Please sign in to leave a comment.