Skip to content

Commit

Permalink
[flow] add optional fallback to ExplicitlyIgnored variant
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jbrown215 authored and facebook-github-bot committed Feb 20, 2025
1 parent 782ecda commit d460ae8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/lsCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type file_result =
| ImplicitlyIncluded
| ExplicitlyIncluded
| ImplicitlyIgnored
| ExplicitlyIgnored
| ExplicitlyIgnored of string option
| ImplicitLib
| ExplicitLib
| ConfigFile
Expand All @@ -61,7 +61,7 @@ let string_of_file_result = function
| ImplicitlyIncluded -> "ImplicitlyIncluded"
| ExplicitlyIncluded -> "ExplicitlyIncluded"
| ImplicitlyIgnored -> "ImplicitlyIgnored"
| ExplicitlyIgnored -> "ExplicitlyIgnored"
| ExplicitlyIgnored _ -> "ExplicitlyIgnored"
| ImplicitLib -> "ImplicitLib"
| ExplicitLib -> "ExplicitLib"
| ConfigFile -> "ConfigFile"
Expand All @@ -70,7 +70,7 @@ let string_of_file_result_with_padding = function
| ImplicitlyIncluded -> "ImplicitlyIncluded"
| ExplicitlyIncluded -> "ExplicitlyIncluded"
| ImplicitlyIgnored -> "ImplicitlyIgnored "
| ExplicitlyIgnored -> "ExplicitlyIgnored "
| ExplicitlyIgnored _ -> "ExplicitlyIgnored "
| ImplicitLib -> "ImplicitLib "
| ExplicitLib -> "ExplicitLib "
| ConfigFile -> "ConfigFile "
Expand All @@ -89,7 +89,7 @@ let explain ~flowconfig_name ~root ~options ~libs raw_file =
else if Server_files_js.config_file flowconfig_name root = file then
ConfigFile
else if Files.is_ignored options file then
ExplicitlyIgnored
ExplicitlyIgnored None
else if String.starts_with ~prefix:root_str file then
ImplicitlyIncluded
else if Files.is_included options file then
Expand Down

0 comments on commit d460ae8

Please sign in to comment.