Commit Graph

2966 Commits

Author SHA1 Message Date
Konstantin Shcheglov e0c5a60f3e Remove accidentally committed 'print'.
TBR

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2523263002 .
2016-11-23 10:00:25 -08:00
Konstantin Shcheglov 9bc4c73e2d Stop returning declaration matches from search for references.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2518183003 .
2016-11-22 12:32:51 -08:00
Konstantin Shcheglov 26307d77b6 Implement SearchEngine for the new driver.
Only search for references, and only to local variables is implemented so far.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2521363003 .
2016-11-22 12:01:52 -08:00
Brian Wilkerson e63105555b Remove uses of configuration data
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2522543007 .
2016-11-22 11:26:08 -08:00
Konstantin Shcheglov 9f1ca4a119 Make AnalysisSErver APIs to access unit/node/element asynchronous.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2526473003 .
2016-11-22 10:46:06 -08:00
Brian Wilkerson a3e1a0d395 Enable generic method support by default
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2488043002 .
2016-11-22 09:16:19 -08:00
Konstantin Shcheglov ab0a8e775f Use single unit/node/element.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2525693002 .
2016-11-22 09:13:31 -08:00
Konstantin Shcheglov e769868325 Issue 27856. Fix for reponding to execution domain requests.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27856

Review URL: https://codereview.chromium.org/2524453002 .
2016-11-21 10:07:09 -08:00
Konstantin Shcheglov 73fccff8ea Make SearchMatch an interface, exclude 'context', move implementation.
Also, mostly drop 'fileStamp' in SourceFileEdit.
Only `-1` is kept when the file is a new one, in other cases it' `0`.
As I can see, IDEA cares only about `-1`.
We don't know modification stamps with the new analysis driver.
But we know content hashes.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2518903002 .
2016-11-21 10:05:21 -08:00
Konstantin Shcheglov 2301e67340 Put 'finer grained invalidation' back behind the flag.
Unfortunately we see exceptions in the wild, both internally and
externally :-(

For example https://github.com/dart-lang/sdk/issues/27770

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2518843002 .
2016-11-21 08:33:46 -08:00
Dan Rubel 74d713ece9 remove support for analyzer configuration in pubspec
This removes support for having directives like this in your pubspec:

analyzer:
  configuration: test_pack/config

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2511963002 .
2016-11-20 20:44:04 -05:00
Konstantin Shcheglov 4d003da5c8 Enable SDK summaries with --enable-new-analysis-driver flag.
...even if the IDEA does not use 'as-is' mode, it should not be a
problem in fishfooding. Hopefully a new IDEA will be released before
we would want to turn it on for our users.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2514053002 .
2016-11-18 11:32:01 -08:00
Dan Rubel 9ec7547323 update ContextManager to support analysis option include directive
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2514533002 .
2016-11-17 15:36:33 -05:00
Konstantin Shcheglov 5acc4aba69 Add stubs for requests that currently crash Analysis Server with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2512633002 .
2016-11-17 08:16:22 -08:00
Konstantin Shcheglov 89eabc8083 Evict from FileByteStore by the total cache size in bytes.
Limit the size in Analysis Server to 1 GiB.

Ideally we would need to in constructor all files by access time.
But requesting stats is much more expensive than just length :-(

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2492933002 .
2016-11-14 08:53:32 -08:00
Konstantin Shcheglov 978ab8ed3d Fixes for URI and Object completions with the new driver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2499693002 .
2016-11-11 13:53:56 -08:00
Konstantin Shcheglov d0ee9613d4 Fix disposing context with the new driver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2489523008 .
2016-11-10 13:13:06 -08:00
Konstantin Shcheglov d3b5ed9808 Support 'edit.organizeDirectives' with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2491953002 .
2016-11-10 09:52:40 -08:00
Konstantin Shcheglov 18b34d0d22 Add AnalysisDriverScheduler.status and extract status support.
Also use this 'status' stream to send analysis notification from DAS.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2491183002 .
2016-11-10 08:15:31 -08:00
Konstantin Shcheglov 617e1b88ca Support for AnalysisService.OVERRIDES with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2491843002 .
2016-11-10 06:50:26 -08:00
Konstantin Shcheglov 050e16d221 Evict using size in bytes in MemoryCachingByteStore.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2487313002 .
2016-11-09 12:22:32 -08:00
Konstantin Shcheglov b6c02291b8 Notify all drivers about all changed files.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2489063002 .
2016-11-09 11:32:02 -08:00
Paul Berry 1dfa5685ce Update cross-context options encoding to account for patchPlatform.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2486973004 .
2016-11-09 09:12:09 -08:00
Konstantin Shcheglov b22ac9c93d Use AnalysisDriverScheduler to schedule work across multiple AnalysisDriver(s).
I don't like that it lives in the same file, but I'd not like to
expose internals of AnalysisDriver or AnalysisDriverScheduler outside :-(

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2487003002 .
2016-11-08 18:05:16 -08:00
Konstantin Shcheglov f059523037 Highlight FieldFormalParameterElement as a field only in declaration.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27478

Review URL: https://codereview.chromium.org/2484883002 .
2016-11-07 12:03:06 -08:00
Konstantin Shcheglov fd3d6047fb Send notifications in the scheduled futures.
Doing this allows code completion to run before notifications, so
we get completions faster.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2481323002 .
2016-11-07 12:01:10 -08:00
Konstantin Shcheglov 9723a28457 Support for hover with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2477193002 .
2016-11-07 09:09:14 -08:00
Konstantin Shcheglov fc30904a39 Completion with the new analysis driver.
It works for top-levels, fields, locals, prefixed expressions.

Integration is not the most efficient - we resolve the full unit.
It works fine for files with about 1000 lines, about 50-70 ms.

We could slightly improve timing if we prioritize completion over
navigation and highlight notifications, which are currently prepared
and sent before completion.

In giant files like src/dart/element/element.dart, about 8500 lines,
it takes about 400 ms from typing to receiving completion. The theoretical
bottom bound for such files is about 70 ms - time that it required to
parse, create unlinked bundle, ensure that the API signature is the
same, load linked bundles and prepare to resynthesize. On top of this
goes any time required to resolve a single method and completion itself.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2478963002 .
2016-11-06 10:45:46 -08:00
Konstantin Shcheglov fa6cfb3515 Support for Quick Fixes with the new analysis driver.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2481643002 .
2016-11-06 10:09:30 -08:00
Konstantin Shcheglov 9f6e57635a Support for Quick Assists with the new analysis driver.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2480843002 .
2016-11-04 16:50:25 -07:00
Konstantin Shcheglov 64e0247700 Implement 'Sort Members' for the new analysis driver.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2473003003 .
2016-11-04 08:24:02 -07:00
Konstantin Shcheglov f55a9760fc Include LineInfo into AnalysisResult to allow reporting errors with lines/columns.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2468223003 .
2016-11-03 08:39:37 -07:00
Konstantin Shcheglov 99584133c8 Fixes for formatting and complete completion stub.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2467153002 .
2016-11-02 07:11:17 -07:00
Konstantin Shcheglov 5ba0fac019 Use FileContentOverlay instead of ContentCache in the new driver.
We do something strange in Analysis Server and the driver.
We get path, create the corresponding Source, and then put/get the
content using this Source. It seems more natural to use path everywhere.

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2473473002 .
2016-11-01 12:45:57 -07:00
Brian Wilkerson 313d236918 Fix offset for URI navigation (issue 27717)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2465393003 .
2016-11-01 12:28:07 -07:00
Konstantin Shcheglov c1a6321707 Get code to format from 'overlayState' or from the Source.
So, formatting will work for both old and new branches.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2466703002 .
2016-10-31 13:42:43 -07:00
Konstantin Shcheglov 19959a3464 Send analysis notifications after subscription.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2463193002 .
2016-10-31 13:40:21 -07:00
Konstantin Shcheglov 4d8ceb01a1 Send highlight and navigation notifications on result.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2469453002 .
2016-10-31 11:04:49 -07:00
Konstantin Shcheglov 0257eeb4f5 Simplify handling of watch events for the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2463903002 .
2016-10-31 11:00:22 -07:00
Konstantin Shcheglov 6826e267b9 Integration of the new analysis driver, behind a flag.
The flag is --enable-new-analysis-driver, disabled by default.

WIP, only error notifications for now.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2465923002 .
2016-10-31 09:54:31 -07:00
Konstantin Shcheglov 3319e6d0e3 Fix for inlining async methods/getters.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2463493002 .
2016-10-31 08:48:37 -07:00
Brian Wilkerson 96750cd5cb Split out options from ContextBuilder
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2425423009 .
2016-10-20 11:03:11 -07:00
Brian Wilkerson 4942f5304a Guard against a hypothetical null pointer dereference
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2421473007 .
2016-10-14 12:31:11 -07:00
Brian Wilkerson 3155b1e08c Remove unused method and field from DartSdkManager
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2415413003 .
2016-10-14 09:53:44 -07:00
Brian Wilkerson 5f5abd848c Fix exception in checked mode
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2409963004 .
2016-10-11 17:30:16 -07:00
Konstantin Shcheglov 56bde6da28 Issue 27542. Guard against CompilationUnitElement is null in SearchMatch.element getter.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27542

Review URL: https://codereview.chromium.org/2409403002 .
2016-10-11 14:09:09 -07:00
Konstantin Shcheglov 2a000e1587 Issue 27539. Check that the source is not modified between constructor and correction computing.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27539

Review URL: https://codereview.chromium.org/2411063002 .
2016-10-11 13:41:44 -07:00
Konstantin Shcheglov 831d3119f2 Issue 27536. Quick Fix for 'Avoid using braces in interpolation when not needed'.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27536

Review URL: https://codereview.chromium.org/2397153004 .
2016-10-07 12:51:04 -07:00
Brian Wilkerson 6de0803deb Clean up hints
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2394733004 .
2016-10-06 12:59:38 -07:00
Konstantin Shcheglov 5a4d7ebf61 Issue 27475. Discourage users from naming constructors the same as the enclosing classes.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27475

Review URL: https://codereview.chromium.org/2399533003 .
2016-10-05 12:07:40 -07:00