forked from qt-creator/qt-creator
CppEditor: Use correct language features in Follow Symbol
Change-Id: If4adc4153341ac63bd5566a66ccf177ae4e536e1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
88ee2bfb64
commit
69edf1e26d
@@ -466,12 +466,9 @@ TextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &curs
|
||||
int beginOfToken = 0;
|
||||
int endOfToken = 0;
|
||||
|
||||
LanguageFeatures features;
|
||||
features.qtEnabled = true;
|
||||
features.qtKeywordsEnabled = true;
|
||||
features.qtMocRunEnabled = true;
|
||||
features.objCEnabled = true;
|
||||
features.cxx11Enabled = true;
|
||||
const LanguageFeatures features = documentFromSemanticInfo
|
||||
? documentFromSemanticInfo->languageFeatures()
|
||||
: LanguageFeatures::defaultFeatures();
|
||||
|
||||
SimpleLexer tokenize;
|
||||
tokenize.setLanguageFeatures(features);
|
||||
@@ -564,7 +561,8 @@ TextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &curs
|
||||
if (pos > 0 && !isValidIdentifierChar(ch))
|
||||
--pos; // positionInBlock points to a delimiter character.
|
||||
const Token tk = SimpleLexer::tokenAt(block.text(), pos,
|
||||
BackwardsScanner::previousBlockState(block), true);
|
||||
BackwardsScanner::previousBlockState(block),
|
||||
features);
|
||||
|
||||
beginOfToken = block.position() + tk.utf16charsBegin();
|
||||
endOfToken = block.position() + tk.utf16charsEnd();
|
||||
|
||||
Reference in New Issue
Block a user