Try to force definitions file to have LF endings

This commit is contained in:
Filip Tibell 2023-02-26 21:41:15 +01:00
parent f6f9e9db1f
commit 2f3157b64d
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

5
.gitattributes vendored
View file

@ -1,4 +1,9 @@
* text=auto
# Temporarily highlight luau as normal lua files
# until we get native linguist support for Luau
*.luau linguist-language=Lua
# Ensure all lua files use LF
*.lua eol=lf
*.luau eol=lf

View file

@ -49,7 +49,7 @@ impl DefinitionsParser {
S: AsRef<str>,
{
// TODO: Properly handle the "declare class" syntax, for now we just skip it
let mut no_class_declares = contents.as_ref().to_string();
let mut no_class_declares = contents.as_ref().replace("\r\n", "\n");
while let Some(dec) = no_class_declares.find("\ndeclare class") {
let end = no_class_declares.find("\nend").unwrap();
let before = &no_class_declares[0..dec];