aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Shalayel <[email protected]>2025-01-03 12:53:46 +0100
committerSami Shalayel <[email protected]>2025-01-06 07:58:12 +0000
commitcb8097793716a458335c253c54072aea39ac7c39 (patch)
tree50e69f5bc0582f32c06dc797f8bae7f16043b3e7
parent70a0cf16011da2ff1139da9dd151b07b5410aad0 (diff)
qmlls: display executable path after name
Add the executable path of qmlls after its name, so that it is actually displayed to the user which version of qmlls it is currently using. This should help us when/if users will report more bugs with qmlls in the future. Task-number: QTCREATORBUG-31897 Change-Id: I5fded78cd5c0c2a3a2f4b40128d3668c5720709e Reviewed-by: David Schulz <[email protected]>
-rw-r--r--src/plugins/languageclient/languageclientsettings.cpp5
-rw-r--r--src/plugins/qmljseditor/qmllsclientsettings.cpp15
2 files changed, 17 insertions, 3 deletions
diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp
index 011bee64963..26a7a860a76 100644
--- a/src/plugins/languageclient/languageclientsettings.cpp
+++ b/src/plugins/languageclient/languageclientsettings.cpp
@@ -618,7 +618,10 @@ Client *BaseSettings::createClient(ProjectExplorer::Project *project) const
BaseClientInterface *interface = createInterface(project);
QTC_ASSERT(interface, return nullptr);
auto *client = createClient(interface);
- client->setName(Utils::globalMacroExpander()->expand(m_name));
+
+ if (client->name().isEmpty())
+ client->setName(Utils::globalMacroExpander()->expand(m_name));
+
client->setSupportedLanguage(m_languageFilter);
client->setInitializationOptions(initializationOptions());
client->setActivateDocumentAutomatically(true);
diff --git a/src/plugins/qmljseditor/qmllsclientsettings.cpp b/src/plugins/qmljseditor/qmllsclientsettings.cpp
index 13033617891..4a7a72b2b93 100644
--- a/src/plugins/qmljseditor/qmllsclientsettings.cpp
+++ b/src/plugins/qmljseditor/qmllsclientsettings.cpp
@@ -169,16 +169,27 @@ bool QmllsClientSettings::isValidOnProject(ProjectExplorer::Project *project) co
return true;
}
+class QmllsClientInterface : public StdIOClientInterface
+{
+public:
+ FilePath qmllsFilePath() const { return m_cmd.executable(); }
+};
+
BaseClientInterface *QmllsClientSettings::createInterface(Project *project) const
{
- auto interface = new StdIOClientInterface;
+ auto interface = new QmllsClientInterface;
interface->setCommandLine(commandLineForQmlls(project));
return interface;
}
Client *QmllsClientSettings::createClient(BaseClientInterface *interface) const
{
- return new QmllsClient(static_cast<StdIOClientInterface *>(interface));
+ auto qmllsInterface = static_cast<QmllsClientInterface *>(interface);
+ auto client = new QmllsClient(qmllsInterface);
+ const QString name = QString("%1 (%2)").arg(
+ Utils::globalMacroExpander()->expand(m_name), qmllsInterface->qmllsFilePath().toString());
+ client->setName(name);
+ return client;
}
class QmllsClientSettingsWidget : public QWidget