Handle workspace file-operation notifications

The server advertises didCreate/didRename/didDelete file operations
with file-scheme filters. A bounded core converts notifications into
canonical filesystem changes (rename as old-gone/new-present, non-file
URIs ignored, invalid URIs rejected) with registered tests, and
EditorDiagnostics invalidates every dependent index context for
changed or removed paths before re-queueing open documents. A real
stdio session observed the index become incomplete after a deleted
header, and a malformed notification left the server answering.
This commit is contained in:
faumaray committed 2026-12-05 16:03:06 +03:00
1 parent 130cb57a7f
commit 158125ace5
12 files changed
+248 -12

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ add_library(vls_protocol STATIC src/Protocol/Framing.cpp src/Protocol/Json.cpp
src/Build/ProviderFile.cpp src/Build/CommandImport.cpp src/Build/VbsProvider.cpp src/Build/ProviderFile.cpp src/Build/CommandImport.cpp src/Build/VbsProvider.cpp
src/Build/CompdbProvider.cpp src/DocumentSync.cpp src/WorkspaceSession.cpp src/Server.cpp src/Build/CompdbProvider.cpp src/DocumentSync.cpp src/WorkspaceSession.cpp src/Server.cpp
src/semantic/Diagnostics.cpp src/semantic/SourceCatalog.cpp src/semantic/StockCompiler.cpp src/semantic/EditorDiagnostics.cpp src/semantic/Occurrences.cpp src/scheduler/Scheduler.cpp src/semantic/Diagnostics.cpp src/semantic/SourceCatalog.cpp src/semantic/StockCompiler.cpp src/semantic/EditorDiagnostics.cpp src/semantic/Occurrences.cpp src/scheduler/Scheduler.cpp
src/modules/ModuleGraph.cpp src/modules/ArtifactCache.cpp src/modules/GccArtifacts.cpp src/modules/ScheduledArtifacts.cpp src/index/SymbolIndex.cpp src/navigation/Navigation.cpp src/reflection/Provenance.cpp src/features/Completion.cpp src/features/IndexNavigation.cpp src/features/SignatureHelp.cpp src/features/DocumentSymbols.cpp src/features/TextStructure.cpp src/features/CodeActions.cpp src/features/SemanticTokens.cpp src/features/InlayHints.cpp src/debug/live/LiveSession.cpp src/modules/ModuleWorkQueue.cpp src/modules/GccScan.cpp src/modules/ScanCommand.cpp) src/modules/ModuleGraph.cpp src/modules/ArtifactCache.cpp src/modules/GccArtifacts.cpp src/modules/ScheduledArtifacts.cpp src/index/SymbolIndex.cpp src/navigation/Navigation.cpp src/reflection/Provenance.cpp src/features/Completion.cpp src/features/IndexNavigation.cpp src/features/SignatureHelp.cpp src/features/DocumentSymbols.cpp src/features/TextStructure.cpp src/features/CodeActions.cpp src/features/SemanticTokens.cpp src/features/InlayHints.cpp src/features/FileOperations.cpp src/debug/live/LiveSession.cpp src/modules/ModuleWorkQueue.cpp src/modules/GccScan.cpp src/modules/ScanCommand.cpp)
target_include_directories(vls_protocol PUBLIC "${PROJECT_SOURCE_DIR}/include") target_include_directories(vls_protocol PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_link_libraries(vls_protocol PUBLIC Void::Data PRIVATE Void::Unicode Void::Text Void::Crypto Void::System) target_link_libraries(vls_protocol PUBLIC Void::Data PRIVATE Void::Unicode Void::Text Void::Crypto Void::System)
target_compile_options(vls_protocol PUBLIC -freflection PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(vls_protocol PUBLIC -freflection PRIVATE -Wall -Wextra -Wpedantic)
+3 -1
View File
@@ -74,6 +74,7 @@ void build(Void::Build::Project &project) {
"src/features/CodeActions.cpp", "src/features/CodeActions.cpp",
"src/features/SemanticTokens.cpp", "src/features/SemanticTokens.cpp",
"src/features/InlayHints.cpp", "src/features/InlayHints.cpp",
"src/features/FileOperations.cpp",
"src/debug/live/LiveSession.cpp", "src/debug/live/LiveSession.cpp",
"src/modules/ModuleWorkQueue.cpp", "src/modules/ModuleWorkQueue.cpp",
"src/modules/GccScan.cpp", "src/modules/GccScan.cpp",
@@ -154,7 +155,8 @@ void build(Void::Build::Project &project) {
{"tests/features/CompletionTests.cpp", "tests/features/IndexNavigationTests.cpp", {"tests/features/CompletionTests.cpp", "tests/features/IndexNavigationTests.cpp",
"tests/features/SignatureHelpTests.cpp", "tests/features/DocumentSymbolsTests.cpp", "tests/features/SignatureHelpTests.cpp", "tests/features/DocumentSymbolsTests.cpp",
"tests/features/TextStructureTests.cpp", "tests/features/CodeActionsTests.cpp", "tests/features/TextStructureTests.cpp", "tests/features/CodeActionsTests.cpp",
"tests/features/SemanticTokensTests.cpp", "tests/features/InlayHintsTests.cpp"}); "tests/features/SemanticTokensTests.cpp", "tests/features/InlayHintsTests.cpp",
"tests/features/FileOperationsTests.cpp"});
auto live_worker = project.executable("vls_live_worker_fixture"); auto live_worker = project.executable("vls_live_worker_fixture");
live_worker.cxx_standard(CxxStandard::Cxx26) live_worker.cxx_standard(CxxStandard::Cxx26)
.sources({"tests/debug/LiveWorkerFixture.cpp"}) .sources({"tests/debug/LiveWorkerFixture.cpp"})
+5 -4
View File
@@ -22,6 +22,7 @@ missing part. Updated December 5, 2026 after semantic tokens and inlay hints.
| textDocument/semanticTokens/full | `vls_feature_tests`, real stdio session | | textDocument/semanticTokens/full | `vls_feature_tests`, real stdio session |
| textDocument/inlayHint (parameter types) | `vls_feature_tests`, real stdio session | | textDocument/inlayHint (parameter types) | `vls_feature_tests`, real stdio session |
| workspace/symbol | stock occurrence corpus | | workspace/symbol | stock occurrence corpus |
| workspace fileOperations (didCreate/didRename/didDelete) | `vls_feature_tests`, real stdio session |
| voidLanguageServer/analysisStatus, providerStatus | stdio corpora | | voidLanguageServer/analysisStatus, providerStatus | stdio corpora |
| Debug adapter (DAP) separately through `vls-dap` | `vls_live_tests`, `vls_dap_tests` | | Debug adapter (DAP) separately through `vls-dap` | `vls_live_tests`, `vls_dap_tests` |
@@ -34,7 +35,7 @@ missing part. Updated December 5, 2026 after semantic tokens and inlay hints.
| textDocument/formatting | needs a plan | | textDocument/formatting | needs a plan |
| callHierarchy / typeHierarchy | needs compiler call/type relationships | | callHierarchy / typeHierarchy | needs compiler call/type relationships |
| textDocument/codeLens, executeCommand | command surface not designed | | textDocument/codeLens, executeCommand | command surface not designed |
| workspace edits and file operations | client-side application is also open | | Client-side application of server-issued workspace edits | rename and code actions return edits the clients apply directly |
| Applying multi-file renames through client buffers | plans can be ready; application is client work | | Applying multi-file renames through client buffers | plans can be ready; application is client work |
| `EditorDiagnostics` reflection LSP wiring | the server has no reflection data source | | `EditorDiagnostics` reflection LSP wiring | the server has no reflection data source |
| semantic token modifiers / richer token types | legend is one type (`function`) from occurrences | | semantic token modifiers / richer token types | legend is one type (`function`) from occurrences |
@@ -42,6 +43,6 @@ missing part. Updated December 5, 2026 after semantic tokens and inlay hints.
## Next slices ## Next slices
1. `workspace/applyEdit` and client-side application of ready rename plans. 1. call hierarchy from stock call facts.
2. call hierarchy from stock call facts. 2. Formatting via the selected compiler.
3. Formatting via the selected compiler. 3. code lens and executeCommand.
+1 -1
View File
@@ -102,7 +102,7 @@ ingests occurrence facts after each analysis and the server answers
Hash.hpp definition through it. Real persistence migrations and cross-file Hash.hpp definition through it. Real persistence migrations and cross-file
rename coverage remain open. rename coverage remain open.
Index-backed completion (roadmap 14 first slice) is implemented: `include/vls/features/Completion.hpp`, `src/features/Completion.cpp` and registered `vls_feature_tests` cover prefix extraction, filtering with replacement ranges, label+kind deduplication, deterministic ranking and bounds. `Server.cpp` advertises `completionProvider` and answers `textDocument/completion` from the symbol index through `EditorDiagnostics::completion`; a real stdio session with the stock observer returned `fnv1a64` and `fnv1a64_update` at a real call site. Every result is marked incomplete because the index does not prove visibility. Signature help is now served from the compiler-provided occurrence signature (parameter labels and ranges, active parameter, innermost call selection) and advertised by the server. Document symbols are served from the index by path and document highlights from same-binding occurrence facts; both are advertised and were exercised over stdio with the stock observer. Selection and folding ranges are served from immutable document snapshots with registered bounded cores. Code actions now offer the compiler's own suggested fixes (quickfix) from retained published diagnostics, with SARIF fix decoding bound to the owner snapshot. Semantic tokens encode the proven call occurrences with a bounded one-type legend. Inlay hints project parameter types from the occurrence signature at each argument start. Compiler-native completion with visibility proof and deferred detail resolution remain open. Index-backed completion (roadmap 14 first slice) is implemented: `include/vls/features/Completion.hpp`, `src/features/Completion.cpp` and registered `vls_feature_tests` cover prefix extraction, filtering with replacement ranges, label+kind deduplication, deterministic ranking and bounds. `Server.cpp` advertises `completionProvider` and answers `textDocument/completion` from the symbol index through `EditorDiagnostics::completion`; a real stdio session with the stock observer returned `fnv1a64` and `fnv1a64_update` at a real call site. Every result is marked incomplete because the index does not prove visibility. Signature help is now served from the compiler-provided occurrence signature (parameter labels and ranges, active parameter, innermost call selection) and advertised by the server. Document symbols are served from the index by path and document highlights from same-binding occurrence facts; both are advertised and were exercised over stdio with the stock observer. Selection and folding ranges are served from immutable document snapshots with registered bounded cores. Code actions now offer the compiler's own suggested fixes (quickfix) from retained published diagnostics, with SARIF fix decoding bound to the owner snapshot. Semantic tokens encode the proven call occurrences with a bounded one-type legend. Inlay hints project parameter types from the occurrence signature at each argument start. Workspace file-operation notifications invalidate dependent index contexts and re-queue open documents. Compiler-native completion with visibility proof and deferred detail resolution remain open.
The reflection provenance representation (roadmap 12 first slice) is The reflection provenance representation (roadmap 12 first slice) is
implemented as a bounded library with a registered suite: innermost-first implemented as a bounded library with a registered suite: innermost-first
+18
View File
@@ -79,6 +79,24 @@ the upgraded snapshot (keeping `snapshot.prev.json`) and rewrites a legacy
about 25-30s in a Debug build (it passed VBS at ~27s); the full CMake run then about 25-30s in a Debug build (it passed VBS at ~27s); the full CMake run then
passed 18/18. passed 18/18.
## December 5 workspace file operations
The server advertises `workspace.fileOperations` (`didCreate`, `didRename`,
`didDelete`) with file-scheme filters. `include/vls/features/FileOperations.hpp`
converts notifications into canonical filesystem changes (rename yields the old
path gone and the new path present; non-file URIs are counted as ignored;
invalid URIs reject the notification) with registered `vls_feature_tests`
cases. `EditorDiagnostics::files_changed` invalidates every dependent index
context for changed or removed paths (clearing an overlay for removed files) and
the editor re-queues open documents.
A real stdio session with a temporary workspace whose `main.cpp` includes
`extra.hpp`: before deletion `ready` with `index {'complete': True, 'records': 1}`;
after deleting the header and sending `workspace/didDeleteFiles` the analysis
re-ran to `partial` with `index {'complete': False, 'records': 0}`, and a
malformed rename notification left the server answering. All 18 native suites
and all 18 CMake tests passed.
## December 5 inlay hints from occurrence signatures ## December 5 inlay hints from occurrence signatures
`include/vls/features/InlayHints.hpp` finds the top-level argument starts of a `include/vls/features/InlayHints.hpp` finds the top-level argument starts of a
+48
View File
@@ -0,0 +1,48 @@
#pragma once
#include <compare>
#include <cstddef>
#include <expected>
#include <span>
#include <string>
#include <string_view>
#include <vector>
namespace vls::features::file_operations {
// LSP file-operation notifications.
enum class Kind { create, rename, delete_ };
// One entry of a notification's `files` array. Rename carries both URIs.
struct Input {
Kind kind{Kind::create};
std::string uri;
std::string old_uri;
};
// A resulting filesystem change. `gone` means the path no longer exists at
// that identity, so dependent analysis is invalid rather than merely stale.
struct Change {
std::string path;
bool gone{};
auto operator<=>(const Change &) const = default;
};
struct Limits {
std::size_t files{4096};
std::size_t pathBytes{4096};
};
struct Result {
std::vector<Change> changes;
// Non-file URIs are ignored (they cannot belong to a filesystem context).
std::size_t ignored{};
};
// Converts notifications into canonical filesystem changes. A rename yields
// the old path as gone and the new path as present. Malformed entries are
// rejected rather than partially applied.
[[nodiscard]] std::expected<Result, std::string> parse(std::span<const Input>,
const Limits & = Limits{});
} // namespace vls::features::file_operations
@@ -1,5 +1,6 @@
#pragma once #pragma once
#include <vls/features/FileOperations.hpp>
#include <vls/semantic/StockCompiler.hpp> #include <vls/semantic/StockCompiler.hpp>
#include <functional> #include <functional>
@@ -16,6 +17,9 @@ class EditorDiagnostics {
WorkspaceSession &, const Documents::DocumentStore &, Send); WorkspaceSession &, const Documents::DocumentStore &, Send);
~EditorDiagnostics(); ~EditorDiagnostics();
void set_version_support(bool); void set_version_support(bool);
// Filesystem changes from workspace file-operation notifications. Paths
// that changed or disappeared invalidate every dependent analysis context.
void files_changed(std::span<const features::file_operations::Change>);
void begin_update(); void begin_update();
void finish_update(bool workspace_changed = false); void finish_update(bool workspace_changed = false);
void stop(); void stop();
+47 -4
View File
@@ -21,6 +21,13 @@ using Protocol::as_object;
using Protocol::as_string; using Protocol::as_string;
using Protocol::find_member; using Protocol::find_member;
Json file_operation_registration() {
return Json{Json::Object{
{"filters", Json{Json::Array{Json{Json::Object{
{"scheme", Json{std::string{"file"}}},
{"pattern", Json{Json::Object{{"glob", Json{std::string{"**/*"}}}}}}}}}}}}};
}
const Json *member(const Json *value, std::string_view key) { const Json *member(const Json *value, std::string_view key) {
const auto *object = as_object(value); const auto *object = as_object(value);
return object ? find_member(*object, key) : nullptr; return object ? find_member(*object, key) : nullptr;
@@ -213,6 +220,39 @@ DispatchResult Server::handle(std::string_view body) {
.diagnostic = updated.error().substr(0, 256)}; .diagnostic = updated.error().substr(0, 256)};
return {}; return {};
} }
if (*method == "workspace/didCreateFiles" || *method == "workspace/didRenameFiles" ||
*method == "workspace/didDeleteFiles") {
if (!diagnostics_)
return {};
const auto *files = as_array(member(params, "files"));
if (!files)
return {.response = std::nullopt,
.exit_code = std::nullopt,
.diagnostic = "invalid file operation notification"};
const auto kind = *method == "workspace/didCreateFiles"
? features::file_operations::Kind::create
: *method == "workspace/didRenameFiles"
? features::file_operations::Kind::rename
: features::file_operations::Kind::delete_;
std::vector<features::file_operations::Input> inputs;
for (const auto &item : *files) {
const auto *fields = as_object(&item);
const auto *uri = fields ? as_string(find_member(*fields, "uri")) : nullptr;
const auto *old_uri =
fields ? as_string(find_member(*fields, "oldUri")) : nullptr;
inputs.push_back(
{kind, uri ? *uri : std::string{}, old_uri ? *old_uri : std::string{}});
}
const auto parsed = features::file_operations::parse(inputs);
if (!parsed)
return {.response = std::nullopt,
.exit_code = std::nullopt,
.diagnostic = parsed.error()};
diagnostics_->begin_update();
diagnostics_->files_changed(parsed->changes);
diagnostics_->finish_update(true);
return {};
}
const bool change = *method == "textDocument/didOpen" || const bool change = *method == "textDocument/didOpen" ||
*method == "textDocument/didChange" || *method == "textDocument/didChange" ||
*method == "textDocument/didClose"; *method == "textDocument/didClose";
@@ -253,14 +293,17 @@ DispatchResult Server::handle(std::string_view body) {
Protocol::as_bool(member(edit, "documentChanges")).value_or(false)); Protocol::as_bool(member(edit, "documentChanges")).value_or(false));
} }
Json::Object sync{{"openClose", Json{true}}, {"change", Json{std::int64_t{2}}}}; Json::Object sync{{"openClose", Json{true}}, {"change", Json{std::int64_t{2}}}};
Json::Object folders{{"supported", Json{true}}, {"changeNotifications", Json{true}}};
Json::Object workspace{
{"workspaceFolders", Json{std::move(folders)}},
{"fileOperations", Json{Json::Object{{"didCreate", file_operation_registration()},
{"didRename", file_operation_registration()},
{"didDelete", file_operation_registration()}}}}};
Json::Object capabilities{ Json::Object capabilities{
{"positionEncoding", {"positionEncoding",
Json{std::string{Void::LanguageServer::Documents::encoding_name(encoding)}}}, Json{std::string{Void::LanguageServer::Documents::encoding_name(encoding)}}},
{"textDocumentSync", Json{std::move(sync)}}, {"textDocumentSync", Json{std::move(sync)}},
{"workspace", {"workspace", Json{std::move(workspace)}}};
Json{Json::Object{
{"workspaceFolders", Json{Json::Object{{"supported", Json{true}},
{"changeNotifications", Json{true}}}}}}}}};
if (diagnostics_) { if (diagnostics_) {
capabilities.emplace("documentSymbolProvider", Json{true}); capabilities.emplace("documentSymbolProvider", Json{true});
capabilities.emplace("selectionRangeProvider", Json{true}); capabilities.emplace("selectionRangeProvider", Json{true});
+45
View File
@@ -0,0 +1,45 @@
#include <vls/features/FileOperations.hpp>
#include <Void/LanguageServer/Documents/Uri.hpp>
namespace vls::features::file_operations {
std::expected<Result, std::string> parse(std::span<const Input> inputs, const Limits &limits) {
if (inputs.size() > limits.files)
return std::unexpected("too many file operations");
Result result;
const auto add = [&](const std::string &uri, bool gone) -> std::expected<void, std::string> {
if (uri.size() > limits.pathBytes)
return std::unexpected("file operation URI exceeds its bound");
const auto identity = Void::LanguageServer::Documents::normalize_uri(uri);
if (!identity)
return std::unexpected("file operation URI is invalid");
if (!identity->is_file_uri) {
++result.ignored;
return {};
}
result.changes.push_back({identity->canonical_path.native(), gone});
return {};
};
for (const auto &input : inputs) {
switch (input.kind) {
case Kind::create:
if (auto added = add(input.uri, false); !added)
return std::unexpected(added.error());
break;
case Kind::delete_:
if (auto added = add(input.uri, true); !added)
return std::unexpected(added.error());
break;
case Kind::rename:
if (auto added = add(input.old_uri, true); !added)
return std::unexpected(added.error());
if (auto added = add(input.uri, false); !added)
return std::unexpected(added.error());
break;
}
}
return result;
}
} // namespace vls::features::file_operations
+12
View File
@@ -696,6 +696,18 @@ void EditorDiagnostics::begin_update() {
s.module_work.cancel(key); s.module_work.cancel(key);
} }
} }
void EditorDiagnostics::files_changed(std::span<const features::file_operations::Change> changes) {
auto &s = *state_;
std::lock_guard lock{s.mutex};
for (const auto &change : changes) {
if (change.gone)
s.symbols.clear_overlay(change.path);
// The new content is unknown, so the path is treated as changed: every
// context that consumed it is marked incomplete, never silently kept.
s.symbols.invalidate(change.path, std::nullopt);
}
}
void EditorDiagnostics::finish_update(bool workspace_changed) { void EditorDiagnostics::finish_update(bool workspace_changed) {
auto &s = *state_; auto &s = *state_;
auto overlays = s.documents.list_overlays(); auto overlays = s.documents.list_overlays();
+1 -1
View File
@@ -22,7 +22,7 @@ vls_test_suite(vls_scheduler_tests scheduler/SchedulerTests.cpp)
vls_test_suite(vls_index_tests index/SymbolIndexTests.cpp) vls_test_suite(vls_index_tests index/SymbolIndexTests.cpp)
vls_test_suite(vls_navigation_tests navigation/NavigationTests.cpp) vls_test_suite(vls_navigation_tests navigation/NavigationTests.cpp)
vls_test_suite(vls_reflection_tests reflection/ProvenanceTests.cpp) vls_test_suite(vls_reflection_tests reflection/ProvenanceTests.cpp)
vls_test_suite(vls_feature_tests features/CompletionTests.cpp features/IndexNavigationTests.cpp features/SignatureHelpTests.cpp features/DocumentSymbolsTests.cpp features/TextStructureTests.cpp features/CodeActionsTests.cpp features/SemanticTokensTests.cpp features/InlayHintsTests.cpp) vls_test_suite(vls_feature_tests features/CompletionTests.cpp features/IndexNavigationTests.cpp features/SignatureHelpTests.cpp features/DocumentSymbolsTests.cpp features/TextStructureTests.cpp features/CodeActionsTests.cpp features/SemanticTokensTests.cpp features/InlayHintsTests.cpp features/FileOperationsTests.cpp)
vls_test_suite(vls_live_tests debug/LiveSessionTests.cpp debug/LiveDapTests.cpp) vls_test_suite(vls_live_tests debug/LiveSessionTests.cpp debug/LiveDapTests.cpp)
target_link_libraries(vls_live_tests PRIVATE Void::System) target_link_libraries(vls_live_tests PRIVATE Void::System)
add_dependencies(vls_live_tests vls_live_worker_fixture vls-dap) add_dependencies(vls_live_tests vls_live_worker_fixture vls-dap)
+63
View File
@@ -0,0 +1,63 @@
#include <vls/features/FileOperations.hpp>
#include <Void/Testing/Assert.hpp>
#include <Void/Testing/Test.hpp>
#include <string>
#include <vector>
namespace {
using namespace vls::features::file_operations;
using Void::Testing::expect;
using Void::Testing::require;
Input input(Kind kind, std::string uri, std::string old_uri = {}) {
return {kind, std::move(uri), std::move(old_uri)};
}
} // namespace
VOID_TEST(FileOperations, create_and_delete_map_to_presence_and_absence) {
const std::vector<Input> inputs{input(Kind::create, "file:///project/a.cpp"),
input(Kind::delete_, "file:///project/b.cpp")};
const auto result = parse(inputs);
require(result.has_value());
require(result->changes.size() == 2);
expect(result->changes[0] == Change{"/project/a.cpp", false});
expect(result->changes[1] == Change{"/project/b.cpp", true});
}
VOID_TEST(FileOperations, rename_reports_the_old_path_gone_and_the_new_present) {
const std::vector<Input> inputs{
input(Kind::rename, "file:///project/new.cpp", "file:///project/old.cpp")};
const auto result = parse(inputs);
require(result.has_value());
require(result->changes.size() == 2);
expect(result->changes[0] == Change{"/project/old.cpp", true});
expect(result->changes[1] == Change{"/project/new.cpp", false});
}
VOID_TEST(FileOperations, non_file_uris_are_ignored_not_rejected) {
const std::vector<Input> inputs{input(Kind::create, "untitled:Untitled-1"),
input(Kind::create, "file:///project/a.cpp")};
const auto result = parse(inputs);
require(result.has_value());
expect(result->ignored == 1);
require(result->changes.size() == 1);
expect(result->changes.front().path == "/project/a.cpp");
}
VOID_TEST(FileOperations, invalid_uris_reject_the_notification) {
const std::vector<Input> invalid{input(Kind::create, "")};
expect(!parse(invalid).has_value());
const std::vector<Input> malformed{input(Kind::create, "file://host/a.cpp")};
expect(!parse(malformed).has_value());
}
VOID_TEST(FileOperations, counts_and_paths_are_bounded) {
const std::vector<Input> inputs{input(Kind::create, "file:///project/a.cpp"),
input(Kind::create, "file:///project/b.cpp")};
expect(!parse(inputs, Limits{.files = 1}).has_value());
const std::vector<Input> one{input(Kind::create, "file:///project/a.cpp")};
expect(!parse(one, Limits{.pathBytes = 8}).has_value());
require(parse(one, Limits{.pathBytes = 4096}).has_value());
}