Hi Guys, I saw that my SpellChecker Plugin does not handle string literals enclosed in QStringLiteral(). correctly. I am pretty sure it is because QStringLiteral() is a macro that expands to the actual code to handle the literal.
The issue with this is, that I need to parse the string to check for spelling mistakes and then if there are mistakes, underline the misspelled word and give the user the options to replace the misspelled word. Due to the expansion of the macro, I am finding it rather hard to get the position of the words as the user sees it, not my plugin. For example if I have a mistake on "line: 8, Col: 63" (reported by QtC), my parser sees 2 instances of the word at (10:65) and (10:232). How do I extract the 'correct location' (Location in the IDE) for the QStringLiteral() expansion? I have started searching and looked a bit at the WrapStringLiteral class (part of CppQuickfixes) and it seems like the WrapStringLiteral::analyze() function can do what I need. I am not sure how to use this, or implement something similar. Any help will be greatly appreciated. PS: I will also be very grateful if this solution can be used to also know which strings are translatable strings (enclosed in tr()). I would like to add the option to my plugin to let the user request that only string literals that will be translated be parsed. --- Check out my SpellChecker Plugin for Qt Creator on github @ https://github.com/CJCombrink/SpellChecker-Plugin Regards, Carel
_______________________________________________ Qt-creator mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qt-creator
