1
0
Fork 0
mirror of git://slackware.nl/current.git synced 2025-02-07 20:46:40 +01:00
slackware-current/source/kde/kde/patch/kate/361dd43e42994829dbdb35e78fb7698d27cbb0e2.patch
Patrick J Volkerding ba74260aeb Tue Feb 1 08:27:47 UTC 2022
kde/kate-21.12.1-x86_64-2.txz:  Rebuilt.
  Fix missing validation of binaries executed via QProcess.
  Thanks to Heinz Wiesinger.
  For more information, see:
    https://kde.org/info/security/advisory-20220131-1.txt
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23853
  (* Security fix *)
2022-02-01 17:59:49 +01:00

87 lines
3.6 KiB
Diff

From 361dd43e42994829dbdb35e78fb7698d27cbb0e2 Mon Sep 17 00:00:00 2001
From: Mark Nauwelaerts <mark.nauwelaerts@gmail.com>
Date: Mon, 13 Dec 2021 20:52:57 +0100
Subject: [PATCH] lspclient: consider some additional server capabilities
---
addons/lspclient/lspclientprotocol.h | 14 +++++++++++++-
addons/lspclient/lspclientserver.cpp | 9 ++++++++-
addons/lspclient/lspclientservermanager.cpp | 2 +-
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/addons/lspclient/lspclientprotocol.h b/addons/lspclient/lspclientprotocol.h
index 0fb7f4485..9de0ec511 100644
--- a/addons/lspclient/lspclientprotocol.h
+++ b/addons/lspclient/lspclientprotocol.h
@@ -21,6 +21,8 @@
#include <KTextEditor/Cursor>
#include <KTextEditor/Range>
+#include <optional>
+
// Following types roughly follow the types/interfaces as defined in LSP protocol spec
// although some deviation may arise where it has been deemed useful
// Moreover, to avoid introducing a custom 'optional' type, absence of an optional
@@ -51,6 +53,16 @@ struct LSPResponseError {
enum class LSPDocumentSyncKind { None = 0, Full = 1, Incremental = 2 };
+struct LSPSaveOptions {
+ bool includeText = false;
+};
+
+// only used parts for now
+struct LSPTextDocumentSyncOptions {
+ LSPDocumentSyncKind change = LSPDocumentSyncKind::None;
+ std::optional<LSPSaveOptions> save;
+};
+
struct LSPCompletionOptions {
bool provider = false;
bool resolveProvider = false;
@@ -81,7 +93,7 @@ struct LSPWorkspaceFoldersServerCapabilities {
};
struct LSPServerCapabilities {
- LSPDocumentSyncKind textDocumentSync = LSPDocumentSyncKind::None;
+ LSPTextDocumentSyncOptions textDocumentSync;
bool hoverProvider = false;
LSPCompletionOptions completionProvider;
LSPSignatureHelpOptions signatureHelpProvider;
diff --git a/addons/lspclient/lspclientserver.cpp b/addons/lspclient/lspclientserver.cpp
index 8739d46c9..a7094fde2 100644
--- a/addons/lspclient/lspclientserver.cpp
+++ b/addons/lspclient/lspclientserver.cpp
@@ -344,8 +344,15 @@ static void from_json(LSPServerCapabilities &caps, const QJsonObject &json)
};
auto sync = json.value(QStringLiteral("textDocumentSync"));
- caps.textDocumentSync = static_cast<LSPDocumentSyncKind>(
+ caps.textDocumentSync.change = static_cast<LSPDocumentSyncKind>(
(sync.isObject() ? sync.toObject().value(QStringLiteral("change")) : sync).toInt(static_cast<int>(LSPDocumentSyncKind::None)));
+ if (sync.isObject()) {
+ auto syncObject = sync.toObject();
+ auto save = syncObject.value(QStringLiteral("save"));
+ if (save.isObject() || save.toBool()) {
+ caps.textDocumentSync.save = {save.toObject().value(QStringLiteral("includeText")).toBool()};
+ }
+ }
caps.hoverProvider = toBoolOrObject(json.value(QStringLiteral("hoverProvider")));
from_json(caps.completionProvider, json.value(QStringLiteral("completionProvider")));
from_json(caps.signatureHelpProvider, json.value(QStringLiteral("signatureHelpProvider")));
diff --git a/addons/lspclient/lspclientservermanager.cpp b/addons/lspclient/lspclientservermanager.cpp
index 1fbcf928f..1e03801ea 100644
--- a/addons/lspclient/lspclientservermanager.cpp
+++ b/addons/lspclient/lspclientservermanager.cpp
@@ -931,7 +931,7 @@ private:
auto it = m_docs.find(doc);
if (it != m_docs.end() && it->server) {
const auto &caps = it->server->capabilities();
- if (caps.textDocumentSync == LSPDocumentSyncKind::Incremental) {
+ if (caps.textDocumentSync.change == LSPDocumentSyncKind::Incremental) {
return &(*it);
}
}
--
GitLab