Try fix a weird crash with fold service.

This commit is contained in:
Martín Lucas Golini
2024-07-08 21:16:29 -03:00
parent 82d9448693
commit 1cbdf3ba0c
7 changed files with 25 additions and 12 deletions

View File

@@ -18,6 +18,18 @@ LSPDocumentClient::LSPDocumentClient( LSPClientServer* server, TextDocument* doc
notifyOpen();
requestSymbolsDelayed();
requestSemanticHighlightingDelayed();
if ( mServer->isReady() )
setupFoldRangeService();
}
void LSPDocumentClient::onServerInitialized() {
requestSymbols();
requestSemanticHighlighting();
setupFoldRangeService();
// requestCodeLens();
}
void LSPDocumentClient::setupFoldRangeService() {
mDoc->getFoldRangeService().setProvider( [this]( auto, bool requestFolds ) -> bool {
return tryRequestFoldRanges( requestFolds );
} );
@@ -122,13 +134,6 @@ int LSPDocumentClient::getVersion() const {
return mVersion;
}
void LSPDocumentClient::onServerInitialized() {
requestSymbols();
requestSemanticHighlighting();
mDoc->getFoldRangeService().findRegions();
// requestCodeLens();
}
void LSPDocumentClient::refreshTag() {
String::HashType oldTag = mTag;
mTag = String::hash( mDoc->getURI().toString() );