Skip to content

Commit

Permalink
[scide] rehighlight when introspection changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrsurge committed May 3, 2021
1 parent c28dff4 commit ff09134
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions editors/sc-ide/widgets/code_editor/highlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ SyntaxHighlighter::SyntaxHighlighter(QTextDocument* parent): QSyntaxHighlighter(
mGlobals = SyntaxHighlighterGlobals::instance();

connect(mGlobals, SIGNAL(syntaxFormatsChanged()), this, SLOT(rehighlight()));

connect(Main::scProcess(), &ScProcess::introspectionChanged, this, &SyntaxHighlighter::rehighlight);
}

void SyntaxHighlighter::highlightBlockInCode(ScLexer& lexer) {
Expand All @@ -88,6 +90,7 @@ void SyntaxHighlighter::highlightBlockInCode(ScLexer& lexer) {

case Token::Class: {
auto className = QString(lexer.text().begin() + tokenPosition, tokenLength);

auto* classInstance = Main::scProcess()->introspection().findClass(className);

if (classInstance != nullptr)
Expand Down

0 comments on commit ff09134

Please sign in to comment.