diff --git a/src/thirdparty/efsw b/src/thirdparty/efsw index 2f90a4410..998c16ebc 160000 --- a/src/thirdparty/efsw +++ b/src/thirdparty/efsw @@ -1 +1 @@ -Subproject commit 2f90a44104d33b873e9e374b1dbb6c6b73073528 +Subproject commit 998c16ebc1ab95cc2c41289942d300f68a6dc78a diff --git a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp index 4d4fcd3d8..a9b9cad24 100644 --- a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp +++ b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp @@ -1,5 +1,5 @@ -#include "../../version.hpp" #include "lspclientplugin.hpp" +#include "../../version.hpp" #include #include #include @@ -260,6 +260,8 @@ LSPClientPlugin::~LSPClientPlugin() { } for ( auto listener : editor.second ) editor.first->removeEventListener( listener ); + if ( mBreadcrumb ) + editor.first->unregisterTopSpace( this ); editor.first->unregisterPlugin( this ); } if ( nullptr == mManager->getSplitter() ) diff --git a/src/tools/ecode/plugins/lsp/lspclientserver.cpp b/src/tools/ecode/plugins/lsp/lspclientserver.cpp index 21dcb2c67..7bbdfe858 100644 --- a/src/tools/ecode/plugins/lsp/lspclientserver.cpp +++ b/src/tools/ecode/plugins/lsp/lspclientserver.cpp @@ -428,6 +428,16 @@ struct LSPSymbolInformationTmp { } }; +static void sortRecursive( std::list& symbols ) { + symbols.sort( []( const LSPSymbolInformationTmp& left, const LSPSymbolInformationTmp& right ) { + return left.range < right.range; + } ); + + for ( auto& symbol : symbols ) + if ( !symbol.children.empty() ) + sortRecursive( symbol.children ); +} + static LSPSymbolInformationList parseDocumentSymbols( const json& result, bool isSilent ) { // TODO: Optimize this Clock clock; @@ -482,6 +492,8 @@ static LSPSymbolInformationList parseDocumentSymbols( const json& result, bool i for ( const auto& info : symInfos ) parseSymbol( info, nullptr ); + sortRecursive( ret ); + LSPSymbolInformationList rret; for ( const auto& r : ret ) rret.push_back( LSPSymbolInformationTmp::fromTmp( r ) );