Allow multiple fallback fonts.

Reduced allocations and improved logs in LSP Plugin.
Added String::split for std::string_view.
Added support for std::string_view in Log.
This commit is contained in:
Martín Lucas Golini
2023-11-05 18:56:56 -03:00
parent 67466df557
commit 3867a472b3
19 changed files with 6522 additions and 7330 deletions

View File

@@ -466,6 +466,22 @@ bool LSPClientPlugin::langSupportsSemanticHighlighting( const std::string& lspLa
[&lspLang]( const auto& other ) { return lspLang == other; } );
}
bool LSPClientPlugin::isSilent() const {
return mSilence;
}
void LSPClientPlugin::setSilent( bool silence ) {
mSilence = silence;
}
bool LSPClientPlugin::trimLogs() const {
return mTrimLogs;
}
void LSPClientPlugin::setTrimLogs( bool trimLogs ) {
mTrimLogs = trimLogs;
}
bool LSPClientPlugin::editorExists( UICodeEditor* editor ) {
return mManager->getSplitter()->editorExists( editor );
}
@@ -837,6 +853,11 @@ void LSPClientPlugin::loadLSPConfig( std::vector<LSPDefinition>& lsps, const std
else if ( updateConfigFile )
config["silent"] = mSilence;
if ( config.contains( "trim_logs" ) )
mTrimLogs = config.value( "trim_logs", false );
else if ( updateConfigFile )
config["trim_logs"] = mTrimLogs;
if ( config.contains( "hover_delay" ) )
setHoverDelay( Time::fromString( config["hover_delay"].get<std::string>() ) );
else if ( updateConfigFile )
@@ -1220,7 +1241,7 @@ void LSPClientPlugin::onRegister( UICodeEditor* editor ) {
} ) );
mEditors.insert( { editor, listeners } );
mEditorsTags.insert( { editor, {} } );
mEditorsTags.insert( { editor, UnorderedSet<String::HashType>{} } );
mEditorDocs[editor] = editor->getDocumentRef().get();
if ( mReady && editor->hasDocument() && editor->getDocument().hasFilepath() )