Skip to content

Colorization fails at 9 nested JavaScript functions #10908

Closed

Description

@davidcapatch
  • VSCode Version: 1.4.0
  • OS Version: OS X 10.11.6

Steps to Reproduce:

  1. Open a blank .js file
  2. Create 9 nested functions following this format
var foo1 = function() {
    var foo2 = function() {
        ...
    }
};
  1. Colorization stops a 9th function

Issue does not occur using this function format:
function foo1() {};

See screenshot
screen shot 2016-08-24 at 2 25 48 pm

Activity

  1. waderyan commented on Aug 25, 2016

    @waderyan

    alexandrudima we've seen this before right? I can't find the issue now but I remember seeing something similar. There was a constant we set for when we would stop colorizing. Can you remember this issue? Maybe it was someone else on the team.

  2. alexdima commented on Aug 26, 2016

    @alexdima
    Member

    Wade Anderson (@waderyan) yes, we have similar issues. I opt not to collapse them until we find the root cause in each of them.

  3. added
    bug
    on Aug 26, 2016
  4. alexdima commented on Aug 29, 2016

    @alexdima
    Member

    From debugging, each nested level increases the rule stack by 4 elements. Rule stack length at the end of each line:

    /*01 -  5 */var foo1 = function() {
    /*02 -  9 */    var foo2 = function() {
    /*03 - 13 */        var foo3 = function() {
    /*04 - 17 */            var foo4 = function() {
    /*05 - 21 */                var foo5 = function() {
    /*06 - 25 */                    var foo6 = function() {
    /*07 - 29 */                        var foo7 = function() {
    /*08 - 33 */                            var foo8 = function() {
    /*09 - 37 */                                var foo9 = function() {
    /*10 - 41 */                                    var foo10 = function() {
    /*11 - 45 */                                        var foo11 = function() {
    /*12 - 41 */                                        };
    /*13 - 37 */                                    };
    /*14 - 33 */                                };
    /*15 - 29 */                            };
    /*16 - 25 */                        };
    /*17 - 21 */                    };
    /*18 - 17 */                };
    /*19 - 13 */            };
    /*20 -  9 */        };
    /*21 -  5 */    };
    /*22 -  1 */};
    /*23 -  1 */

    Since at the end of the file, the rule stack drops down (the grammar pops states), this is not a grammar bug, we should simply increase our max rule stack length.

  5. alexdima commented on Aug 29, 2016

    @alexdima
    Member

    Let's track in #9937

  6. added
    *duplicate
    on Aug 29, 2016
  7. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicatebugtokenization

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions