Skip to content

Commit

Permalink
Try to force definitions file to have LF endings
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Feb 26, 2023
1 parent f6f9e9d commit 2f3157b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion packages/cli/src/gen/definitions/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 2f3157b

Please sign in to comment.