mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Better visual indicator of modified file.
Try fix a very rare crash when loading document while starting LSP and requesting folding information.
This commit is contained in:
@@ -18,13 +18,11 @@ LSPDocumentClient::LSPDocumentClient( LSPClientServer* server, TextDocument* doc
|
||||
notifyOpen();
|
||||
requestSymbolsDelayed();
|
||||
requestSemanticHighlightingDelayed();
|
||||
doc->getFoldRangeService().setProvider( [this]( auto, bool requestFolds ) -> bool {
|
||||
bool ret = mServer->getCapabilities().foldingRangeProvider;
|
||||
if ( ret && requestFolds )
|
||||
requestFoldRange();
|
||||
return ret;
|
||||
mDoc->getFoldRangeService().setProvider( [this]( auto, bool requestFolds ) -> bool {
|
||||
return tryRequestFoldRanges( requestFolds );
|
||||
} );
|
||||
mDoc->getFoldRangeService().findRegions();
|
||||
if ( mDoc->getFoldRangeService().isEnabled() )
|
||||
tryRequestFoldRanges( true );
|
||||
}
|
||||
|
||||
LSPDocumentClient::~LSPDocumentClient() {
|
||||
@@ -40,6 +38,13 @@ LSPDocumentClient::~LSPDocumentClient() {
|
||||
Sys::sleep( Milliseconds( 0.1f ) );
|
||||
}
|
||||
|
||||
bool LSPDocumentClient::tryRequestFoldRanges( bool requestFolds ) {
|
||||
bool ret = mServer->getCapabilities().foldingRangeProvider;
|
||||
if ( ret && requestFolds )
|
||||
requestFoldRange();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void LSPDocumentClient::onDocumentLoaded( TextDocument* ) {
|
||||
refreshTag();
|
||||
requestSemanticHighlightingDelayed();
|
||||
|
||||
Reference in New Issue
Block a user