[llvm] [SupportLSP] Add DidSaveTextDocumentParams (PR #172637)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 17 04:43:57 PST 2025
Albert =?utf-8?q?Havliček?= <ahavlicek at azul.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/172637 at github.com>
https://github.com/Bertik23 updated https://github.com/llvm/llvm-project/pull/172637
>From 72df0da7d1f921b9596eb5b2b466fcdd73d9ef56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Albert=20Havli=C4=8Dek?= <ahavlicek at azul.com>
Date: Wed, 17 Dec 2025 11:46:00 +0000
Subject: [PATCH 1/2] [SupportLSP] Add DidSaveTextDocumentParams
---
llvm/include/llvm/Support/LSP/Protocol.h | 11 +++++++++++
llvm/lib/Support/LSP/Protocol.cpp | 10 ++++++++++
2 files changed, 21 insertions(+)
diff --git a/llvm/include/llvm/Support/LSP/Protocol.h b/llvm/include/llvm/Support/LSP/Protocol.h
index 30d68bad6691a..8f05c6f812d01 100644
--- a/llvm/include/llvm/Support/LSP/Protocol.h
+++ b/llvm/include/llvm/Support/LSP/Protocol.h
@@ -494,6 +494,17 @@ LLVM_ABI_FOR_TEST bool fromJSON(const llvm::json::Value &value,
DidCloseTextDocumentParams &result,
llvm::json::Path path);
+//===----------------------------------------------------------------------===//
+// DidSaveTextDocumentParams
+//===----------------------------------------------------------------------===//
+
+struct DidSaveTextDocumentParams {
+ /// The document that was saved.
+ TextDocumentIdentifier textDocument;
+};
+bool fromJSON(const llvm::json::Value &, DidSaveTextDocumentParams &,
+ llvm::json::Path);
+
//===----------------------------------------------------------------------===//
// DidChangeTextDocumentParams
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Support/LSP/Protocol.cpp b/llvm/lib/Support/LSP/Protocol.cpp
index c2957bdc0dacb..5c2379431e900 100644
--- a/llvm/lib/Support/LSP/Protocol.cpp
+++ b/llvm/lib/Support/LSP/Protocol.cpp
@@ -502,6 +502,16 @@ bool llvm::lsp::fromJSON(const llvm::json::Value &Value,
return O && O.map("textDocument", Result.textDocument);
}
+//===----------------------------------------------------------------------===//
+// DidSaveTextDocumentParams
+//===----------------------------------------------------------------------===//
+
+bool llvm::lsp::fromJSON(const llvm::json::Value &Params,
+ DidSaveTextDocumentParams &R, llvm::json::Path P) {
+ llvm::json::ObjectMapper O(Params, P);
+ return O && O.map("textDocument", R.textDocument);
+}
+
//===----------------------------------------------------------------------===//
// DidChangeTextDocumentParams
//===----------------------------------------------------------------------===//
>From 1453fea45fca34de4eb6496ecdec07bfd3ed9c07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Albert=20Havli=C4=8Dek?= <ahavlicek at azul.com>
Date: Wed, 17 Dec 2025 12:43:42 +0000
Subject: [PATCH 2/2] [SupportLSP] Add LLVM_ABI_FOR_TEST anotations
---
llvm/include/llvm/Support/LSP/Protocol.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/llvm/include/llvm/Support/LSP/Protocol.h b/llvm/include/llvm/Support/LSP/Protocol.h
index 8f05c6f812d01..a75ac291d1bcc 100644
--- a/llvm/include/llvm/Support/LSP/Protocol.h
+++ b/llvm/include/llvm/Support/LSP/Protocol.h
@@ -502,8 +502,9 @@ struct DidSaveTextDocumentParams {
/// The document that was saved.
TextDocumentIdentifier textDocument;
};
-bool fromJSON(const llvm::json::Value &, DidSaveTextDocumentParams &,
- llvm::json::Path);
+
+LLVM_ABI_FOR_TEST bool fromJSON(const llvm::json::Value &,
+ DidSaveTextDocumentParams &, llvm::json::Path);
//===----------------------------------------------------------------------===//
// DidChangeTextDocumentParams
More information about the llvm-commits
mailing list