[ANN] SimpleIntentions 1.2.1

I added...

- intention to unwrap do and do-while statements

- inspection to check class/method/field modifier order against JLS suggestion (incl. quick fix)

- inspection to check for fields and method parameters that do not match the naming preferences of the current code style settings (incl. quick fix)

...to SimpleIntentions 1.2.1.

--Etienne

0
10 comments
Avatar
Permanently deleted user

Great work Etienne.

etienne wrote:

I added...

- intention to unwrap do and do-while statements


Cool.

- inspection to check class/method/field modifier order against JLS
suggestion (incl. quick fix)


The InspectionGadgets "Missorted Modifiers" inspection in the "Code
style issues" category does the same thing doesn't it? Perhaps I should
make the documentation more clear?
Also when applied to an interface constant the quick fix removes the
modifiers. This used to be a bug in InspectionGadgets too, but I fixed
that recently.

- inspection to check for fields and method parameters that do not
match the naming preferences of the current code style settings
(incl. quick fix)


Cool, that was also on my list for InspectionGadgets. With your plugin
available, it gives me time to focus on other inspections.

...to SimpleIntentions 1.2.1.


Cheers,
Bas

0
Avatar
Permanently deleted user

FYI

I just got this exception with the new plugin version installed:


Assertion failed
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86)
at com.intellij.codeInspection.ex.ProblemDescriptorImpl.(ProblemDescriptorImpl.java:18) at com.intellij.codeInspection.ex.InspectionManagerEx.createProblemDescriptor(InspectionManagerEx.java:91) at nu.studer.idea.inspection.AnalyzingNamingInspection.inspect(AnalyzingNamingInspection.java:124) at nu.studer.idea.inspection.AnalyzingNamingInspection.checkMethod(AnalyzingNamingInspection.java:83) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:34) at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:149) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.doCollectInformation(LocalInspectionsPass.java:8) at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:8) at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:10) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230) at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:32) at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:35) at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:2) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:51) at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:26) java.lang.Throwable at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78) at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86) at com.intellij.codeInspection.ex.ProblemDescriptorImpl.(ProblemDescriptorImpl.java:18) at com.intellij.codeInspection.ex.InspectionManagerEx.createProblemDescriptor(InspectionManagerEx.java:91) at nu.studer.idea.inspection.AnalyzingNamingInspection.inspect(AnalyzingNamingInspection.java:124) at nu.studer.idea.inspection.AnalyzingNamingInspection.checkMethod(AnalyzingNamingInspection.java:83) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:34) at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:149) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.doCollectInformation(LocalInspectionsPass.java:8) at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:8) at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:10) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230) at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:32) at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:35) at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:2) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:51) at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:26) java.lang.Throwable at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78) at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86) at com.intellij.codeInspection.ex.ProblemDescriptorImpl.(ProblemDescriptorImpl.java:18) at com.intellij.codeInspection.ex.InspectionManagerEx.createProblemDescriptor(InspectionManagerEx.java:91) at nu.studer.idea.inspection.AnalyzingNamingInspection.inspect(AnalyzingNamingInspection.java:124) at nu.studer.idea.inspection.AnalyzingNamingInspection.checkMethod(AnalyzingNamingInspection.java:83) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:34) at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:149) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.doCollectInformation(LocalInspectionsPass.java:8) at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:8) at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:10) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230) at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:32) at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:35) at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:2) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:51) at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:26) java.lang.Throwable at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78) at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86) at com.intellij.codeInspection.ex.ProblemDescriptorImpl.]]>(ProblemDescriptorImpl.java:18)
at
com.intellij.codeInspection.ex.InspectionManagerEx.createProblemDescriptor(InspectionManagerEx.java:91)
at
nu.studer.idea.inspection.AnalyzingNamingInspection.inspect(AnalyzingNamingInspection.java:124)
at
nu.studer.idea.inspection.AnalyzingNamingInspection.checkMethod(AnalyzingNamingInspection.java:83)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:34)
at
com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:149)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.doCollectInformation(LocalInspectionsPass.java:8)
at
com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:8)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:10)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:32)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:35)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:2)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:51)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:26)


0

Hi Bas

Thanks. I'll make the naming preferences inspection more configurable, soon. The 'Missorted Modifiers' inspection I had overlooked :( Let me know if you would like to offload some little inspections.

--Etienne

0

Hi Tim

Thanks for your note. This is now fixed in the uploaded version 1.2.2.

--Etienne

0
Avatar
Permanently deleted user

etienne wrote:

Thanks for your note. This is now fixed in the uploaded version 1.2.2.


Etienne,

Excellent. I'm downloading it right now.
I'll let you know if I have any more issues.

Merci,
Tim

0
Avatar
Permanently deleted user

Etienne,

I'm having a problem with the naming convention inspection. It detects as misnamed static variable which have an underscore in the name. Note that I haven't touched anything in the naming conventions configuration panel... Everything is and will be empty.

Gilles

0
Avatar
Permanently deleted user

Little precision : final static variables...

0

Hi Gilles

Thanks for your feedback! I should have noticed this misbehavior myself...

Since there is no code style setting for static final fields, I now only check whether static final fields contain lower-case characters (since IDEA always tries to create constants as all-upper-case names). For example, FOO is okay, FOO_BAR is okay, etc.

In case you don't like this common rule, you can disable it specifically for 'static final fields' in the Error Settings of 'Variable name does not match code style setting'.

Btw, the inspection 'Constant Naming Convention' by InspectionGadgets allows for more sophisticated rules through Regular Expressions.

Uploaded 1.2.5.

--Etienne

0
Avatar
Permanently deleted user

Quick question... I turned on some of the naming conventions check with this
plugin, and the instructions say that the naming convention is based on an
IntelliJ provided convention. What I can't find is how do I change those?

For example, the two I'd like to change are, by default, LOGGER -> logger
and SERIAL_VERSION_UID -> serialVersionUID... I can't seem to find where I'd
change those however.

Any ideas?

Thanks for a great plugin..

Grant



"etienne" <no_mail@jetbrains.com> wrote in message
news:17925963.1136966303212.JavaMail.itn@is.intellij.net...
>I added...
>

- intention to unwrap do and do-while statements

>

- inspection to check class/method/field modifier order against JLS
suggestion (incl. quick fix)

>

- inspection to check for fields and method parameters that do not match
the naming preferences of the current code style settings (incl. quick
fix)

>

..to SimpleIntentions 1.2.1.

>

--Etienne



0

Hi Grant

The naming inspection is based on the code generation naming conventions, as defined in

Project Settings -> Project Code Style -> Code Generation -> Name prefix/suffix

For static final fields there is no such setting, which is why I use the no-lowercase rule, since IDEA also generates constants as no-lowercase names.

If you need more fine-grained rules for certain variable kinds, take a look at the 'Naming Conventions' inspections of InspectionGadgets.

--Etienne

0

Please sign in to leave a comment.