forked from qt-creator/qt-creator
LanguageClient: Add option to start server when needed
Until now all servers where startet on creator startup. Change this default to start server when first file that matches the configured filter is opened. Additionally add an option that restores the old behavior of always on servers. Change-Id: I595e0ede1cf136cc803181377155bcd58ca1a83c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -663,7 +663,7 @@ void Client::setSupportedLanguage(const LanguageFilter &filter)
|
||||
bool Client::isSupportedDocument(const Core::IDocument *document) const
|
||||
{
|
||||
QTC_ASSERT(document, return false);
|
||||
return m_languagFilter.isSupported(document->filePath(), document->mimeType());
|
||||
return m_languagFilter.isSupported(document);
|
||||
}
|
||||
|
||||
bool Client::isSupportedFile(const Utils::FileName &filePath, const QString &mimeType) const
|
||||
@@ -673,8 +673,8 @@ bool Client::isSupportedFile(const Utils::FileName &filePath, const QString &mim
|
||||
|
||||
bool Client::isSupportedUri(const DocumentUri &uri) const
|
||||
{
|
||||
return isSupportedFile(uri.toFileName(),
|
||||
Utils::mimeTypeForFile(uri.toFileName().fileName()).name());
|
||||
return m_languagFilter.isSupported(uri.toFileName(),
|
||||
Utils::mimeTypeForFile(uri.toFileName().fileName()).name());
|
||||
}
|
||||
|
||||
bool Client::needsRestart(const BaseSettings *settings) const
|
||||
|
||||
Reference in New Issue
Block a user