LSP: move text marks from the manager to the individual clients

Diagnostics are “owned” by the server so it is the server’s
responsibility to clear them if necessary. So do not delete the
corresponding text mark after a file was closed, because the server does
not have to resend the diagnostics when the file is reopened. Only
delete text marks when they are replaced or when the client is deleted
or reset.

Change-Id: Ief821c7ec401f4c52ee30d99f8dec47dcd6f1c98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-02-01 14:08:02 +01:00
parent 93ea656821
commit fa1862c782
4 changed files with 77 additions and 105 deletions

View File

@@ -55,14 +55,6 @@ public:
static void init();
static void publishDiagnostics(const Core::Id &id,
const LanguageServerProtocol::PublishDiagnosticsParams &params, Client *publishingClient);
static void removeMark(LanguageClientMark *mark);
static void removeMarks(const Utils::FileName &fileName);
static void removeMarks(const Utils::FileName &fileName, const Core::Id &id);
static void removeMarks(const Core::Id &id);
static void startClient(Client *client);
static QVector<Client *> clients();
@@ -101,7 +93,6 @@ private:
bool m_shuttingDown = false;
QVector<Client *> m_clients;
QHash<Utils::FileName, QHash<Core::Id, QVector<LanguageClientMark *>>> m_marks;
QHash<LanguageServerProtocol::MessageId, QList<Client *>> m_exclusiveRequests;
friend class LanguageClientPlugin;