Thom1729 / Sublime-JS-Custom

Customizable JavaScript syntax highlighting for Sublime Text.
MIT License
137 stars 9 forks source link

Incorrect flow syntax highlight #92

Closed ShinyChang closed 4 years ago

ShinyChang commented 4 years ago

Expected:

function useSnapshotWithStateChange(
  transaction: (<T>(RecoilState<T>, (T) => T) => void) => void,
): UpdatedSnapshot {
  const storeRef = useStoreRef();
  let snapshot = useTreeStateClone();
  const update = <T>({key}: RecoilState<T>, updater: T => T) => {
    [snapshot] = setNodeValue(
      storeRef.current,
      snapshot,
      key,
      peekNodeLoadable(storeRef.current, snapshot, key).map(updater),
    );
  };

  transaction(update);

  const atomValues: Map<NodeKey, mixed> = mapMap(
    snapshot.atomValues,
    v => v.contents,
  );
  // Only report atoms, not selectors
  const updatedAtoms = intersectSets(
    snapshot.dirtyAtoms,
    new Set(atomValues.keys()),
  );
  return {atomValues, updatedAtoms};
}

Actual:

image