0

I need a source code spell-checker. Of course there is a closed source ones but I'm looking for an open source solution, That can spell check html files, php source codes any further types would be better.

I also thought about making my own since there is a good libraries for spell checking, So what features you think it's good to be added to this application?

I have a very basic imagination of it:

  • Just Highlight the error words and give you suggestions without any actual modifying for the source code.
  • Support local and remote files
  • Spell check only certain parts of code like string literals (between quotations)
  • choosing between dictionaries.
  • Using the apell lib or any equivalent one.

Edit: It should have a GUI and should be cross-platform.

Pascal MARTIN
  • 395,085
  • 80
  • 655
  • 663
Omar Al-Ithawi
  • 4,988
  • 5
  • 36
  • 47
  • All of (Eclipse PDT, Emacs, gEdit) seems to have this functionality. BUT they're kind of stupid and don't recognize different code portions. – Omar Al-Ithawi Sep 27 '09 at 09:30

3 Answers3

3

Emacs has a minor mode called flyspell which can spellcheck comments and strings within major programming modes.

It seems to fulfil all your criteria: it highlights misspelled words, gives you suggestions, local and remote files (eg. over ssh) are supported, knows how to just check comments and strings, and supports multiple ISpell dictionaries.

You could even automate spell checking using elisp to run batch checking.

gavinb
  • 19,278
  • 3
  • 45
  • 60
2

Most of the IDEs support spell-checking. I know Eclipse does. You can always run it through ispell

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
discovlad
  • 206
  • 1
  • 4
2

Eclipse PDT, which is one of the best IDE for PHP (and is free) supports spellchecking -- as its based on Eclipse.

You can enable it in the preferences, and set a couple of options.

Unfortunatly, I don't think it parses source-code, and it'll highlight as "errors" parts of code that are actually not errors :-( So that's at least one thing that will not work for you, I suppose.

On the other hand :

  • hightlight without modifications : OK
  • local and remote files : should be OK, as Eclipse (with RSE plugin, for instance) supports remote files
  • only certain portions of code : NOT OK
  • choosing between dictionnaries : seems OK from the configuration dialog
  • apell or equivalent : I have no idea
  • GUI : OK : Eclipse
  • Cross-platform : OK as based on Eclipse

Here is a screenshot of the configuration dialog :

And a result of source-code spellchecking :


(source: pascal-martin.fr)

In red, an actual error, in a comment ; in green a not-error, in PHP code.

Community
  • 1
  • 1
Pascal MARTIN
  • 395,085
  • 80
  • 655
  • 663
  • Unfortunately, this feature has been omitted from AptanaStudio!. I checked and found eSpell plugin with AptanaStudio and it's fine. – Omar Al-Ithawi Sep 26 '09 at 08:56
  • eSpell is not that good, it makes unnecessary refreshes and slow and don't check all the expected parts of the code like normal text inside an HTML tag. – Omar Al-Ithawi Sep 26 '09 at 09:04
  • If you find another great solution, let us know ! (especially, one that doesn't highlight php code as spelling errors... ) – Pascal MARTIN Sep 26 '09 at 10:22