If the package is know, we return the corresponding file, whether it
exists or not.
If the package is not know, there is no valid Source to resolve to,
so we return null.
We don't need all the features that existed.
Internally we switched to BazelPackageUriResolver, which has its own
logica for searching files in workspaces across multiple folders.
All the places where we create PackageMapUriResolver in analyzer
or analysis_server, we create it with exactly one folder.
R=brianwilkerson@google.com
BUG=
Review-Url: https://codereview.chromium.org/2812093002 .
Example error messages include:
/analysis_options.yaml(10..27): The include file other_options.yaml in /analysis_options.yaml cannot be found.
/analysis_options.yaml(10..27): Bad options file format (expected String scope key, got YamlScalar) in /other_options.yaml(0..0)
/analysis_options.yaml(10..27): Warning in the included options file /other_options.yaml(47..49): The option 'ftw' isn't supported by 'errors'.
Since the included options file may not be part of the project,
the error is reported on the initial include statement
and includes the needed location information for the user to track down the problem.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2502233004 .
A bunch of changes to pave the way for emebdder SDK summary creation.
* Moves _embedder.yaml processing into the embedder SDK (out of the resolver).
* Changes EmbedderUriResolver to compose rather than extend a DartUriResolver.
* Fixes the wierd handling (dropping to add back) of `dart:` URIs.
* Fixes the incorrect overriding docs for `SDKLibraryImpl.shortName`.
* Updates embedder test to include a definition of `dart:core` in anticipation of adding some embedder SDK tests.
Some API work TODO in a follow-up CL (notably the way we check for the presence of embedders by querying the resolver is odd).
BUG=
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2009303002 .
Currently, "sideways casts" -- type errors where one type is assigned
to an unrelated type -- are reported by both ErrorVerifier and strong
mode's Checker. This leads to duplicate errors that the user can see.
ErrorVerifier's errors are generally better: they give the user more
contextual information and are easier to read. So this CL eliminates
Checker's reporting of these errors and only uses ErrorVerifier's.
However, in strong mode, type errors like this are fatal: DDC can't
generate correct code. So this also automatically upgrades all static
type warnings to errors when strong mode is enabled.
R=brianwilkerson@google.com, leafp@google.com
Review URL: https://codereview.chromium.org/1780783002 .
This gets us roughly half+ way there. We should defintely consider automating this to speed up the rest. (Even with the quick-fix it's VERY tedious and slow going.)
Once we've done this in bulk, I'd like to add the `annotate_overrides` lint to analyzer and server `.analysis_options`.
BUG=
R=brianwilkerson@google.com, scheglov@google.com
Review URL: https://codereview.chromium.org/1749143003 .
1.13 stable builds of the SDK contain a version of server that fails catastrophically when analyzing source that imports packages that define embedded libraries. Since we can't pragmatically require more recent SDKs for flutter development we have been prevented from landing embedded libs in the flutter engine. By renaming the key we use to identify contributed libraries, this change avoids the issue. Old versions of server will simply ignore the new key and new ones will process it properly. Win-win!
BUG=
R=danrubel@google.com
Review URL: https://codereview.chromium.org/1643023002 .