Display error when LSP Server fails to initialize.

This commit is contained in:
Martín Lucas Golini
2024-04-10 21:35:56 -03:00
parent d493674363
commit c6cc4fa4ac
7 changed files with 88 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 12.0.2, 2024-04-07T13:45:41. -->
<!-- Written by QtCreator 13.0.0, 2024-04-10T21:35:35. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@@ -937,6 +937,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-test-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-test-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -958,6 +959,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-test</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-test-release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -979,6 +981,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-physics-demo-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-physics-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1000,6 +1003,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-http-request-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-http-request-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1020,6 +1024,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}../../../bin/eeiv-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eeiv-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1041,6 +1046,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-TextureAtlasEditor-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-TextureAtlasEditor-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1062,6 +1068,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-MapEditor-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-MapEditor-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1084,6 +1091,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-UIEditor-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-UIEditor-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1105,6 +1113,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-ui-hello-world-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-ui-hello-world-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1125,6 +1134,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-TexturePacker-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-TexturePacker-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1147,6 +1157,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-ui-perf-test-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-ui-perf-test-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1168,6 +1179,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/ecode-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">ecode-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1189,6 +1201,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-empty-window-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-empty-window-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1210,6 +1223,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eterm-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eterm-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1231,6 +1245,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-7guis-crud-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-7guis-crud-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1252,6 +1267,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-7guis-timer-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-7guis-timer-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1273,6 +1289,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-7guis-counter-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-7guis-counter-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1294,6 +1311,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-7guis-temperature-converter-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-7guis-temperature-converter-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1315,6 +1333,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-7guis-flight-booker-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-7guis-flight-booker-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1336,6 +1355,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-7guis-circle-drawer-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-7guis-circle-drawer</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1357,6 +1377,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-7guis-cells-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-7guis-cells-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1378,6 +1399,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-empty-window</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-empty-window-release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1399,6 +1421,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-external-shader-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-external-shader-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1419,6 +1442,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-external-shader</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-external-shader-release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1439,6 +1463,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-sound-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-sound-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1459,6 +1484,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-sprites-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-sprites-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1479,6 +1505,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-fonts-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-fonts-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
@@ -1500,6 +1527,7 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%{buildDir}/../../bin/eepp-vbo-fbo-batch-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">eepp-vbo-fbo-batch-debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>

View File

