MCPcopy Create free account
hub / github.com/SpartanJ/eepp / setSyntaxDefinition

Method setSyntaxDefinition

src/eepp/ui/uicodeeditor.cpp:3204–3220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3202}
3203
3204void UICodeEditor::setSyntaxDefinition( const SyntaxDefinition& definition ) {
3205 if ( &definition == &mDoc->getSyntaxDefinition() )
3206 return;
3207 std::string oldLang( mDoc->getSyntaxDefinition().getLanguageName() );
3208 mDoc->getHighlighter()->reset();
3209 mDoc->setSyntaxDefinition( definition );
3210 if ( mMinimapEnabled && getUISceneNode()->hasThreadPool() ) {
3211 mDoc->getHighlighter()->tokenizeAsync( getUISceneNode()->getThreadPool(), [this] {
3212 runOnMainThread( [this] { invalidateDraw(); } );
3213 } );
3214 }
3215 findRegionsDelayed();
3216 invalidateDraw();
3217 DocSyntaxDefEvent event( this, mDoc.get(), Event::OnDocumentSyntaxDefinitionChange, oldLang,
3218 mDoc->getSyntaxDefinition().getLanguageName() );
3219 sendEvent( &event );
3220}
3221
3222void UICodeEditor::resetSyntaxDefinition() {
3223 std::string oldLang( mDoc->getSyntaxDefinition().getLanguageName() );

Callers 9

initNewOutputMethod · 0.45
UniversalLocatorMethod · 0.45
createFileTypeMenuMethod · 0.45
onCodeEditorCreatedMethod · 0.45
runBuildMethod · 0.45
LLMChatUIMethod · 0.45
addChatUIMethod · 0.45
UTESTFunction · 0.45

Calls 6

getHighlighterMethod · 0.80
hasThreadPoolMethod · 0.80
tokenizeAsyncMethod · 0.80
resetMethod · 0.45
getThreadPoolMethod · 0.45
getMethod · 0.45

Tested by 1

UTESTFunction · 0.36