Hi, I have created a SpellChecker Plugin for QtCreator but I have an issue where if a comment contains a 'non-standard' character, (รถ - QChar(246)).
I get a comment using the TranslationUnit::commentAt() function then split the comment into words. For each word I get the row and column number of the word in the file with the TranslationUnit::getPosition() function. If a comment contains the above character, that comment is fine, no problems. But for any comment block after the comment with the char the getPosition() function returns the position with a offset for each issue char from the correct position. For instance if there are 4 characters in preceding comment blocks the location of the word is 4 rows offset from where it should be. See attached an example of the issue cause by this. In the first comment, the mistake is underlined correctly. In the second comment the character in question appears and the mistakes in the comment are still underlined correctly. While in the last comment the mistake is shown one char offset from where it should be (column 16 instead of 15 in the output pane). The code for my plugin can be found on GitHub: SpellChecker-Plugin <https://github.com/CJCombrink/SpellChecker-Plugin> The function that iterates the comments: parseCppDocument() <https://github.com/CJCombrink/SpellChecker-Plugin/blob/master/Parsers/CppParser/cppdocumentparser.cpp#L190> The function that calls getPosition(): tokenizeWords() <https://github.com/CJCombrink/SpellChecker-Plugin/blob/master/Parsers/CppParser/cppdocumentparser.cpp#L229> Is this a bug or am I doing something wrong? Regards,
_______________________________________________ Qt-creator mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qt-creator
