diff options
Diffstat (limited to 'source/kde/kde/patch/kate/6fc3bf6e5bd540e842e32c4a959c2158c8573be5.patch')
-rw-r--r-- | source/kde/kde/patch/kate/6fc3bf6e5bd540e842e32c4a959c2158c8573be5.patch | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/source/kde/kde/patch/kate/6fc3bf6e5bd540e842e32c4a959c2158c8573be5.patch b/source/kde/kde/patch/kate/6fc3bf6e5bd540e842e32c4a959c2158c8573be5.patch new file mode 100644 index 000000000..cdbde70ff --- /dev/null +++ b/source/kde/kde/patch/kate/6fc3bf6e5bd540e842e32c4a959c2158c8573be5.patch @@ -0,0 +1,71 @@ +From 6fc3bf6e5bd540e842e32c4a959c2158c8573be5 Mon Sep 17 00:00:00 2001 +From: Mark Nauwelaerts <mark.nauwelaerts@gmail.com> +Date: Mon, 13 Dec 2021 21:36:50 +0100 +Subject: [PATCH] lspclient: send didSave notification if so requested + +--- + addons/lspclient/lspclientserver.cpp | 7 +++++-- + addons/lspclient/lspclientservermanager.cpp | 15 +++++++++++++++ + 2 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/addons/lspclient/lspclientserver.cpp b/addons/lspclient/lspclientserver.cpp +index a7094fde2..9fb5844cd 100644 +--- a/addons/lspclient/lspclientserver.cpp ++++ b/addons/lspclient/lspclientserver.cpp +@@ -1255,7 +1255,8 @@ private: + {QStringLiteral("documentSymbol"), QJsonObject{{QStringLiteral("hierarchicalDocumentSymbolSupport"), true}} }, + {QStringLiteral("publishDiagnostics"), QJsonObject{{QStringLiteral("relatedInformation"), true}}}, + {QStringLiteral("codeAction"), codeAction}, +- {QStringLiteral("semanticTokens"), semanticTokens} ++ {QStringLiteral("semanticTokens"), semanticTokens}, ++ {QStringLiteral("synchronization"), QJsonObject{{QStringLiteral("didSave"), true}}}, + }, + }, + {QStringLiteral("window"), +@@ -1475,7 +1476,9 @@ public: + void didSave(const QUrl &document, const QString &text) + { + auto params = textDocumentParams(document); +- params[QStringLiteral("text")] = text; ++ if (!text.isNull()) { ++ params[QStringLiteral("text")] = text; ++ } + send(init_request(QStringLiteral("textDocument/didSave"), params)); + } + +diff --git a/addons/lspclient/lspclientservermanager.cpp b/addons/lspclient/lspclientservermanager.cpp +index 1e03801ea..551926e23 100644 +--- a/addons/lspclient/lspclientservermanager.cpp ++++ b/addons/lspclient/lspclientservermanager.cpp +@@ -833,6 +833,7 @@ private: + connect(doc, &KTextEditor::Document::aboutToClose, this, &self_type::untrack, Qt::UniqueConnection); + connect(doc, &KTextEditor::Document::destroyed, this, &self_type::untrack, Qt::UniqueConnection); + connect(doc, &KTextEditor::Document::textChanged, this, &self_type::onTextChanged, Qt::UniqueConnection); ++ connect(doc, &KTextEditor::Document::documentSavedOrUploaded, this, &self_type::onDocumentSaved, Qt::UniqueConnection); + // in case of incremental change + connect(doc, &KTextEditor::Document::textInserted, this, &self_type::onTextInserted, Qt::UniqueConnection); + connect(doc, &KTextEditor::Document::textRemoved, this, &self_type::onTextRemoved, Qt::UniqueConnection); +@@ -976,6 +977,20 @@ private: + } + } + ++ void onDocumentSaved(KTextEditor::Document *doc, bool saveAs) ++ { ++ if (!saveAs) { ++ auto it = m_docs.find(doc); ++ if (it != m_docs.end() && it->server) { ++ auto server = it->server; ++ const auto &saveOptions = server->capabilities().textDocumentSync.save; ++ if (saveOptions) { ++ server->didSave(doc->url(), saveOptions->includeText ? doc->text() : QString()); ++ } ++ } ++ } ++ } ++ + void onMessage(bool isLog, const LSPLogMessageParams ¶ms) + { + // determine server description +-- +GitLab + |