Skip to content

[Flow] Nested Generic Types break syntax highlighting #1234

Open
@vctrshn

Description

@vctrshn

It seems like using nested generic types ends up breaking syntax highlighting for the rest of the file.

Minimal Repro

// @flow                                                                                                                                                                                                                                                                                                                                       
const OOF = new Map<number, Map<number, string>>();                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                                               
export function thing(): Array<number> {                                                                                                                                                                                                                                                                                                       
  return [1, 2, 3];                                                                                                                                                                                                                                                                                                                            
}

Screen Shot 2021-04-25 at 5 20 59 PM

Formatting the code this way doesn't cause the same problem, if it helps track down the root cause:

// @flow                                                                                                                                                                                                                                                                                                                                       
const OOF = new Map<                                                                                                                                                                                                                                                                                                                           
  number,                                                                                                                                                                                                                                                                                                                                      
  Map<                                                                                                                                                                                                                                                                                                                                         
    number,                                                                                                                                                                                                                                                                                                                                    
    string,                                                                                                                                                                                                                                                                                                                                    
  >                                                                                                                                                                                                                                                                                                                                            
>();                                                                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                                               
export function thing(): Array<number> {                                                                                                                                                                                                                                                                                                       
  return [1, 2, 3];                                                                                                                                                                                                                                                                                                                            
}      

Screen Shot 2021-04-25 at 5 22 46 PM

Thanks in advance for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions