aefimov / idea-spellchecker

Integration of Jazzy into IntelliJ IDEA
0 stars 0 forks source link

Add menu and/or toolbar action to toggle spell check on/off #27

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be *very* useful if one had the ability to toggle SpellChecker on
and off. For performance reasons, as well as sometimes you want to
concentrate on iterating through (via F2 by default) the syntax & code
issues highlighted by other intentions/inspections. 

The ability to turn spell check off (and back on later if desired) for
individual files would also be very helpful. The 'off' setting could be
stored in the module's config file (.iml). For example, turning it off for
an I18N resource bundle file for a locale that you do not have a dictionary
installed for; or a domain specific file that has a lot of unusual words
(or lots of atypical abbreviations for the variable names - we've all had
to maintain those). (If you want this second item broken out into a
separate enhancement request, let me know and I will be happy to do such.)

Thanks again for a great (and long needed) plug-in.

Original issue reported on code.google.com by mved...@gmail.com on 29 Nov 2007 at 8:52

GoogleCodeExporter commented 8 years ago
Are you sure that modification of IML is good way?

Original comment by aefimov....@gmail.com on 30 Nov 2007 at 9:36

GoogleCodeExporter commented 8 years ago
Good Question... It is hard to say if IML is the best way. I have only dabbled 
in the
IDEA Open API, so I may not be aware of a better alternative.

Initially it seemed like a good place to store metadata about a file -- i.e. 
"do not
spell check File A" -- since files are typically specific to a module. The 
reason I
liked that idea is because we have very modularized projects. One IDEA module 
might
be used in several projects (for example one module is currently used in 7 
different
projects I work on). So it would be nice for the settings to not spell check 
file A,
B, C and D to care over to any project that used that particular module 
(including
future projects that add that module). But I suppose one could argue that 
storing it
in the IML file has the potential disadvantage of causing problems for teams 
that
share IML files; I personally would see that as an advantage. But, I am not 
sure how
common of a practice it is to share IML files. 

I wouldn't want to see any additional metadata file in the project area (i.e. a
sibling file to the IML file). So the alternative would be to store the info in 
the
IDEA configuration directory. If there was a separate file per module, I think 
that
would be workable. I wouldn't want to see a single file since over time that 
could
get bloated with file info from obsolete projects that one has not worked on for
years. A separate file per module would make cleanup easier.

Then again, as I finish typing this, I started to think about using a 
SupressWarnings
annotation -- or comment for non-java code -- in the file itself (as used in 
other
inspections/intentions). That may be the best solution. And if you wanted to 
get real
fancy, you could then implement "do not spell check statement", "do not spell 
check
method", and "do not spell check class/file" variations, like many other of the 
other
inspections/intentions have. (Even if not immediately, that could be a nice 
future
feature.) The only issue there is that I know some purists argue that 
development
tool metadata should not appear in a source code file.

At this point, I would say I have convinced myself that the SupressWarnings
annotation may be the best way to go. Perhaps you can solicit some opinions in 
the
Plugin forum.

Original comment by mved...@gmail.com on 4 Dec 2007 at 6:04

GoogleCodeExporter commented 8 years ago
I was just looking at the tool, and see that the SupressWarnings functionality 
is
there. (I was not aware that was native to the inspections engine - like I 
said, I
have only dabbled with the plug-in API). The only downside at this point is to 
turn
off all spell checking for a file takes several  invocations: 

@SuppressWarnings({"CommentsWithMistakes", "FieldNameWithMistakes",
"MethodNameWithMistakes", "StringWithMistakes", "LocalVariableNameWithMistakes",
"ClassNameWithMistakes"})

So that would be cumbersome to use when wanting to toggle spell checking off a 
file.
So if you could somehow add a special annotation -- like
@SuppressWarnings("AllSpellChecks") -- that it easy to toggle, that would work.

Anyhow, just some more of my thoughts. Hopefully they are helpful. Thanks 
again. 

Original comment by mved...@gmail.com on 4 Dec 2007 at 7:37

GoogleCodeExporter commented 8 years ago
Btw, you can use scopes in IDE Settings->Errors->Project Profiles to disable 
checking
in files by mask.

Original comment by aefimov....@gmail.com on 4 Dec 2007 at 7:41