Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] many many StyleRanges created when there are loads of errors in javascript file

Hi,

i have a problem that the StyledTextEditor (js editor) gets 25.000 styles(ranges)  because somebody copy pasted a large block of code
that wasnt correct (it should be one big string but quotes where wrong so it where many strings with just plain names in between like:

var myvariable = '<html><body background="">
there xxx is just a plain js string and js tries to parse it as a variable (which goes wrong)
Now in my example taht string is a lot bigger

First the js parser bombed on it because it generated thousands of errors on that line
That is easily fixed by jsut checking the syntaxErrorCount and if that goes beyond a limit like 100 or 200 just stop parsing the file.

Problem is that in js the partitioners and damage repaires do create for that line many many style/ranges and then the script editor just is to busy painting itself

Any idea if we can somehow fix this by just dont add more styles or skip styles when we see its hits a threshold/limit?

johan


Back to the top