Skip to content

Commit

Permalink
Fix Nuclide bug around tag @generated
Browse files Browse the repository at this point in the history
Summary:
Cause:
Currently Nuclide will cache a file's status to readonly when the file contains 'generated' this cache is not cleared when user eliminates the string 'generated'. Thus, the file is always marked as readonly, even after user replaced 'generated', saved and reopen the file.

Fix:
On file save, clear the cache for generated tag.

Reviewed By: drmathochist

Differential Revision: D6776062

fbshipit-source-id: d9c238c15186372cae6c8a92f88747711740269e
  • Loading branch information
Hai Wang authored and facebook-github-bot committed Jan 23, 2018
1 parent 49df732 commit b044201
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/nuclide-generated-files-rpc/lib/GeneratedFileService.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export async function getGeneratedFileType(
return tag;
}

export async function invalidateFileTypeCache(
filePath: NuclideUri,
): Promise<void> {
cache.del(filePath);
}

export async function getGeneratedFileTypes(
dirPath: NuclideUri,
): Promise<Map<NuclideUri, GeneratedFileType>> {
Expand Down

0 comments on commit b044201

Please sign in to comment.