Performance improvements due to not debouncing some function calls.

Adjust JSX and TS syntax definitions.
This commit is contained in:
Martín Lucas Golini
2025-04-02 20:24:45 -03:00
parent 577f2e3dbb
commit 2a88bac8a1
7 changed files with 68 additions and 67 deletions

View File

@@ -1,5 +1,5 @@
#include "../../version.hpp"
#include "lspclientplugin.hpp"
#include "../../version.hpp"
#include <eepp/graphics/primitives.hpp>
#include <eepp/system/filesystem.hpp>
#include <eepp/system/lock.hpp>
@@ -562,11 +562,12 @@ bool LSPClientPlugin::processDocumentFormattingResponse( const URI& uri,
auto doc = mManager->getSplitter()->findDocFromURI( uri );
if ( !doc ) {
mManager->getLoadFileFn()( uri.getFSPath(), [this, edits]( UICodeEditor* editor, auto ) {
auto documentRef = editor->getDocumentRef();
mManager->getSplitter()->getUISceneNode()->runOnMainThread(
[documentRef, edits]() { processFormattingResponse( documentRef, edits ); } );
} );
mManager->getLoadFileFn()(
uri.getFSPath(), [this, edits = std::move( edits )]( UICodeEditor* editor, auto ) {
auto documentRef = editor->getDocumentRef();
mManager->getSplitter()->getUISceneNode()->runOnMainThread(
[documentRef, edits]() { processFormattingResponse( documentRef, edits ); } );
} );
return false;
}