diff options
| -rw-r--r-- | src/plugins/languageclient/languageclientsettings.cpp | 5 | ||||
| -rw-r--r-- | src/plugins/qmljseditor/qmllsclientsettings.cpp | 15 |
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 |
