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

[Flow] Nested Generic Types break syntax highlighting #1234

Open
vctrshn opened this issue Apr 26, 2021 · 1 comment
Open

[Flow] Nested Generic Types break syntax highlighting #1234

vctrshn opened this issue Apr 26, 2021 · 1 comment

Comments

@vctrshn
Copy link

vctrshn commented Apr 26, 2021

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!

@shannonmoeller
Copy link

shannonmoeller commented Jul 19, 2021

I commented out this line and it seems to be working on my machine now. Not sure what the ramifications are.

https://github.com/pangloss/vim-javascript/blob/master/extras/flow.vim#L12

It was added in #1161.

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

No branches or pull requests

2 participants