LanguageClient: add option to start client per project

Some server like rust or haskell require a project at server startup.
Add option that postpones the server start until we can assign a project
to an open file.

Change-Id: Iaa475289e833b27a730a90ea228f5d85ecc30338
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-03-15 11:25:48 +01:00
parent 132d813343
commit 0ea840c2bd
6 changed files with 199 additions and 58 deletions

View File

@@ -112,6 +112,8 @@ public:
void executeCommand(const LanguageServerProtocol::Command &command);
// workspace control
void setCurrentProject(ProjectExplorer::Project *project);
const ProjectExplorer::Project *project() const;
void projectOpened(ProjectExplorer::Project *project);
void projectClosed(ProjectExplorer::Project *project);
@@ -200,6 +202,7 @@ private:
QScopedPointer<BaseClientInterface> m_clientInterface;
QMap<LanguageServerProtocol::DocumentUri, QList<TextMark *>> m_diagnostics;
DocumentSymbolCache m_documentSymbolCache;
const ProjectExplorer::Project *m_project = nullptr;
};
} // namespace LanguageClient