#pragma once #include #include #include #include #include #include #include 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 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 parse(std::span, const Limits & = Limits{}); } // namespace vls::features::file_operations