From b0442010ab8ed9f3a119378641be2918f745c39b Mon Sep 17 00:00:00 2001 From: Hai Wang Date: Mon, 22 Jan 2018 19:06:26 -0800 Subject: [PATCH] Fix Nuclide bug around tag @generated 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 --- pkg/nuclide-generated-files-rpc/lib/GeneratedFileService.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/nuclide-generated-files-rpc/lib/GeneratedFileService.js b/pkg/nuclide-generated-files-rpc/lib/GeneratedFileService.js index aeaf972253..d3ad734a70 100644 --- a/pkg/nuclide-generated-files-rpc/lib/GeneratedFileService.js +++ b/pkg/nuclide-generated-files-rpc/lib/GeneratedFileService.js @@ -53,6 +53,12 @@ export async function getGeneratedFileType( return tag; } +export async function invalidateFileTypeCache( + filePath: NuclideUri, +): Promise { + cache.del(filePath); +} + export async function getGeneratedFileTypes( dirPath: NuclideUri, ): Promise> {