Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locheck hangs on some // comments #40

Open
alex-hunsley-nl opened this issue Sep 12, 2022 · 2 comments
Open

Locheck hangs on some // comments #40

alex-hunsley-nl opened this issue Sep 12, 2022 · 2 comments

Comments

@alex-hunsley-nl
Copy link

Locheck was hanging for me. I found out the problem was a line like this:

////////////////////////

I also found out that a line with a comment and no characters after the slashes has the same effect:

//

@alex-hunsley-nl alex-hunsley-nl changed the title Locheck hangs if a line contains // at the end Locheck hangs on some // comments Sep 12, 2022
@stevelandeyasana
Copy link
Collaborator

stevelandeyasana commented Sep 12, 2022

I wrote a unit test for this but wasn't able to reproduce the issue. I also tried adding the lines to the demo .strings files and didn't see a hang. Can you provide a minimal example .strings file that has the problem?

The way this works under the hood is a simple regex match on each line. All I can think of is that the regex is taking a really long time, but I would think I'd be able to easily reproduce that.

@alex-hunsley-nl
Copy link
Author

alex-hunsley-nl commented Sep 13, 2022

Hi Steve, thanks. Yes I think it's the regular expression matching then.

If one of my Localizable.strings files contains just this (with newline at the end) we start to get slow performance:

//////////////////////////////////////

If you add a few more /, it's slow enough to seem like it's hanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants