Skip to content

Commit d460ae8

Browse files
jbrown215facebook-github-bot
authored andcommitted
[flow] add optional fallback to ExplicitlyIgnored variant
Summary: This stack will add the capability to provide a backup flowconfig path to use for explicitly ignored files, which will allow us to give IDE support to directory structures like: ``` multiplat/ ├── code │ ├── a.js │ └── a.native.js ├── .flowconfig // ignores a.native.js └── other-code └──.flowconfig // Checks a.native.js ``` Right now, if we open code/a.native.js we provide no IDE support because it is explicitly ignored by `multiplat/.flowconfig`. This stack will allow us to specify that `a.native.js` is checked by `other-code/.flowconfig` by calling `flow ls --explain`. NOTE: This is a TEMPORARY solution intended to be a stopgap and will thus not be documented. The real solution here is to unify the flowconfigs and support multiplatform projects properly. Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D69859084 fbshipit-source-id: 97df0e2fccaf5d44cfdbefba761d3e123281c8c1
1 parent 782ecda commit d460ae8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/commands/lsCommand.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type file_result =
5252
| ImplicitlyIncluded
5353
| ExplicitlyIncluded
5454
| ImplicitlyIgnored
55-
| ExplicitlyIgnored
55+
| ExplicitlyIgnored of string option
5656
| ImplicitLib
5757
| ExplicitLib
5858
| ConfigFile
@@ -61,7 +61,7 @@ let string_of_file_result = function
6161
| ImplicitlyIncluded -> "ImplicitlyIncluded"
6262
| ExplicitlyIncluded -> "ExplicitlyIncluded"
6363
| ImplicitlyIgnored -> "ImplicitlyIgnored"
64-
| ExplicitlyIgnored -> "ExplicitlyIgnored"
64+
| ExplicitlyIgnored _ -> "ExplicitlyIgnored"
6565
| ImplicitLib -> "ImplicitLib"
6666
| ExplicitLib -> "ExplicitLib"
6767
| ConfigFile -> "ConfigFile"
@@ -70,7 +70,7 @@ let string_of_file_result_with_padding = function
7070
| ImplicitlyIncluded -> "ImplicitlyIncluded"
7171
| ExplicitlyIncluded -> "ExplicitlyIncluded"
7272
| ImplicitlyIgnored -> "ImplicitlyIgnored "
73-
| ExplicitlyIgnored -> "ExplicitlyIgnored "
73+
| ExplicitlyIgnored _ -> "ExplicitlyIgnored "
7474
| ImplicitLib -> "ImplicitLib "
7575
| ExplicitLib -> "ExplicitLib "
7676
| ConfigFile -> "ConfigFile "
@@ -89,7 +89,7 @@ let explain ~flowconfig_name ~root ~options ~libs raw_file =
8989
else if Server_files_js.config_file flowconfig_name root = file then
9090
ConfigFile
9191
else if Files.is_ignored options file then
92-
ExplicitlyIgnored
92+
ExplicitlyIgnored None
9393
else if String.starts_with ~prefix:root_str file then
9494
ImplicitlyIncluded
9595
else if Files.is_included options file then

0 commit comments

Comments
 (0)