Commit Graph

58 Commits

Author SHA1 Message Date
pq 9ea17184ad Add @overrides to (a lot of) analyzer.
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 .
2016-03-01 16:33:20 -08:00
pq fa08150ca6 Support for embedder dependency changes (#25606).
Adds logic to detect when a library embedder is added as a dependency and reconfigures the `SourceFactory` appropriately.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1653733002 .
2016-02-09 09:39:59 -08:00
pq 9b1fa223a8 Embedded libs key rename to defuse server landmine.
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 .
2016-01-29 09:52:04 -08:00
danrubel d486870787 * fixes embedder bugs on Windows
* updates embedder tests to properly test Windows

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1612393002 .
2016-01-28 10:50:57 -05:00
danrubel 0e3416fffe fix embedder url mapping on Windows
see https://github.com/dart-lang/sdk/issues/25498

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1600933007 .
2016-01-21 09:56:42 -08:00
Dan Rubel 1ef8fc8cec simplify EmbedderUrlResolver
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1596693002 .
2016-01-15 21:21:11 -05:00
danrubel ebd1736c58 Add EmbedderSdk to EmbedderUriResolver
R=brianwilkerson@google.com, johnmccutchan@google.com, pquitslund@google.com

Review URL: https://codereview.chromium.org/1584663006 .
2016-01-14 14:51:43 -05:00
pq 34780784f2 Error code validation updates.
Updates validation to handle configured severities (`error`, `info`, and `warning`).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1541453002 .
2015-12-18 12:58:25 -08:00
pq 62656833d4 Wraps up the server-side of the 'Allow a user to configure which hints are "fatal"' ask (#24452).
* migrates error filtering from a predicate to a process that can customize severities.
* moves filtering/processing from the `dart` task into the `getErrors` request and the errors notification.

See: https://github.com/dart-lang/sdk/issues/24452

(Pending a thumbs-up, support for CLI to follow.)

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1517723002 .
2015-12-10 13:35:11 -08:00
Brian Wilkerson f0d249e269 Clean up package imports and library names
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1513643009 .
2015-12-10 08:11:56 -08:00
Konstantin Shcheglov ac24bd115c Don't run 'pub list-package-dirs' if there is no pubpsec.lock file.
This should help on DAS startup - if we don't have to run Pub, this saves as much as 400ms for each pubspec.yaml file.
Without pubspec.yaml we won't get any results anyway.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1470793002 .
2015-11-23 09:19:10 -08:00
John McCutchan bb4d547a5d Add _embedder.yaml support to analyzer and analysis_server
- If a package has an '_embedder.yaml'  file with an 'embedder_libs' key two things happen:
  1) We do not use the DartUriResolver to resolve dart: libraries.
  2) We use the EmbedderUriResolver to resolve all dart: libraries

- If multiple packages have an '_embedder.yaml' file we merge them.
  - This might not be the final behaviour that we want but I'm not sure how to surface errors to the end user.

- The '_embedder.yaml' file has a top level key 'embedder_libs' which is a map from dart: library uri to source path. Other keys are ignored by the EmbedderUriResolver.

- Unit tests for analyzer
- Integration test for analysis_server.

