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 type in template literal breaks highlighting #577

Closed
char8x opened this issue Mar 6, 2018 · 1 comment
Closed

Flow type in template literal breaks highlighting #577

char8x opened this issue Mar 6, 2018 · 1 comment

Comments

@char8x
Copy link

char8x commented Mar 6, 2018

From akamud/vscode-theme-onedark#87

Sample code

Extract from https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberClassComponent.js#L65

function(callback: mixed, callerName: string) {
  if (callback === null || typeof callback === 'function') {
    return;
  }
  const key = `${callerName}_${(callback: any)}`;
  if (!didWarnOnInvalidCallback[key]) {
    warning(
      false,
      '%s(...): Expected the last optional `callback` argument to be a ' +
        'function. Instead received: %s.',
      callerName,
      callback,
    );
    didWarnOnInvalidCallback[key] = true;
  }
};

Filename and Language selected

Using .js extension with JavaScript file type selected

Screenshot

image

Versions used

  • VSCode version: 1.20.1
  • OS Version: macOS 10.13.3
@sheetalkamat
Copy link
Member

The syntax ````${callerName}_${(callback: any)}`;``` is not a valid javascript or typescript which is what this repo supports for colorizing. You would need to have special tmLanguage to colorize this portion correctly.

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

No branches or pull requests

2 participants