History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEABKL-4728
Type: Usability Problem Usability Problem
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: Keith Lea
Votes: 0
Watchers: 0
Available Workflow Actions

Mark as Stalled
Operations

If you were logged in you would be able to see more operations.
IDEA: Backlog

DevKit should provide more convenient error messages and quick fixes

Created: 18 Jan 06 22:32   Updated: 10 Nov 06 01:21
Component/s: Editor. Error Highlighting
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 4,109
Severity: Medium


 Description  « Hide
--- DevKitBundle.properties.~1~ 2006-01-09 23:48:14.000000000 -0500
+++ DevKitBundle.properties     2006-01-18 14:29:19.000000000 -0500
@@ -122,20 +122,20 @@
 inspections.registration.problems.quickfix.make.public=Make {0} public
 inspections.registration.problems.quickfix.make.public.read-only=Class ''{0}'' is read-only

-inspections.registration.problems.incompatible.message=According to its registration, the class should {0} ''{1}''
-inspections.registration.problems.abstract=Plugin component class must not be abstract
-inspections.registration.problems.not.public=Action class should be public
-inspections.registration.problems.ctor.not.public=Action class constructor should be public
-inspections.registration.problems.missing.noarg.ctor=Action class should have a public no-argument constructor
+inspections.registration.problems.incompatible.message=Class is listed as application component in plugin.xml but does not {0} ''{1}''
+inspections.registration.problems.abstract=Plugin component class is abstract
+inspections.registration.problems.not.public=Action class must be public
+inspections.registration.problems.ctor.not.public=Action class must have public constructor
+inspections.registration.problems.missing.noarg.ctor=Action class must have a public no-argument constructor

 inspections.registration.problems.missing.implementation.class=Missing implementation-class
 inspections.registration.problems.cannot.resolve.class=Cannot resolve {0} class
-inspections.registration.problems.component.should.implement=Component class should implement ''{0}''
-inspections.registration.problems.component.incompatible.interface=Component class is not assignable to its interface-class ''{0}''
-inspections.registration.problems.component.duplicate.interface=Interface class is already used
-inspections.registration.problems.action.incompatible.class=Action class should extend ''{0}''
+inspections.registration.problems.component.should.implement=Component class must implement ''{0}''
+inspections.registration.problems.component.incompatible.interface=Component class must extend its interface-class ''{0}''
+inspections.registration.problems.component.duplicate.interface=Duplicate components with interface class
+inspections.registration.problems.action.incompatible.class=Action class must extend ''{0}''

-inspections.component.not.registered.name=Component or Action not registered
+inspections.component.not.registered.name=Component/action not registered
 inspections.component.not.registered.message={0} is not registered in plugin.xml
 inspections.component.not.registered.option.check.actions=Check Actions
 inspections.component.not.registered.option.ignore.non.public=Ignore non-public classes

I think these descriptions are clearer. I also think quick fixes should be provided to create application-component in plugin.xml, etc. I don't have a patch to add those.



 All   Comments   Work Log   Change History      Sort Order:
Sascha Weinreuter - 19 Jan 06 01:06
Ok, after sorting the list together, I'm not so sure about those:

-inspections.registration.problems.abstract=Plugin component class must not be abstract
+inspections.registration.problems.abstract=Plugin component class is abstract

Hmm, I think the fact that the class is abstract is obvious to the user. The message should IMO state what it should not be.

-inspections.registration.problems.ctor.not.public=Action class constructor should be public
+inspections.registration.problems.ctor.not.public=Action class must have public constructor

I somehow agree with the "should" -> "must" change, but "must have a public constructor" somehow implies the class doesn't have one at all. Since the error applies to the ctor itself I think this doesn't fit that well.

In general I'd prefer the more defensive "should" over "must", and a - very non-scientific - check in the IG messages came out 38:11 for "should". Are there any other opinions on this?

-inspections.registration.problems.component.incompatible.interface=Component class is not assignable to its interface-class ''{0}''
+inspections.registration.problems.component.incompatible.interface=Component class must extend its interface-class ''{0}''

AFAIK, extending the interface class is not a hard requirement. One could use "java.lang.String" as interface class and only get a ClassCastException during runtime when calling getComponent(String.class) because of the generic method signature.

-inspections.registration.problems.component.duplicate.interface=Interface class is already used
+inspections.registration.problems.component.duplicate.interface=Duplicate components with interface class

What about "Multiple components with the same interface-class [are not allowed]"?

I also think quick fixes should be provided to create application-component in plugin.xml, etc. I don't have a patch to add those.

Do you mean a "Create Class" quickfix? Unfortunately I haven't seen an OpenAPI way to let the user choose the source path where to create the class in. I'm not sure if either just handling the standard case with one source-path or even replicating that UI makes much sense.


Keith Lea - 19 Jan 06 01:36
#1: okay, that's fine. I think long error descriptions are hard to digest, but that's not bad.

#2: okay, I think "Action class constructor must be public" is best then
I think should is confusing. The word "should" implies a gentle suggestion, but it's shown as a red error mark (and is in fact an error). The conflict between those concepts bothers me. I imagine a user could see "should" and not know why it was being suggested, but would see "must" and understand that it's a rule.

#3: If it shows as a warning, I think it should be changed to "should" and the inspection description should be good and easy to understand. If it shows as an error, I stick with my answer.

#4: I like yours best

#5: There are a few inspections which have obvious quickfixes which would not be difficult to implement, like "class does not implement ApplicationComponent" should add the implements entry.

By the way, is the intellij CVS repository kept current? I saw it was a lot of old plugins. I would probably commit more changes if I could simply update from cvs, so I didn't have to go through hassle of deleting old srcs from xx project folder, finding idea-install-path/plugins/xx/src/src_xx.zip, and unpacking it over my project folder.


Sascha Weinreuter - 23 Jan 06 03:12
Hello Keith, most of the changed messages should appear in the next build. I've changed my mind about the "should" vs. "must" issue as the inspection descriptions also say "must"

There are also two new QuickFixes: "Extend/Implement class/interface" and "Create no-argument constructor".

The current sources are not in CVS but in SVN and I think you should contact Maxim or Dmitry for the details.