lsp: handle line-endings appropriately (#3318)

This commit is contained in:
Tyler Wilding
2024-01-18 20:32:30 -05:00
committed by GitHub
parent c3e4baf697
commit 272cb32a45
6 changed files with 60 additions and 17 deletions
+2
View File
@@ -18,7 +18,9 @@ int line_count(const std::string& str);
bool valid_regex(const std::string& regex);
std::string diff(const std::string& lhs, const std::string& rhs);
/// Default splits on \n characters
/// DEPRECATED - stop using it, limited as it only takes a char
std::vector<std::string> split(const ::std::string& str, char delimiter = '\n');
std::vector<std::string> split_string(const std::string& str, const std::string& delimiter = "\n");
std::string join(const std::vector<std::string>& strs, const std::string& join_with);
std::vector<std::string> regex_get_capture_groups(const std::string& str, const std::string& regex);
bool replace(std::string& str, const std::string& from, const std::string& to);