forked from qt-creator/qt-creator
LanguageClient: remove unneeded document actions blocker
Change-Id: Id1f07dbf83fcf7d75aaba6d860fb1556761bbd4b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -65,7 +65,6 @@ ClangdClient::ClangdClient(ProjectExplorer::Project *project, const Utils::FileP
|
|||||||
caps.clearTextDocument();
|
caps.clearTextDocument();
|
||||||
setClientCapabilities(caps);
|
setClientCapabilities(caps);
|
||||||
setLocatorsEnabled(false);
|
setLocatorsEnabled(false);
|
||||||
setDocumentActionsEnabled(false);
|
|
||||||
setProgressTitleForToken(indexingToken(), tr("Parsing C/C++ Files (clangd)"));
|
setProgressTitleForToken(indexingToken(), tr("Parsing C/C++ Files (clangd)"));
|
||||||
setCurrentProject(project);
|
setCurrentProject(project);
|
||||||
connect(this, &Client::workDone, this, [this](const ProgressToken &token) {
|
connect(this, &Client::workDone, this, [this](const ProgressToken &token) {
|
||||||
|
@@ -542,9 +542,6 @@ void Client::requestDocumentHighlights(TextEditor::TextEditorWidget *widget)
|
|||||||
|
|
||||||
void Client::activateDocument(TextEditor::TextDocument *document)
|
void Client::activateDocument(TextEditor::TextDocument *document)
|
||||||
{
|
{
|
||||||
if (!m_documentActionsEnabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto uri = DocumentUri::fromFilePath(document->filePath());
|
auto uri = DocumentUri::fromFilePath(document->filePath());
|
||||||
m_diagnosticManager.showDiagnostics(uri);
|
m_diagnosticManager.showDiagnostics(uri);
|
||||||
SemanticHighligtingSupport::applyHighlight(document, m_highlights.value(uri), capabilities());
|
SemanticHighligtingSupport::applyHighlight(document, m_highlights.value(uri), capabilities());
|
||||||
@@ -571,9 +568,6 @@ void Client::activateDocument(TextEditor::TextDocument *document)
|
|||||||
|
|
||||||
void Client::deactivateDocument(TextEditor::TextDocument *document)
|
void Client::deactivateDocument(TextEditor::TextDocument *document)
|
||||||
{
|
{
|
||||||
if (!m_documentActionsEnabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_diagnosticManager.hideDiagnostics(document);
|
m_diagnosticManager.hideDiagnostics(document);
|
||||||
resetAssistProviders(document);
|
resetAssistProviders(document);
|
||||||
document->setFormatter(nullptr);
|
document->setFormatter(nullptr);
|
||||||
@@ -1265,9 +1259,6 @@ void Client::handleMethod(const QString &method, const MessageId &id, const ICon
|
|||||||
|
|
||||||
void Client::handleDiagnostics(const PublishDiagnosticsParams ¶ms)
|
void Client::handleDiagnostics(const PublishDiagnosticsParams ¶ms)
|
||||||
{
|
{
|
||||||
if (!m_documentActionsEnabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const DocumentUri &uri = params.uri();
|
const DocumentUri &uri = params.uri();
|
||||||
|
|
||||||
const QList<Diagnostic> &diagnostics = params.diagnostics();
|
const QList<Diagnostic> &diagnostics = params.diagnostics();
|
||||||
@@ -1280,9 +1271,6 @@ void Client::handleDiagnostics(const PublishDiagnosticsParams ¶ms)
|
|||||||
|
|
||||||
void Client::handleSemanticHighlight(const SemanticHighlightingParams ¶ms)
|
void Client::handleSemanticHighlight(const SemanticHighlightingParams ¶ms)
|
||||||
{
|
{
|
||||||
if (!m_documentActionsEnabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
DocumentUri uri;
|
DocumentUri uri;
|
||||||
LanguageClientValue<int> version;
|
LanguageClientValue<int> version;
|
||||||
auto textDocument = params.textDocument();
|
auto textDocument = params.textDocument();
|
||||||
@@ -1313,9 +1301,6 @@ void Client::handleSemanticHighlight(const SemanticHighlightingParams ¶ms)
|
|||||||
|
|
||||||
void Client::rehighlight()
|
void Client::rehighlight()
|
||||||
{
|
{
|
||||||
if (!m_documentActionsEnabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
for (auto it = m_highlights.begin(), end = m_highlights.end(); it != end; ++it) {
|
for (auto it = m_highlights.begin(), end = m_highlights.end(); it != end; ++it) {
|
||||||
if (TextDocument *doc = TextDocument::textDocumentForFilePath(it.key().toFilePath())) {
|
if (TextDocument *doc = TextDocument::textDocumentForFilePath(it.key().toFilePath())) {
|
||||||
|
@@ -122,7 +122,6 @@ public:
|
|||||||
|
|
||||||
void setLocatorsEnabled(bool enabled) { m_locatorsEnabled = enabled; }
|
void setLocatorsEnabled(bool enabled) { m_locatorsEnabled = enabled; }
|
||||||
bool locatorsEnabled() const { return m_locatorsEnabled; }
|
bool locatorsEnabled() const { return m_locatorsEnabled; }
|
||||||
void setDocumentActionsEnabled(bool enabled) { m_documentActionsEnabled = enabled; }
|
|
||||||
|
|
||||||
// document synchronization
|
// document synchronization
|
||||||
void setSupportedLanguage(const LanguageFilter &filter);
|
void setSupportedLanguage(const LanguageFilter &filter);
|
||||||
@@ -261,7 +260,6 @@ private:
|
|||||||
bool m_activateDocAutomatically = false;
|
bool m_activateDocAutomatically = false;
|
||||||
SemanticTokenSupport m_tokentSupport;
|
SemanticTokenSupport m_tokentSupport;
|
||||||
bool m_locatorsEnabled = true;
|
bool m_locatorsEnabled = true;
|
||||||
bool m_documentActionsEnabled = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LanguageClient
|
} // namespace LanguageClient
|
||||||
|
Reference in New Issue
Block a user