Bug 321593 - Kate's spellcheck should automatically ignore all valid programming language tokens
Summary: Kate's spellcheck should automatically ignore all valid programming language ...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: syntax (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-25 11:56 UTC by thorx89
Modified: 2013-09-10 23:09 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thorx89 2013-06-25 11:56:04 UTC
Kate's spellcheck (in Kate 4.8.5 (this option is unavailable) on Ubuntu 12.04 64bit)  already happens to ignore source code, and it only checks the out-commented sections of source files. This is great,  but since programmers will more often than not refer to the code part of their source files in the comments,  all valid programming tokens used in the actual code should be ignored (or at least there should be the option to auto-ignore them) by the spellchecker when it checks the comments. Better yet, if this is technically possible, these tokens should be added to a temporary dictionary so that they appear as spelling suggestions. 

Right now, I have to click on `Ignore All` whenever I hit a name of a source code entity in my comments. I think most people will use it like this, and we shouldn't have to do this manually as there are usually a large number of source code references in source code comments.

Example:
//This is a C++ source file
struct Foo{}; //Foo is a struct whose sole purpose is to demonstrate this bug
//In the second comment, "Foo" and "struct" are picked up by Kate's spellchecker, and I think they shouldn't be.
Comment 1 Dominik Haumann 2013-06-25 14:51:26 UTC
This is beyond Kate's spell checking capabilites: You'd need to parse the code and understand it correctly. And then adapt the dictionary accordingly. This is at least non-trivial, since Kate Part is a general purpose editor component. Understanding all languages it highlights is not an option.

The only idea would be to have a KTextEditor::SpellCheckInterface that could be queried whether a unknown word is an identifier in the language. This might be helpful for Kile and KDevelop.

Comments on this, Kile / KDevevloper? And even more important: volunteers?
Comment 2 Dominik Haumann 2013-09-10 23:09:24 UTC
We'll close as wont-fix for now, since as said it's beyond Kate's capabilities. Patches are welcome, but it probably won't come from our side for the time being.