Missing scopes and syntax highlighting issues

In order to promote Nova to my main editor, I’m implementing the current theme I’m using in another editor. While most of the scopes are enough, I found a couple of inconsistencies and syntax errors.

You’ll find my findings below, by language.

JS

  • javascript.functionArrow: scope targeting the ES6 “fat arrow” characters => used to declare an arrow function.
  • Keyword as used in imports has the generic javascript.identifier scope even though it is a reserved word in this case.
import {
  OpenSansText as Text,
} from 'basics/text'
  • Much like we have javascript.function.identifier.name, a javascript.key.function.name equivalent would be great, to be able to scope keys that contain functions.

TS

  • typescript.function.identifier.name: allow to target identifier name for function

TSX

  • tsx.tag.open.name.framework

  • tsx.tag.close.name.framework

    • TSX opening and closing tags do not use the generic tag.close scope.
  • TSX does not handle nesting JSX tags in attributes. The following code snippet highlights properly on JSX but not on TSX:

<ScrollView
	refreshControl={<RefreshControl onRefresh={props.refetch} refreshing={props.refreshing} />}
	contentInsetAdjustmentBehavior="always"
>

JSX

  • jsx.tag.close.name.framework: much like with .open, allow to target a closing tag name
    • JSX closing tags do not use the generic tag.close scope.
  • JSX mistakes plain text for identifiers when used as children, and mistakes closing tag for operators & identifiers:
<p>
  Children text should be white
</p>