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

Typescript syntax highlight breaks on function calls with multiline generics #767

Closed
kallja opened this issue Aug 7, 2019 · 1 comment
Closed
Labels
limitation Issue is result of tmLanguage limitation where in the lookup does not go beyond current line wontfix Issue is either side effect or limitation that will not be fixed for now

Comments

@kallja
Copy link

kallja commented Aug 7, 2019

  • VSCode Version: 1.36.1
  • OS Version: macOS 10.14.5

Steps to Reproduce:

  1. create a new typescript file with the provided code content
    // Function declaration syntax highlight works as expected
    const fn = <
      ThisVeryLongTypeParameterNameTellsALotOfHowTheParamIsUsedInThisFunction,
      B
    >(
      a: ThisVeryLongTypeParameterNameTellsALotOfHowTheParamIsUsedInThisFunction,
    ) => {
      return {} as B;
    };
    
    type ATypeWithAnIncrediclyLongYetStrangelyDescriptiveName = {};
    type AnOtherTypeWithAVeryLongName = {};
    
    // Function call syntax hightlight breaks
    fn<
      ATypeWithAnIncrediclyLongYetStrangelyDescriptiveName,
      AnOtherTypeWithAVeryLongName
    >({});
  2. Review the broken syntax highlight at the function call:
    image

Does this issue occur when all extensions are disabled?: Yes

@mjbvz mjbvz transferred this issue from microsoft/vscode Aug 11, 2019
@mjbvz mjbvz removed their assignment Aug 11, 2019
@sheetalkamat
Copy link
Member

This is working as per limitation of tmLanguage grammar since it doesnot allow multiline lookup. At fn we don't know if its a less than expression or call and hence the coloring.

@sheetalkamat sheetalkamat added limitation Issue is result of tmLanguage limitation where in the lookup does not go beyond current line wontfix Issue is either side effect or limitation that will not be fixed for now labels Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
limitation Issue is result of tmLanguage limitation where in the lookup does not go beyond current line wontfix Issue is either side effect or limitation that will not be fixed for now
Projects
None yet
Development

No branches or pull requests

3 participants