R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1437893003 .
2015-11-16 15:30:17 -08:00
Konstantin Shcheglov 508b70bdab Replace Glob implementation.
This makes MDL analysis another 5% faster.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1452473002 .
2015-11-15 12:17:17 -08:00
pq b0a08827aa Improves options validation type safety (#24885).
Fixes #24885.

https://github.com/dart-lang/sdk/issues/24885

BUG=24885
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1437703003 .
2015-11-12 09:44:25 -08:00
pq 67dc108f39 Map merging.
Basic YAML map merging suitable for merging a default map with an overriding one.

The semantics favor the overrider with a twist to support a short-hand for lists that stand-in for maps of scalars to booleans.  Specifically, lint rules can be enumerated as a list or as a map.  To make this work, lists can be "promoted" to maps.  In particular, if

linter:
  rules:
    - camel_case_types
    - one_member_abstracts

is merged with

linter:
  rules:
    one_member_abstracts: false
    always_specify_return_types: true

the right thing is done to get us to:

linter:
  rules:
    camel_case_types: true
    one_member_abstracts: false
    always_specify_return_types: true

R=brianwilkerson@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1425393002 .
2015-11-03 10:42:18 -08:00
pq ffeacec73d Improved YAML doc exception handling.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1415153004 .
2015-10-28 11:24:42 -07:00
pq 6c85fe785a Analysis Options error notifications.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1411013003 .
2015-10-21 09:59:19 -07:00
pq bf0ba96027 Analysis Options processing task and manager.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1413973003 .
2015-10-20 15:38:55 -07:00
pq 140a4f5891 Register .analysis_options files for analysis.
Some oportunistic constant cleanup as well (follow-up from: https://codereview.chromium.org/1399893004/).

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1412213003 .
2015-10-19 09:46:54 -07:00
John McCutchan 9535715f92 Fix handling of empty .analysis_options files and test this case
Fixes #24431

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1369573003 .
2015-09-24 12:38:53 -07:00
Brian Wilkerson 24b24a3569 Reformat code to reduce churn
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1322513004 .
2015-09-09 08:19:41 -07:00
John McCutchan aa430494f4 Fix script entry case of SdkExtUriResolver.restoreAbsolute
- Fix entry case of restoreAbsolute.
- Add TODO to fix part case

R=paulberry@google.com

Review URL: https://codereview.chromium.org//1294473009 .
2015-08-17 10:01:01 -07:00
Paul Berry d977370e3f Fix PathFilter constructor to be backward compatible with analyzer 0.26.0.
Commit 24189ea4f9 modified the
PathFilter constructor signature in a backwards-incompatible way, and
made corresponding changes to analysis_server, causing warnings to
show up in analysis_server when analyzed using the version of analyzer
in its pubspec.

This CL switches to a backwards-compatible signature and updates the
analyzer pubspec in preparation for publishing.  Once the new version
of analyzer is published I will update analysis_server's pubspec to
point to it, which should fix the warnings.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1278823002 .
2015-08-06 11:03:55 -07:00
John McCutchan dfc35faaf9 Make exclude list also exclude contexts
- Only create a context if the directory/.packages/pubspec.yaml is not excluded.
- Add tests.

Fixes: https://github.com/dart-lang/sdk/issues/23941

R=brianwilkerson@google.com, devoncarew@google.com, paulberry@google.com, pquitslund@google.com

Review URL: https://codereview.chromium.org//1263443005 .
2015-08-03 13:54:17 -07:00
Brian Wilkerson 24189ea4f9 Make PathFilter use the resource providers path context
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1260443006 .
2015-07-31 10:06:38 -07:00
pq f013d3868c Actual URI support for package URI resolution.
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1245263002 .
2015-07-21 15:53:56 -07:00
John McCutchan 977d213344 Refactor AnalysisOptionsProvider
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1245513002 .
2015-07-17 15:17:40 -07:00
John McCutchan 4bf66ce912 Add an AnalysisOptionsProvider to analyzer
BUG=
R=pquitslund@google.com

Review URL: https://codereview.chromium.org//1231633011 .
2015-07-17 13:34:03 -07:00
John McCutchan c9dd867c1f Add path filter
BUG=
R=pquitslund@google.com

Review URL: https://codereview.chromium.org//1232763004 .
2015-07-17 10:06:29 -07:00
pq a81c308283 Analyzer code cleanup.
Removed some unused imports and fixed member sorting.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1230273002 .
2015-07-10 13:42:27 -07:00
John McCutchan 7abe54a857 Move from .sdkext to _sdkext
Reason: Pub does not publish dot files.

Review URL: https://codereview.chromium.org//1224103003 .
2015-07-08 16:33:09 -07:00
John McCutchan 13deb397a0 Second attempt at fixing SdkExtUriResolver.restoreAbsolute
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1229563006 .
2015-07-08 12:50:38 -07:00
John McCutchan 6ecf960c5e Move SdkExtUriResolver from analysis_server to analyzer so it can be used in analyzer_cli
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1214823003 .
2015-07-08 10:28:19 -07:00
Paul Berry db6c95502a Work around naming conflict in analyzer's Resource class.
Commit f8ce36df55 introduced an SDK
class called "Resource", causing warnings to appear in any files that
reference the analyzer class with the same name.  (Fortunately there
was no regression in functionality since the spec requires the name
conflict to be resolved in favor of the definition that is outside the
SDK).

As a short term workaround to avoid the warnings, we are explicitly
importing 'dart:core' and hiding the new Resource class.  In a future
CL, we plan to rework analyzer's Resource class in order to make some
changes necessary for ".packages" file support; when that happens we
will probably rename the class to avoid the name conflict.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1215753003.
2015-06-26 13:00:44 -07:00
Konstantin Shcheglov 4936eb8d5d Fix for 'Create part' Quick Fix.
1. NonExistingSource.modificationStamp should return -1.
2. NonExistingSource.fullName should be always an absolute path, not a URI.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1135073004
2015-05-18 11:55:23 -07:00
paulberry@google.com 279c20a625 Log details of calls to "pub list" to instrumentation.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1079673002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45080 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 21:50:45 +00:00
scheglov@google.com 9534f300c2 ReApply: Issue 23133. Fix for restoring 'package:' uris on Windows.
There was a bug in the previous version https://codereview.chromium.org//1070203002
We used system path context instead of the one from the given ResourceProvider.
So, it worked, but was failing tests on Windows, because we always use posix style.

R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23133

Review URL: https://codereview.chromium.org//1051273007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45069 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 15:27:07 +00:00
ricow@google.com 88a0451f5a Revert "Issue 23133. Fix for restoring 'package:' uris on Windows."
This reverts revision 45023

It is my strong suspicion that this is causing the redness here:
http://build.chromium.org/p/client.dart/builders/pub-win-russian-be/builds/3729/steps/pub%20and%20pkg%20%20tests%20failures/logs/stdio

R=scheglov@google.com, whesse@google.com
BUG=

Review URL: https://codereview.chromium.org//1073993004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45049 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 05:55:53 +00:00
scheglov@google.com 1be249945b Issue 23133. Fix for restoring 'package:' uris on Windows.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=23133

Review URL: https://codereview.chromium.org//1070203002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45023 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 18:23:42 +00:00
brianwilkerson@google.com 98b7382071 Reformat
R=paulberry@google.com

Review URL: https://codereview.chromium.org//975453004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44149 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 21:34:46 +00:00
paulberry@google.com 45b7294eff Don't do folder existence checks when parsing pub list results.
It's just a waste of time since we already to folder existence checks
when resolving package URI's.  Besides, all the folders output by pub
list should always exist except in pathological situations.

Improves total analysis time by about 2%.

R=danrubel@google.com

Review URL: https://codereview.chromium.org//952333002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44137 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 18:28:22 +00:00
danrubel@google.com a2baa0f2ba remove unused imports
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org//962323002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44104 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-27 21:09:29 +00:00
danrubel@google.com 10be2665af (TBR) fix PubPackageMapProvider to use resourceProvider context for path
BUG=

Review URL: https://codereview.chromium.org//966453002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44072 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 20:18:15 +00:00
danrubel@google.com 6a90488fc8 cache pub list results
BUG=
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//941883002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44062 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 17:24:08 +00:00
paulberry@google.com 88e19fcb6e When converting files to package URI's, favor longer directory matches.
Longer directory matches in mean that the relative path part of
the package URI will be shorter, making it more likely to match
user intent.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//953863004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44025 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-25 18:04:09 +00:00
paulberry@google.com 2b6e5b5f68 When translating from file to URI, make sure translation is reversible.
BUG=dartbug.com/22555
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//935453007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44003 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-24 22:15:39 +00:00
brianwilkerson@google.com 0e73ada9c2 Use package: URIs for files in lib
R=paulberry@google.com

Review URL: https://codereview.chromium.org//914373004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43827 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 22:47:34 +00:00
brianwilkerson@google.com c2d3ff3b95 Handle exception and clean-up code
R=scheglov@google.com

Review URL: https://codereview.chromium.org//907483004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43563 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 19:19:55 +00:00
scheglov@google.com 658d3e949e Check PackageMapUriResolver constructor arguments.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org//887943004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43405 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 16:06:25 +00:00
danrubel@google.com 3f91cbb15e null check for pub result in PubPackageMapProvider
BUG=dartbug.com/21814
R=paulberry@google.com

Review URL: https://codereview.chromium.org//750113003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42173 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 18:58:31 +00:00