Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Brackets Freezing Bug #9717

Closed
ghost opened this issue Oct 28, 2014 · 11 comments
Closed

Brackets Freezing Bug #9717

ghost opened this issue Oct 28, 2014 · 11 comments

Comments

@ghost
Copy link

ghost commented Oct 28, 2014

Brackets started freezing yesterday after I added a really long unordered list. To better document and explain the issue I made a video since it's the best way to show whats really going on.

https://www.youtube.com/watch?v=YuE2PGQWn9w&feature=youtu.be

After I finished recording I removed the long unordered list, and it was working fine. Im assuming It has something to do with adding really long inline code.

OS: Yosemite
Brackets Version: 0.44

Let me know if you need any more info.

@redmunds
Copy link
Contributor

@JarolinVargas Thanks for the detailed bug report. There are known issues with very long lines of code. As a test, could you try reformatting the long list so there's an item on each line to see if that makes a difference?

@ghost
Copy link
Author

ghost commented Oct 29, 2014

That definitely fixes the issue but the list is so long it makes my code look ugly and bloated. I would prefer having them inline.

@redmunds
Copy link
Contributor

@JarolinVargas I understand -- it was just to help isolate the problem. As a tradeoff, you could split them across a few lines.

@marcelgerber
Copy link
Contributor

@redmunds I just isolated this to an issue with JavaScriptCodeHints, while other extensions like Ternific (which uses Tern as well) don't have that issue.
Investigating.

@marcelgerber
Copy link
Contributor

I found the culprit. It's the TokenUtils.moveNextToken() loop in HTMLUtils.findBlocks(). moveNextToken() calls CodeMirror.getTokenAt(), which is very performance-heavy on long lines.
So the actual fix should go in CM (if there's any, idk), but we could do something ourselves as well.
I actually have some local changes which make findBlocks() jump to the next line after 4000 chars have been parsed - it seems to work out pretty well, and I'll open a PR soon.

@pthiess
Copy link
Contributor

pthiess commented Nov 2, 2014

@marcelgerber Thanks a lot for investigating this issue!

@marcelgerber
Copy link
Contributor

Re the mentioned fix I had in mind (actually already implemented in a local branch), I'm not sure if this could lead to bugs or if this is too hacky, but I'll post a PR either way for you guys to have a look at it, as you can close it either way.

@marcelgerber
Copy link
Contributor

It actually just came to my mind that we could use a more lightweight CodeMirror StringStream + innerMode instead of getTokenAt...
I'll try that tomorrow.

@pthiess
Copy link
Contributor

pthiess commented Nov 2, 2014

@marcelgerber If you want to put something up for receiving input you can do so - please mark it [review only] to make clear that you want to brainstorm an early prototype.

Cheers,
Peter :)

@marcelgerber
Copy link
Contributor

I just created CM PR codemirror/codemirror5#2908 to get a new function into CodeMirror that would make this much faster. Hope it gets in fast, would love to have your feedback!

@redmunds
Copy link
Contributor

Closing. @JarolinVargas Let us know if this is not fixed in Brackets 1.2 .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants