#pragma once #include #include #include #include #include namespace vls::features::include_update { // One edit as byte offsets into the document text. The caller converts them to // negotiated LSP positions with the document snapshot. struct Edit { std::size_t start{}, end{}; std::string replacement; auto operator<=>(const Edit &) const = default; }; struct Limits { std::size_t edits{256}; std::size_t pathBytes{4096}; std::size_t scanBytes{8 * 1024 * 1024}; }; // Edits for every quoted include directive in TEXT that resolves from the // document's directory to OLD_PATH, replacing the spelling with NEW_PATH // relative to that directory (or absolute when it was absolute). Angle // includes are never touched because their search roots are unknown. [[nodiscard]] std::vector include_edits(std::string_view text, std::string_view document_path, std::string_view old_path, std::string_view new_path, const Limits & = Limits{}); } // namespace vls::features::include_update