@@ -11,7 +11,7 @@ NotificationCenter::NotificationCenter( UILayout* layout, PluginManager* pluginM
if ( msg.type == PluginMessageType::ShowMessage ) {
auto sm = msg.asShowMessage();
if ( !sm.message.empty() )
addNotification( sm.message, Seconds( 10 ) );
addNotification( sm.message, Seconds( 10 ), sm.allowCopy );
} else if ( msg.type == PluginMessageType::ShowDocument ) {
auto sd = msg.asShowDocument();
if ( !sd.uri.empty() ) {
@@ -24,12 +24,13 @@ NotificationCenter::NotificationCenter( UILayout* layout, PluginManager* pluginM
} );
}
void NotificationCenter::addNotification( const String& text, const Time& delay ) {
auto action = [this, text, delay]() {
void NotificationCenter::addNotification( const String& text, const Time& delay, bool allowCopy ) {
auto action = [this, text, delay, allowCopy]() {
UITextView* tv = UITextView::New();
tv->addEventListener( Event::MouseClick, [tv]( const Event* event ) {
tv->on( Event::MouseClick, [tv, allowCopy]( const Event* event ) {
const MouseEvent* mouseEvent = static_cast<const MouseEvent*>( event );
if ( mouseEvent->getFlags() & EE_BUTTON_LMASK )
if ( mouseEvent->getFlags() &
( allowCopy ? EE_BUTTON_MMASK : ( EE_BUTTON_LMASK | EE_BUTTON_RMASK ) ) )
tv->close();
} );
tv->setParent( mLayout );
@@ -37,6 +38,7 @@ void NotificationCenter::addNotification( const String& text, const Time& delay
tv->setFlags( UI_WORD_WRAP );
tv->setText( text );
tv->addClass( "notification" );
tv->setTextSelection( allowCopy );
Action* sequence = Actions::Sequence::New(
{ Actions::FadeIn::New( Seconds( 0.125 ) ), Actions::Delay::New( delay ),
Actions::FadeOut::New( Seconds( 0.125 ) ), Actions::Close::New() } );

View File

@@ -10,7 +10,7 @@ class NotificationCenter {
public:
NotificationCenter( UILayout* layout, PluginManager* pluginManager );
void addNotification( const String& text, const Time& delay = Seconds( 2.5 ) );
void addNotification( const String& text, const Time& delay = Seconds( 2.5 ), bool allowCopy = false );
void addShowRequest( const String& uri, const String& actionText,
const Time& delay = Seconds( 2.5 ) );

View File

@@ -1218,15 +1218,19 @@ bool LSPClientServer::start() {
if ( !cmd.empty() ) {
bool ret = mProcess.create( cmd, Process::getDefaultOptions() | Process::EnableAsync,
mLSP.env, mRootPath );
if ( ret && mProcess.isAlive() ) {
mUsingProcess = true;
if ( ret ) {
if ( mProcess.isAlive() ) {
mUsingProcess = true;
mProcess.startAsyncRead(
[this]( const char* bytes, size_t n ) { readStdOut( bytes, n ); },
[this]( const char* bytes, size_t n ) { readStdErr( bytes, n ); } );
mProcess.startAsyncRead(
[this]( const char* bytes, size_t n ) { readStdOut( bytes, n ); },
[this]( const char* bytes, size_t n ) { readStdErr( bytes, n ); } );
if ( mLSP.host.empty() )
initialize();
if ( mLSP.host.empty() )
initialize();
} else {
ret = false;
}
}
if ( ret && !mLSP.host.empty() ) {
@@ -1313,8 +1317,10 @@ LSPClientServer::LSPRequestHandle LSPClientServer::write( json&& msg, const Json
LSPRequestHandle ret;
ret.server = this;
if ( !isRunning() )
if ( !isRunning() ) {
notifyServerError();
return ret;
}
msg["jsonrpc"] = "2.0";
@@ -1394,6 +1400,7 @@ LSPClientServer::LSPRequestHandle LSPClientServer::send( json&& msg, const JsonR
} else {
Log::warning( "LSPClientServer server %s Send for non-running server: %s",
mLSP.name.c_str(), mLSP.name.c_str() );
notifyServerError();
}
return LSPRequestHandle();
}
@@ -1405,6 +1412,7 @@ LSPClientServer::LSPRequestHandle LSPClientServer::sendSync( json&& msg, const J
} else {
Log::warning( "LSPClientServer server %s Send for non-running server: %s",
mLSP.name.c_str(), mLSP.name.c_str() );
notifyServerError();
}
return LSPRequestHandle();
}
@@ -1897,20 +1905,32 @@ void LSPClientServer::readStdOut( const char* bytes, size_t n ) {
}
}
void LSPClientServer::notifyServerError() {
if ( mNotifiedServerError || mReady )
return;
mNotifiedServerError = true;
LSPShowMessageParams msg;
msg.message = String::format( "LSP Server %s failed to initialize, received some error:\n%s",
mLSP.name, mReceiveErr );
msg.type = LSPMessageType::Error;
mManager->getPluginManager()->sendBroadcast( PluginMessageType::ShowMessage,
PluginMessageFormat::ShowMessage, &msg );
}
void LSPClientServer::readStdErr( const char* bytes, size_t n ) {
if ( mEnded )
return;
mReceiveErr += std::string( bytes, n );
LSPShowMessageParams msg;
const auto lastNewLineIndex = mReceiveErr.find_last_of( '\n' );
if ( lastNewLineIndex != std::string::npos ) {
msg.message = mReceiveErr.substr( 0, lastNewLineIndex );
mReceiveErr.erase( 0, lastNewLineIndex + 1 );
}
if ( !msg.message.empty() ) {
Log::debug( "LSPClientServer::readStdErr server %s:\n%s", mLSP.name.c_str(),
msg.message.c_str() );
}
std::string_view received( bytes, n );
received = String::trim( received, '\n' );
received = String::trim( received, ' ' );
mReceiveErr = received;
if ( !received.empty() )
Log::debug( "LSPClientServer::readStdErr server %s:\n%s", mLSP.name, received );
if ( !isRunning() )
notifyServerError();
}
void LSPClientServer::sendQueuedMessages() {

View File

@@ -262,6 +262,7 @@ class LSPClientServer {
bool mEnded{ false };
bool mUsingProcess{ false };
bool mUsingSocket{ false };
bool mNotifiedServerError{ false };
struct QueueMessage {
json msg;
JsonReplyHandler h;
@@ -319,6 +320,8 @@ class LSPClientServer {
void refreshCodeLens();
bool trimLogs() const;
void notifyServerError();
};
} // namespace ecode

View File

@@ -115,8 +115,13 @@ void LSPClientServerManager::tryRunServer( const std::shared_ptr<TextDocument>&
runLSPServer( id, rlsp, rootPath, languagesSupported );
if ( ( server = serverUP.get() ) ) {
mClients[id] = std::move( serverUP );
if ( !mLSPWorkspaceFolder.uri.empty() )
server->didChangeWorkspaceFolders( { mLSPWorkspaceFolder }, {}, true );
if ( server->isRunning() ) {
if ( !mLSPWorkspaceFolder.uri.empty() )
server->didChangeWorkspaceFolders( { mLSPWorkspaceFolder }, {}, true );
} else {
Log::debug( "LSP Server: %s failed to initialize.",
server->getDefinition().name );
}
}
} else {
server = clientIt->second.get();
@@ -466,8 +471,7 @@ const std::vector<LSPDefinition>& LSPClientServerManager::getLSPs() const {
return mLSPs;
}
LSPDefinition
LSPClientServerManager::getLSPForLang( const std::string& lang ) const {
LSPDefinition LSPClientServerManager::getLSPForLang( const std::string& lang ) const {
for ( const auto& lsp : mLSPs ) {
if ( lsp.language == lang )
return lsp;

View File

@@ -175,6 +175,7 @@ struct LSPShowMessageParams {
LSPMessageType type{ LSPMessageType::Log };
std::string message;
std::vector<LSPMessageActionItem> actions;
bool allowCopy{ false };
};
struct LSPTextDocumentContentChangeEvent {