LSP: add symbol support class

Declutter the client and client manager by moving find usage and follow
symbol into this helper. This functionality was "temporary" put into the
client manager, but is more an implementation detail that shouldn't be
handled in that central place. Rename symbol will also go into this
helper class.

Task-number: QTCREATORBUG-21578
Change-Id: I56680f6ccbb8d244066561167178af7b341b8822
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-05-06 10:26:31 +02:00
parent a35832385c
commit 4121eccf1e
9 changed files with 275 additions and 156 deletions

View File

@@ -34,6 +34,7 @@
#include "languageclienthoverhandler.h"
#include "languageclientquickfix.h"
#include "languageclientsettings.h"
#include "languageclientsymbolsupport.h"
#include <coreplugin/id.h>
#include <coreplugin/messagemanager.h>
@@ -111,10 +112,10 @@ public:
int charsAdded);
void registerCapabilities(const QList<LanguageServerProtocol::Registration> &registrations);
void unregisterCapabilities(const QList<LanguageServerProtocol::Unregistration> &unregistrations);
bool findLinkAt(LanguageServerProtocol::GotoDefinitionRequest &request);
bool findUsages(LanguageServerProtocol::FindReferencesRequest &request);
void cursorPositionChanged(TextEditor::TextEditorWidget *widget);
SymbolSupport &symbolSupport();
void requestCodeActions(const LanguageServerProtocol::DocumentUri &uri,
const QList<LanguageServerProtocol::Diagnostic> &diagnostics);
void requestCodeActions(const LanguageServerProtocol::CodeActionRequest &request);
@@ -239,6 +240,7 @@ private:
QHash<LanguageServerProtocol::DocumentUri, TextEditor::HighlightingResults> m_highlights;
const ProjectExplorer::Project *m_project = nullptr;
QSet<TextEditor::IAssistProcessor *> m_runningAssistProcessors;
SymbolSupport m_symbolSupport;
};
} // namespace LanguageClient